mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-30 15:17:14 +02:00
Fix:Android auto unable to play podcast episodes #832
This commit is contained in:
@@ -116,15 +116,16 @@ class MediaSessionCallback(var playerNotificationService:PlayerNotificationServi
|
|||||||
|
|
||||||
if (mediaId.isNullOrEmpty()) {
|
if (mediaId.isNullOrEmpty()) {
|
||||||
libraryItemWrapper = playerNotificationService.mediaManager.getFirstItem()
|
libraryItemWrapper = playerNotificationService.mediaManager.getFirstItem()
|
||||||
} else if (mediaId.startsWith("ep_") || mediaId.startsWith("local_ep_")) { // Playing podcast episode
|
|
||||||
val libraryItemWithEpisode = playerNotificationService.mediaManager.getPodcastWithEpisodeByEpisodeId(mediaId)
|
|
||||||
libraryItemWrapper = libraryItemWithEpisode?.libraryItemWrapper
|
|
||||||
podcastEpisode = libraryItemWithEpisode?.episode
|
|
||||||
} else {
|
} else {
|
||||||
libraryItemWrapper = playerNotificationService.mediaManager.getById(mediaId)
|
val libraryItemWithEpisode = playerNotificationService.mediaManager.getPodcastWithEpisodeByEpisodeId(mediaId)
|
||||||
|
if (libraryItemWithEpisode != null) {
|
||||||
if (libraryItemWrapper == null) {
|
libraryItemWrapper = libraryItemWithEpisode.libraryItemWrapper
|
||||||
Log.e(tag, "onPlayFromMediaId: Media item not found $mediaId")
|
podcastEpisode = libraryItemWithEpisode.episode
|
||||||
|
} else {
|
||||||
|
libraryItemWrapper = playerNotificationService.mediaManager.getById(mediaId)
|
||||||
|
if (libraryItemWrapper == null) {
|
||||||
|
Log.e(tag, "onPlayFromMediaId: Media item not found $mediaId")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -49,10 +49,10 @@ class MediaSessionPlaybackPreparer(var playerNotificationService:PlayerNotificat
|
|||||||
val libraryItemWrapper: LibraryItemWrapper?
|
val libraryItemWrapper: LibraryItemWrapper?
|
||||||
var podcastEpisode: PodcastEpisode? = null
|
var podcastEpisode: PodcastEpisode? = null
|
||||||
|
|
||||||
if (mediaId.startsWith("ep_") || mediaId.startsWith("local_ep_")) { // Playing podcast episode
|
val libraryItemWithEpisode = playerNotificationService.mediaManager.getPodcastWithEpisodeByEpisodeId(mediaId)
|
||||||
val libraryItemWithEpisode = playerNotificationService.mediaManager.getPodcastWithEpisodeByEpisodeId(mediaId)
|
if (libraryItemWithEpisode != null) {
|
||||||
libraryItemWrapper = libraryItemWithEpisode?.libraryItemWrapper
|
libraryItemWrapper = libraryItemWithEpisode.libraryItemWrapper
|
||||||
podcastEpisode = libraryItemWithEpisode?.episode
|
podcastEpisode = libraryItemWithEpisode.episode
|
||||||
} else {
|
} else {
|
||||||
libraryItemWrapper = playerNotificationService.mediaManager.getById(mediaId)
|
libraryItemWrapper = playerNotificationService.mediaManager.getById(mediaId)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user