Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chapters for plex audio books #736

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions music_assistant/server/providers/plex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
Artist,
ItemMapping,
MediaItem,
MediaItemChapter,
MediaItemImage,
Playlist,
ProviderMapping,
Expand Down Expand Up @@ -387,6 +388,14 @@ async def _parse_track(self, plex_track: PlexTrack) -> Track:
track.track_number = plex_track.trackNumber
if plex_track.parentIndex:
track.disc_number = plex_track.parentIndex
if plex_track.chapters:
track.metadata.chapters = [
MediaItemChapter(
plex_chapter.id, plex_chapter.start, plex_chapter.end, plex_chapter.title
)
for plex_chapter in plex_track.chapters
]

available = False
content = None

Expand Down