Skip to content

Commit 74c9732

Browse files
committed
#389 Add artist radio for Madsonic. Madsonic has the ability to radio off individual songs, but we are not going to expose that just for Madsonic.
1 parent b2ea0d0 commit 74c9732

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,11 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
228228
if(!ServerInfo.isMadsonic(context)) {
229229
menu.removeItem(R.id.menu_top_tracks);
230230
}
231-
if(!ServerInfo.checkServerVersion(context, "1.11") || !ServerInfo.isStockSubsonic(context) || (id != null && "root".equals(id))) {
232-
menu.removeItem(R.id.menu_similar_artists);
231+
if(!ServerInfo.checkServerVersion(context, "1.11") || (id != null && "root".equals(id))) {
233232
menu.removeItem(R.id.menu_radio);
233+
menu.removeItem(R.id.menu_similar_artists);
234+
} else if(ServerInfo.isMadsonic(context)) {
235+
menu.removeItem(R.id.menu_similar_artists);
234236
}
235237
} else {
236238
if(podcastId == null) {

src/github/daneren2005/dsub/service/RESTMusicService.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,18 @@ public MusicDirectory getRandomSongs(int size, String artistId, Context context,
586586
values.add(size);
587587

588588
int instance = getInstance(context);
589-
Reader reader = getReader(context, progressListener, Util.isTagBrowsing(context, instance) ? "getSimilarSongs2" : "getSimilarSongs", null, names, values);
589+
String method;
590+
if(ServerInfo.isMadsonic(context, instance)) {
591+
method = "getPandoraSongs";
592+
} else {
593+
if (Util.isTagBrowsing(context, instance)) {
594+
method = "getSimilarSongs2";
595+
} else {
596+
method = "getSimilarSongs";
597+
}
598+
}
599+
600+
Reader reader = getReader(context, progressListener, method, null, names, values);
590601
try {
591602
return new RandomSongsParser(context, instance).parse(reader, progressListener);
592603
} finally {

0 commit comments

Comments
 (0)