From 09525ac81e22fd6b9a9db9b2d81ca533545fd935 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Sat, 6 Aug 2022 10:28:36 +0200 Subject: [PATCH] Forward music play requests to PlaybackLauncher This allows the playback rewrite to play audio --- .../jellyfin/androidtv/ui/itemdetail/ItemListActivity.java | 3 +++ .../org/jellyfin/androidtv/ui/itemhandling/ItemLauncher.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/itemdetail/ItemListActivity.java b/app/src/main/java/org/jellyfin/androidtv/ui/itemdetail/ItemListActivity.java index 055c52e24f..5918aef30e 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/itemdetail/ItemListActivity.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/itemdetail/ItemListActivity.java @@ -303,6 +303,9 @@ public boolean onMenuItemClick(MenuItem item) { mediaManager.getValue().addToVideoQueue(row.getItem()); break; case "Audio": + PlaybackLauncher playbackLauncher = KoinJavaComponent.get(PlaybackLauncher.class); + if (playbackLauncher.interceptPlayRequest(ItemListActivity.this, row.getItem())) break; + mediaManager.getValue().queueAudioItem(row.getItem()); break; } diff --git a/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/ItemLauncher.java b/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/ItemLauncher.java index 89fec0fe4d..caf4157188 100644 --- a/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/ItemLauncher.java +++ b/app/src/main/java/org/jellyfin/androidtv/ui/itemhandling/ItemLauncher.java @@ -140,6 +140,10 @@ public static void launch(final BaseRowItem rowItem, ItemRowAdapter adapter, int Timber.d("got pos %s", pos); if (rowItem.getBaseItem() == null) return; + + PlaybackLauncher playbackLauncher = KoinJavaComponent.get(PlaybackLauncher.class); + if (playbackLauncher.interceptPlayRequest(activity, rowItem.getBaseItem())) return; + MediaManager mediaManager = KoinJavaComponent.get(MediaManager.class); // if the song currently playing is selected (and is the exact item - this only happens in the nowPlayingRow), open AudioNowPlayingActivity