Skip to content

Commit

Permalink
#389 Add artist radio for Madsonic. Madsonic has the ability to radio…
Browse files Browse the repository at this point in the history
… off individual songs, but we are not going to expose that just for Madsonic.
  • Loading branch information
daneren2005 committed Mar 9, 2015
1 parent b2ea0d0 commit 74c9732
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
if(!ServerInfo.isMadsonic(context)) {
menu.removeItem(R.id.menu_top_tracks);
}
if(!ServerInfo.checkServerVersion(context, "1.11") || !ServerInfo.isStockSubsonic(context) || (id != null && "root".equals(id))) {
menu.removeItem(R.id.menu_similar_artists);
if(!ServerInfo.checkServerVersion(context, "1.11") || (id != null && "root".equals(id))) {
menu.removeItem(R.id.menu_radio);
menu.removeItem(R.id.menu_similar_artists);
} else if(ServerInfo.isMadsonic(context)) {
menu.removeItem(R.id.menu_similar_artists);
}
} else {
if(podcastId == null) {
Expand Down
13 changes: 12 additions & 1 deletion src/github/daneren2005/dsub/service/RESTMusicService.java
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,18 @@ public MusicDirectory getRandomSongs(int size, String artistId, Context context,
values.add(size);

int instance = getInstance(context);
Reader reader = getReader(context, progressListener, Util.isTagBrowsing(context, instance) ? "getSimilarSongs2" : "getSimilarSongs", null, names, values);
String method;
if(ServerInfo.isMadsonic(context, instance)) {
method = "getPandoraSongs";
} else {
if (Util.isTagBrowsing(context, instance)) {
method = "getSimilarSongs2";
} else {
method = "getSimilarSongs";
}
}

Reader reader = getReader(context, progressListener, method, null, names, values);
try {
return new RandomSongsParser(context, instance).parse(reader, progressListener);
} finally {
Expand Down

0 comments on commit 74c9732

Please sign in to comment.