jellyfin / jellyfin-meta

A repository to hold our roadmap, policies, and more.
25 stars 4 forks source link

Support multi-part Audiobooks #71

Closed Samson50 closed 3 months ago

Samson50 commented 4 months ago

I am attempting to implement support for multi-part Audiobooks as described generally in this issue. Generally, users should be able to have Audiobooks under the Books library which are composed of multiple files and the server will recognize those files as belonging to a single Audiobook as implied in the Jellyfin documentation. Additionally, Audiobook should have at least the following features:

I have spent the last couple weeks getting familiar with the server and web code bases and I believe this feature requires changes to the server and web repositories. The issue is that the list view that is used for books cannot support resuming an Audiobook and the "Continue Listening" entry generated by items from the list view cannot support a play queue (resume chapter 4, chapters 5, 6, ... in queue). If I'm missing something, please let me know. I would love to be able to work on this feature without touching the web repository.

I have created forks with the changes I've made in my initial attempt to understand and implement this feature and I would really appreciate any feedback on the direction I'm going or where I've placed files. I've seen mention of migrating files to the jellyfin directories, but I wasn't sure what changes I should make to the structure so I just placed new files where it made sense with the current structure.

Server changes

I created AudioBook and AudioBookFile entities and the associated resolvers, managers, and other classes. Without modifications to the web repository, the changes allow the resolution of AudioBooks which contain one or more AudioBookFiles. You can play an AudioBook from the beginning from book library view, and the most recent chapter will appear in "Continue Listening" (if > 5 min and < 5 min remaining from server defaults). However, you cannot resume and AudioBook and the AudioBookFile available under "Continue Listening" will only play that individual file.

Web changes

I created a new view for books which is currently a simplified copy-paste of the list view. I intend to modify this view to get the desired behavior for Audiobooks while maintaining the current level of support for regular books.

I appreciate any feedback on this. I took this on as a learning project as I have no prior professional experience in web development. I really enjoy using Jellyfin and I would love to be able to contribute.