aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@users.noreply.github.com>2018-01-17 09:09:19 -0800
committerGitHub <noreply@github.com>2018-01-17 09:09:19 -0800
commitcaae662a02faef75a73fa079c855cc6f2b50ce78 (patch)
tree3246b558163571ea1937bbfff2cefae39d4fec3b
parente11e62a8bf021e2bf3e563050ebe5c788678b7ef (diff)
parentca34b1b7efdfca4de6e1ed220f41e22286254532 (diff)
downloaddsub-caae662a02faef75a73fa079c855cc6f2b50ce78.tar.gz
dsub-caae662a02faef75a73fa079c855cc6f2b50ce78.tar.bz2
dsub-caae662a02faef75a73fa079c855cc6f2b50ce78.zip
Merge pull request #842 from hufman/aa-direct-song-playback
Changes AA song selection to play the directory
-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)) {