jellyfin/jellyfin-plugin-bookshelf

OPF files being imported as a book in Jellyfin 10.6.1

Protektor-Desura opened this issue · 2 comments

When I create a book library and have Jellyfin 10.6.1 scan my books directory it is importing the metadata.opf files as if they are books. It never did this before. This is on a brand new library and new scan of the books directory. If you go in to the "book" it will let you try and download the metadata.opf file like it is a book you can download and read. It should be reading these opf files as the metadata they are, instead of thinking they are books.

89053895-82314200-d31d-11ea-9d08-5387b12732ea

It didn't used to do this back at Jellyfin 10.5.5.

Same in 10.7-rc1.

I think the issue is caused by this PR, where OPF files are read like ebooks and not like metadata.

According to the Open Packaging Format standard:

The OPF specification's purpose is to "...[define] the mechanism by which the various components of an OPS publication are tied together and provides additional structure and semantics to the electronic publication."[16] This is accomplished by two XML files with the extensions .opf and .ncx.

According to MobileRead:

The metadata is placed in an OPF file inside the ePub. It follows the rules of Dublin Core (DC)

(Although using it externally serves the same purpose as a .nfo file, which is to modify metadata present in the media file like an mp3 or a mkv file)

Now, someone on the matrix server pointed to me that opf used to be the format used before the epub era.

https://en.wikipedia.org/wiki/Open_eBook

Open eBook (or OEB), or formally, the Open eBook Publication Structure (OEBPS), is a legacy e-book format which has been superseded by the EPUB format.

The default file extension is .opf (OEB Package Format).

I now understand that the PR above was trying to include legacy e-books, because it could be tedious for some to convert their collection to the epub format.

Solution found:

Read metadata.opf as metadata, any other .opf file as a ebook. This assumes that the ebook file (epub for example) is in the same directory as the metadata file (Since normally the opf file is inside an ebook, with html files and images).

Calibre seems to always use metadata.opf to store the extra information, it would allow both the metadata file and legacy ebooks to be read by Jellyfin.