diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-02-11 09:12:53 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-02-11 09:12:53 -0800 |
commit | e879d562a5237db93b83121f46ca8184635dd5fa (patch) | |
tree | d7b872abdd7a8b5626d5dc3599d51b64a052cc9d /src/github/daneren2005 | |
parent | 50d19a361880a2867193f19c460531514dec7f9a (diff) | |
download | dsub-e879d562a5237db93b83121f46ca8184635dd5fa.tar.gz dsub-e879d562a5237db93b83121f46ca8184635dd5fa.tar.bz2 dsub-e879d562a5237db93b83121f46ca8184635dd5fa.zip |
Fix for Madsonic claiming to be Subsonic 5.2 with only 5.0 features
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);
|