DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
732 stars 71 forks source link

How does LL detect ebooks and Audiobooks for post processing? #1640

Closed saitoh183 closed 5 years ago

saitoh183 commented 5 years ago

So i have a Audiobook Magic Triumphs by Ilona Andrews

I have tried to name it different ways for manual import to pick it up but nothing seems to work. I have tried folder name Ilona Andrews - Magic Triumphs or Ilona Andrews - Kate Daniels 10 - Magic Triumphs or Magic Triumphs File named Ilona Andrews - Magic Triumphs or Ilona Andrews - Kate Daniels 10 - Magic Triumphs

i also had the ebook version and it worked with the folder named Magic Triumphs and the file named Ilona Andrews - Magic Triumphs. As you can see lower the ebook and audiobooks were in the same folder, after separating them and renaming the Ebook folder to Magic Triumphs, it picked it up with manual import.

So what are the rules for detection to work properly? Are they different for Ebooks and audiobooks? (which seems to be the case with my test)

Also shouldnt the book be added even if i dont have the author already in the system?

The original download came as:

ENCRYPTED + Ilona Andrews - Magic Triumphs
    ||
     Kate Daniels 10 - Magic Triumphs
        ||
         Kate Daniels 10 - Magic Triumphs - 01.mp4
         ...
     Kate Daniels [10] Magic Triumphs.epub
     Kate Daniels [10] Magic Triumphs.mobi

Logs:

23-Oct-2018 10:25:49 - DEBUG   :: IMPORTALT : postprocess.py:processAlternate:83 : Processing AudioBook directory /downloads/LazyLibrarian/manualimport
23-Oct-2018 10:25:49 - DEBUG   :: IMPORTALT : postprocess.py:processAlternate:83 : Processing AudioBook directory /downloads/LazyLibrarian/manualimport/Ilona Andrews - Magic Triumphs
23-Oct-2018 10:25:49 - WARNING :: IMPORTALT : postprocess.py:processAlternate:146 : No audiobook file found in /downloads/LazyLibrarian/manualimport/Ilona Andrews - Magic Triumphs
23-Oct-2018 10:25:49 - WARNING :: IMPORTALT : postprocess.py:processAlternate:146 : No audiobook file found in /downloads/LazyLibrarian/manualimport

If i go with the Adiobook Timothy Zahn - Specter of the Past

Timothy Zahn - Specter of the Past image

Logs:

23-Oct-2018 10:30:48 - DEBUG   :: IMPORTALT : postprocess.py:processAlternate:83 : Processing AudioBook directory /downloads/LazyLibrarian/manualimport
23-Oct-2018 10:30:48 - DEBUG   :: IMPORTALT : postprocess.py:processAlternate:83 : Processing AudioBook directory /downloads/LazyLibrarian/manualimport/Timothy Zahn - Specter of the Past
23-Oct-2018 10:30:48 - DEBUG   :: IMPORTALT : postprocess.py:processAlternate:177 : Author Timothy Zahn found in database
23-Oct-2018 10:30:48 - DEBUG   :: IMPORTALT : librarysync.py:find_book_in_db:172 : Searching database for [The Hand of Thrawn 01: Star Wars: Vision of the Future, Book 1 (New Unabridged Version] by [Timothy Zahn]
23-Oct-2018 10:30:48 - DEBUG   :: IMPORTALT : librarysync.py:find_book_in_db:255 : Searching 98 books by [Timothy Zahn] in database for [The Hand of Thrawn 01: Star Wars: Vision of the Future, Book 1 (New Unabridged Version]
23-Oct-2018 10:30:49 - DEBUG   :: IMPORTALT : librarysync.py:find_book_in_db:421 : Fuzz failed [Timothy Zahn - The Hand of Thrawn 01: Star Wars: Vision of the Future, Book 1 (New Unabridged Version] ratio [42,Star Wars - The Hand of Thrawn,41121370], partial [88,Vision of the Future,77786], partname [85,Thrawn,31140332]
23-Oct-2018 10:30:49 - WARNING :: IMPORTALT : postprocess.py:processAlternate:200 : AudioBook The Hand of Thrawn 01: Star Wars: Vision of the Future, Book 1 (New Unabridged Version by Timothy Zahn not found in database
23-Oct-2018 10:30:49 - WARNING :: IMPORTALT : postprocess.py:processAlternate:146 : No audiobook file found in /downloads/LazyLibrarian/manualimport
philborman commented 5 years ago

Couple of different issues here... No audiobook file found in /downloads/LazyLibrarian/manualimport/Ilona Andrews - Magic Triumphs We try to read id3 tags from the audiobook file, but it seems there isn't one. We look for audio files by checking the extensions against the list in lazylibrarian config->importing->file formats->audiobooks

If the audiobook doesn't have any tags we try to pattern match on the filename, but only if we think it's an audiobook to start with. Kate Daniels 10 - Magic Triumphs - 01.mp4 I guess you haven't got mp4 as an audiobook extension?

/downloads/LazyLibrarian/manualimport/Timothy Zahn - Specter of the Past You have the author Timothy Zahn in your database with 98 books, but it looks like the id3 tags show the book as The Hand of Thrawn 01: Star Wars: Vision of the Future, Book 1 (New Unabridged Version which doesn't appear to be the same book, at least not obviously so.
The nearest matches we could find were [42% match,Star Wars - The Hand of Thrawn,41121370] [88% match,Vision of the Future,77786] [85% match,Thrawn,31140332] none of which are close enough matches to auto detect. There is a book in goodreads for that author

Specter of the Past (Star Wars: The Hand of Thrawn Duology, #1)

which is probably the one we are trying to match, but the audiobook tags don't mention Specter of the Past, and the (Star Wars: The Hand of Thrawn Duology, #1) we treat as subtitle and series info

saitoh183 commented 5 years ago

Ok, good to know. With your info, i know what i need to change when files come down the pipe that are not processing. Is this the same for ebook? Also for book information, is Goodread the better choice over Google Books? also do i need a api key for google books?

philborman commented 5 years ago

For ebooks we read the tags if we can, then read the opf file if there is one, preferring the opf if there are differences (it's easier to edit). If we don't have author and title we try pattern matching on the filename.

Goodreads is generally a better choice, wasn't a few years ago but their data is user modfiable and has improved a lot recently. Google books needs an api key from https://developers.google.com/books/ and is very USA centric.