Skip to content

Add series to metadata#196

Open
fmunkes wants to merge 12 commits into
mainfrom
series
Open

Add series to metadata#196
fmunkes wants to merge 12 commits into
mainfrom
series

Conversation

@fmunkes

@fmunkes fmunkes commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

I really didn't know where to put the AudiobookSeries helper, as that is for the API.

@fmunkes fmunkes added the enhancement Enhancement of an existing feature/functionality label Apr 4, 2026
@fmunkes fmunkes changed the title Add MediaItem: Series Add series to metadata Apr 13, 2026
@fmunkes fmunkes requested a review from marcelveldt April 14, 2026 17:13
@fmunkes fmunkes marked this pull request as ready for review April 15, 2026 19:54
# chapters is a list of available chapters, sorted by position
# most commonly used for audiobooks and podcast episodes
chapters: list[MediaItemChapter] | None = None
series: UniqueList[MediaItemSeries] | None = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a book be part of multiple series?

@fmunkes fmunkes Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stumbled across this myself, as I had only a single series previously. I compared that to abs, and it supports multiple series. I googled a bit around, and apparently, there are some occasions where a book can be part of different aspects of e.g. a fantasy story, or you create two series e.g. for published order and chronological order.
It's probably rare, but I think it is easy to support, too.

A naming alternative could be to not name this series, but collection. In the end a series is just a collection of books, which has a defined order, so a sub-type of a collection. Would just be the wording, logic remains the same - what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collection makes sense because that is also how other media library tools reference this. For example for boxsets etc. in movies.



@dataclass
class AudiobookSeries(DataClassDictMixin):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too sure about this one. It kinda feels like it belongs in media_item.py, but that also makes it its own MediaItem. @marcelveldt what are your thoughts here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not following why we need this separate AudiobookSeries while there is also MediaItemSeries

what do you mean with "This is used as API response, and not to be used by a provider" ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MediaItemSeries is what a provider optionally adds to an audiobook. It has the title of the series, and the position of the book. The AudiobookSeries is what I use here https://github.com/music-assistant/server/pull/3569/changes#diff-58ca56e58a7f3ba8e137137eca36d0c66870c0f9c643a5a4f661b45b0ce6d1fcR380 as a helper when asking the api for series. And MA then searches the DB for books belonging to a series based on the MediaItemSeries.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, can you then expand the docstring and.or comments a bit to help future readers what is what ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of an existing feature/functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants