jellyfin / jellyfin-plugin-bookshelf

https://jellyfin.org
MIT License
212 stars 20 forks source link

Parse custom roles from Calibre opf #105

Open random-human-being opened 4 months ago

random-human-being commented 4 months ago

As of recent releases, bookshelf can scan Author and other select roles from an ebook/audiobook metadata.

Calibre allows the user to define custom columns for a variety of metadata. Among these, the user can specify that a column contains a person's name (or list thereof). This is the most straightforward way to include a field for translator, editor, foreword author, etc

For example, if I wanted to add a "Translator" field to my Calibre library metadata I would go to: Preferences > Add your own columns > Add custom column and there select the following:

... and leave the rest blank

Then the newly added Translator field can be edited from the GUI. If I then change the default blank value to a name (or a comma-separated list), Calibre will add a line to the corresponding metadata.opf, which ends up looking like the following two examples: https://pastebin.com/h0iMCeYk https://pastebin.com/sMDyra4D

The line that is added is a bit verbose, but the relevant metadata can be extracted as follows: https://pastebin.com/xzt1w7Rx (apologies for posting a script in Python rather than C#, but I am not familiar with the latter)

Could parsing of these fields be added to Jellyfin Bookshelf, and shown in the "People" section at the bottom of the ebook page?