diff options
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/domain/ServerInfo.java | 11 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 8 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/domain/ServerInfo.java b/src/github/daneren2005/dsub/domain/ServerInfo.java index 9e1333da..a0ce23e1 100644 --- a/src/github/daneren2005/dsub/domain/ServerInfo.java +++ b/src/github/daneren2005/dsub/domain/ServerInfo.java @@ -187,6 +187,17 @@ public class ServerInfo implements Serializable { private static String getCacheName(Context context, int instance) { return "server-" + Util.getRestUrl(context, null, instance, false).hashCode() + ".ser"; } + + public static boolean hasArtistInfo(Context context) { + if(isStockSubsonic(context) && ServerInfo.checkServerVersion(context, "1.11")) { + return true; + } else if(isMadsonic(context)) { + // TODO: When madsonic adds support, figure out what REST version it is added on + return false; + } else { + return false; + } + } public static boolean canBookmark(Context context) { return checkServerVersion(context, "1.9"); diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 1e6218d1..f11995f8 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -692,8 +692,12 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
// If artist, we want to load the artist info to use later
- if(artist && ServerInfo.checkServerVersion(context, "1.11") && !Util.isOffline(context)) {
- artistInfo = musicService.getArtistInfo(id, refresh, context, this);
+ if(artist && ServerInfo.hasArtistInfo(context) && !Util.isOffline(context)) {
+ try {
+ artistInfo = musicService.getArtistInfo(id, refresh, context, this);
+ } catch(Exception e) {
+ Log.w(TAG, "Failed to get Artist Info even though it should be supported");
+ }
}
return new Pair<MusicDirectory, Boolean>(dir, licenseValid);
|