[Enhancement]: Report Chapter state #1165

Open
opened 2026-04-24 23:51:40 +02:00 by adam · 0 comments
Owner

Originally created by @Frassensh on GitHub (Mar 6, 2025).

Describe the Feature/Enhancement

I am using Home Assistant companion app and its sensor Media Session.

Audiobookshelf app does not report chapters

Why would this be helpful?

It reports everything else fine and it is an easy fix

Future Implementation (Screenshot)

change this in PlayerNotificationService:

val extra = Bundle()
extra.putString(
MediaMetadataCompat.METADATA_KEY_ARTIST,
currentPlaybackSession!!.displayAuthor
)

val mediaDescriptionBuilder =
MediaDescriptionCompat.Builder()
.setExtras(extra)
.setTitle(currentPlaybackSession!!.displayTitle)

to this instead:

val extra = Bundle()
val albumValue = currentPlaybackSession!!.getChapterForTime(getCurrentTime())?.title
?: currentPlaybackSession!!.displayTitle

extra.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, currentPlaybackSession!!.displayAuthor)
extra.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, albumValue)

val mediaDescriptionBuilder =
MediaDescriptionCompat.Builder()
.setExtras(extra)
.setTitle(currentPlaybackSession!!.displayTitle)

Audiobookshelf App Version

Android App - 0.9.79

Current Implementation (Screenshot)

No response

Originally created by @Frassensh on GitHub (Mar 6, 2025). ### Describe the Feature/Enhancement I am using Home Assistant companion app and its sensor Media Session. Audiobookshelf app does not report chapters ### Why would this be helpful? It reports everything else fine and it is an easy fix ### Future Implementation (Screenshot) change this in PlayerNotificationService: val extra = Bundle() extra.putString( MediaMetadataCompat.METADATA_KEY_ARTIST, currentPlaybackSession!!.displayAuthor ) val mediaDescriptionBuilder = MediaDescriptionCompat.Builder() .setExtras(extra) .setTitle(currentPlaybackSession!!.displayTitle) to this instead: val extra = Bundle() val albumValue = currentPlaybackSession!!.getChapterForTime(getCurrentTime())?.title ?: currentPlaybackSession!!.displayTitle extra.putString(MediaMetadataCompat.METADATA_KEY_ARTIST, currentPlaybackSession!!.displayAuthor) extra.putString(MediaMetadataCompat.METADATA_KEY_ALBUM, albumValue) val mediaDescriptionBuilder = MediaDescriptionCompat.Builder() .setExtras(extra) .setTitle(currentPlaybackSession!!.displayTitle) ### Audiobookshelf App Version Android App - 0.9.79 ### Current Implementation (Screenshot) _No response_
adam added the enhancement label 2026-04-24 23:51:40 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1165