aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/AutoMediaBrowserService.java25
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/compat/RemoteControlClientLP.java2
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 c175671b..816a071d 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
@@ -601,7 +601,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)) {