1
0
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:
Nite 2020-09-24 15:16:59 +02:00
parent 4b36730358
commit 481084686b
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
5 changed files with 11 additions and 6 deletions

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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;

View File

@ -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");
}

View File

@ -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();