diff options
Diffstat (limited to 'app/src/main/java')
3 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/domain/ServerInfo.java b/app/src/main/java/github/daneren2005/dsub/domain/ServerInfo.java index 07a86db4..cb871008 100644 --- a/app/src/main/java/github/daneren2005/dsub/domain/ServerInfo.java +++ b/app/src/main/java/github/daneren2005/dsub/domain/ServerInfo.java @@ -210,4 +210,7 @@ public class ServerInfo implements Serializable { public static boolean canAlbumListPerFolder(Context context) { return ServerInfo.checkServerVersion(context, "1.11") && !ServerInfo.isMadsonic(context) && !Util.isTagBrowsing(context); } + public static boolean hasTopSongs(Context context) { + return ServerInfo.isMadsonic(context) || ServerInfo.checkServerVersion(context, "1.13"); + } } diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index c138b04e..430aaa3c 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -228,7 +228,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Section } else if(artist && !showAll) { menuInflater.inflate(R.menu.select_album, menu); - if(!ServerInfo.isMadsonic(context)) { + if(!ServerInfo.hasTopSongs(context)) { menu.removeItem(R.id.menu_top_tracks); } if(!ServerInfo.checkServerVersion(context, "1.11") || (id != null && "root".equals(id))) { @@ -555,7 +555,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Section new LoadTask(refresh) { @Override protected MusicDirectory load(MusicService service) throws Exception { - return service.getTopTrackSongs(name, 20, context, this); + return service.getTopTrackSongs(name, 50, context, this); } }.execute(); } diff --git a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java index c1eaa5cd..4597ed69 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java @@ -1192,7 +1192,8 @@ public class RESTMusicService implements MusicService { parameterNames.add("size"); parameterValues.add(size); - Reader reader = getReader(context, progressListener, "getTopTrackSongs", null, parameterNames, parameterValues); + String method = ServerInfo.isMadsonic(context, getInstance(context)) ? "getTopTrackSongs" : "getTopSongs"; + Reader reader = getReader(context, progressListener, method, null, parameterNames, parameterValues); try { return new RandomSongsParser(context, getInstance(context)).parse(reader, progressListener); } finally { |