diff options
author | Walter Huf <hufman@gmail.com> | 2018-01-15 09:06:13 -0800 |
---|---|---|
committer | Walter Huf <hufman@gmail.com> | 2018-01-15 09:06:13 -0800 |
commit | ca34b1b7efdfca4de6e1ed220f41e22286254532 (patch) | |
tree | 6127e70a3c7e0f3056f3c20fc1285d919240f488 | |
parent | c04999f5859fe9d0569e77bcfaacc13af8439c42 (diff) | |
download | dsub-ca34b1b7efdfca4de6e1ed220f41e22286254532.tar.gz dsub-ca34b1b7efdfca4de6e1ed220f41e22286254532.tar.bz2 dsub-ca34b1b7efdfca4de6e1ed220f41e22286254532.zip |
Changes AA song selection to play the directory
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java | 25 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java | 2 |
2 files changed, 21 insertions, 6 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java b/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java index 35f6d37a..88cfe559 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java @@ -279,12 +279,18 @@ public class AutoMediaBrowserService extends MediaBrowserService { // music files for(Entry entry: indexes.getEntries()) { + entry.setBookmark(null); // don't resume from a bookmark in a browse listing + Bundle extras = new Bundle(); + extras.putSerializable(Constants.INTENT_EXTRA_ENTRY, entry); + extras.putString(Constants.INTENT_EXTRA_NAME_CHILD_ID, entry.getId()); + MediaDescription description = new MediaDescription.Builder() .setTitle(entry.getTitle()) - .setMediaId(MUSIC_DIRECTORY_PREFIX + entry.getId()) + .setMediaId(entry.getId()) + .setExtras(extras) .build(); - mediaItems.add(new MediaBrowser.MediaItem(description, MediaBrowser.MediaItem.FLAG_BROWSABLE)); + mediaItems.add(new MediaBrowser.MediaItem(description, MediaBrowser.MediaItem.FLAG_PLAYABLE)); } result.sendResult(mediaItems); @@ -315,15 +321,24 @@ public class AutoMediaBrowserService extends MediaBrowserService { .setTitle(entry.getTitle()) .setMediaId(MUSIC_DIRECTORY_CONTENTS_PREFIX + entry.getId()) .build(); + + mediaItems.add(new MediaBrowser.MediaItem(description, MediaBrowser.MediaItem.FLAG_BROWSABLE)); } else { - // playback options for a single item + // mark individual songs as directly playable + entry.setBookmark(null); // don't resume from a bookmark in a browse listing + Bundle extras = new Bundle(); + extras.putSerializable(Constants.INTENT_EXTRA_ENTRY, entry); + extras.putString(Constants.INTENT_EXTRA_NAME_CHILD_ID, entry.getId()); + description = new MediaDescription.Builder() .setTitle(entry.getTitle()) - .setMediaId(MUSIC_DIRECTORY_PREFIX + entry.getId()) + .setMediaId(entry.getId()) + .setExtras(extras) .build(); + + mediaItems.add(new MediaBrowser.MediaItem(description, MediaBrowser.MediaItem.FLAG_PLAYABLE)); } - mediaItems.add(new MediaBrowser.MediaItem(description, MediaBrowser.MediaItem.FLAG_BROWSABLE)); } result.sendResult(mediaItems); } diff --git a/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java b/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java index 00bca833..461f89dc 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java +++ b/app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java @@ -564,7 +564,7 @@ public class RemoteControlClientLP extends RemoteControlClientBase { playSong(entry, true); } - // Currently only happens when playing bookmarks so we should be looking up parent + // Enqueue an entire directory when selecting a bookmark or a song String childId = extras.getString(Constants.INTENT_EXTRA_NAME_CHILD_ID, null); if(childId != null) { if(Util.isTagBrowsing(downloadService) && !Util.isOffline(downloadService)) { |