mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-01-30 08:54:51 +01:00
Fixed missing Genre Refresh functionality
This commit is contained in:
parent
4b36730358
commit
481084686b
@ -111,13 +111,14 @@ public class SelectGenreActivity extends SubsonicTabActivity implements AdapterV
|
||||
@Override
|
||||
protected List<Genre> doInBackground() throws Throwable
|
||||
{
|
||||
boolean refresh = getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_REFRESH, false);
|
||||
MusicService musicService = MusicServiceFactory.getMusicService(SelectGenreActivity.this);
|
||||
|
||||
List<Genre> genres = new ArrayList<Genre>();
|
||||
|
||||
try
|
||||
{
|
||||
genres = musicService.getGenres(SelectGenreActivity.this, this);
|
||||
genres = musicService.getGenres(refresh, SelectGenreActivity.this, this);
|
||||
}
|
||||
catch (Exception x)
|
||||
{
|
||||
|
@ -405,14 +405,18 @@ 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);
|
||||
if (refresh)
|
||||
{
|
||||
cachedGenres.clear();
|
||||
}
|
||||
List<Genre> result = cachedGenres.get();
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result = musicService.getGenres(context, progressListener);
|
||||
result = musicService.getGenres(refresh, context, progressListener);
|
||||
cachedGenres.set(result);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public interface MusicService
|
||||
|
||||
boolean isLicenseValid(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;
|
||||
|
||||
void star(String id, String albumId, String artistId, Context context, ProgressListener progressListener) throws Exception;
|
||||
|
||||
|
@ -770,7 +770,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");
|
||||
}
|
||||
|
@ -829,7 +829,7 @@ public class RESTMusicService implements MusicService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Genre> getGenres(Context context,
|
||||
public List<Genre> getGenres(boolean refresh, Context context,
|
||||
ProgressListener progressListener) throws Exception {
|
||||
updateProgressListener(progressListener, R.string.parser_reading);
|
||||
Response<GenresResponse> response = subsonicAPIClient.getApi().getGenres().execute();
|
||||
|
Loading…
x
Reference in New Issue
Block a user