diff options
Diffstat (limited to 'subsonic-android/src')
6 files changed, 10 insertions, 10 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java index f4b0f213..7ac7ace8 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectGenreFragment.java @@ -89,10 +89,10 @@ public class SelectGenreFragment extends SubsonicFragment implements AdapterView @Override
protected void refresh(boolean refresh) {
- load();
+ load(refresh);
}
- private void load() {
+ private void load(final boolean refresh) {
setTitle(R.string.main_albums_genres);
BackgroundTask<List<Genre>> task = new TabBackgroundTask<List<Genre>>(this) {
@@ -103,7 +103,7 @@ public class SelectGenreFragment extends SubsonicFragment implements AdapterView List<Genre> genres = new ArrayList<Genre>();
try {
- genres = musicService.getGenres(context, this);
+ genres = musicService.getGenres(refresh, context, this);
} catch (Exception x) {
Log.e(TAG, "Failed to load genres", x);
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 05b78eab..2fcdc00f 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -400,7 +400,7 @@ public class SubsonicFragment extends SherlockFragment { @Override
protected List<Genre> doInBackground() throws Throwable {
MusicService musicService = MusicServiceFactory.getMusicService(context);
- return musicService.getGenres(context, this);
+ return musicService.getGenres(false, context, this);
}
@Override
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/CachedMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/CachedMusicService.java index 71bbb867..314f065e 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -279,12 +279,12 @@ public class CachedMusicService implements MusicService { } @Override - public List<Genre> getGenres(Context context, ProgressListener progressListener) throws Exception { + public List<Genre> getGenres(boolean refresh, Context context, ProgressListener progressListener) throws Exception { checkSettingsChanged(context); - List<Genre> result = cachedGenres.get(); + List<Genre> result = refresh ? null : cachedGenres.get(); if (result == null) { - result = musicService.getGenres(context, progressListener); + result = musicService.getGenres(refresh, context, progressListener); cachedGenres.set(result); } diff --git a/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java index 31e9c23c..f69ebfb1 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/MusicService.java @@ -112,7 +112,7 @@ public interface MusicService { void addChatMessage(String message, Context context, ProgressListener progressListener) throws Exception; - List<Genre> getGenres(Context context, ProgressListener progressListener) throws Exception; + List<Genre> getGenres(boolean refresh, Context context, ProgressListener progressListener) throws Exception; public MusicDirectory getSongsByGenre(String genre, int count, int offset, Context context, ProgressListener progressListener) throws Exception; }
\ No newline at end of file diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index 97fed19f..9af58b16 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -483,7 +483,7 @@ public class OfflineMusicService extends RESTMusicService { } @Override - public List<Genre> getGenres(Context context, ProgressListener progressListener) throws Exception { + public List<Genre> getGenres(boolean refresh, Context context, ProgressListener progressListener) throws Exception { throw new OfflineException("Getting Genres not available in offline mode"); } diff --git a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java index 5fc66190..f4f64046 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/RESTMusicService.java @@ -790,7 +790,7 @@ public class RESTMusicService implements MusicService { } @Override - public List<Genre> getGenres(Context context, ProgressListener progressListener) throws Exception { + public List<Genre> getGenres(boolean refresh, Context context, ProgressListener progressListener) throws Exception { checkServerVersion(context, "1.9", "Genres not supported."); Reader reader = getReader(context, progressListener, "getGenres", null); |