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.
730 stars 70 forks source link

Missing variable with manual import? #1636

Closed saitoh183 closed 6 years ago

saitoh183 commented 6 years ago

When running the example_custom_notification.py one of the Keys returned is Manual is that for when you use Alternate import? if so, it doesnt populate. What im trying to do Is find a variable i can use in my script to determine if im importing a ebook or audiobook. Some variables dont exist when using alternate import which is kind of a pain since the one that would have made my life simple is AuxInfo. It only appears when the import is from auto download.

Alternate/Manual import

BookFile: /books/James Patterson/Cross My Heart (591)/Cross My Heart - James Patterson.epub
BookPages: 544
BookIsbn: 9780316210904
AudioStatus: Skipped
BookGenre: 
BookDate: 2013
Status: Open
BookRate: 4.05
BookID: 17333277
BookName: Cross My Heart
BookLibrary: 2018-10-18 00:45:15
BookImg: cache/book/17333277.jpg
AudioFile: None
BookAdded: 2018-08-18
BookSub: (Alex Cross, #21)
OriginalPubDate: 2013
BookLink: https://www.goodreads.com/book/show/17333277-cross-my-heart
Manual: None
AuthorID: 3780
SeriesDisplay: Alex Cross 21
BookPub: Little, Brown and Company
BookDesc: James Patterson raises the stakes to their highest level, ever-when Alex Cross becomes the obsession of a genius of menace set on proving that he is the greatest mind in the history of crime. Detective Alex Cross is a family man at heart--nothing matters more to him than his children, his grandmother, and his wife Bree. His love of his family is his anchor, and gives him the strength to confront evil in his work. One man knows this deeply, and uses Alex's strength as a weapon against him in the most unsettling and unexpected novel of James Patterson's career.When the ones Cross loves are in danger, he will do anything to protect them. If he does anything to protect them, they will die.CROSS MY HEART is the most powerful Alex Cross novel ever, propelled by the ever-ingenious mind of James Patterson, the world's #1 bestselling writer.
ScanResult: 
WorkID: 24064581
BookLang: eng
AudioLibrary: None
Event: Added to Library

Auto import

BookFile: /books/J.K. Rowling/Harry Potter and the Chamber of Secrets (610)/Harry Potter and the Chamber of Secrets - J.K. Rowling.epub
AudioRequester: None
BookPages: 341
Source: SABNZBD
BookIsbn: 9780439064866
AudioStatus: Open
BookGenre: 
NZBurl: https://saitohsmedia.com/nzbhydra/getnzb/api/-2272944540184077987?apikey=ge8tiirkqsd250grt6etiu7nco
DownloadID: SABnzbd_nzo_wu0fDS
Status: Open
BookPub: Arthur A. Levine Books
BookDate: 1998
BookRate: 4.39
BookID: 15881
BookName: Harry Potter and the Chamber of Secrets
BookLibrary: 2018-10-19 16:20:06
NZBdate: 2018-10-19 16:20:06
Requester: None
NZBmode: nzb
BookImg: cache/book/15881.jpg
AudioFile: /audiobooks/J.K. Rowling/Harry Potter and the Chamber of Secrets/401-j.k._rowling_-_harry_potter_and_the_chamber_of_secrets-1999-praxis.mp3
BookAdded: 2018-08-18
BookSub: (Harry Potter, #2)
OriginalPubDate: 1998
Wanted_BookID: 15881
BookLink: https://www.goodreads.com/book/show/15881.Harry_Potter_and_the_Chamber_of_Secrets
Manual: None
NZBtitle: Harry Potter and the Chamber of Secrets
AuthorID: 1077326
NZBprov: nzbhydra2 [NZB]
SeriesDisplay: Harry Potter 2
Wanted_Status: Processed
BookDesc: The Dursleys were so mean and hideous that summer that all Harry Potter wanted was to get back to the Hogwarts School for Witchcraft and Wizardry. But just as he's packing his bags, Harry receives a warning from a strange, impish creature named Dobby who says that if Harry Potter returns to Hogwarts, disaster will strike<br /><br />And strike it does. For in Harry's second year at Hogwarts, fresh torments and horrors arise, including an outrageously stuck-up new professor, Gilderoy Lockhart, a spirit named Moaning Myrtle who haunts the girls' bathroom, and the unwanted attentions of Ron Weasley's younger sister, Ginny.<br /><br />But each of these seem minor annoyances when the real trouble begins, and someone -- or something -- starts turning Hogwarts students to stone. Could it be Draco Malfoy, a more poisonous rival than ever? Could it possibly be Hagrid, whose mysterious past is finally told? Or could it be the one everyone at Hogwarts most suspects . . . Harry Potter himself?<br /><br />--jacket description
AuxInfo: eBook
WorkID: 6231171
BookLang: eng
AudioLibrary: 2018-08-18 15:43:26
ScanResult: 
NZBsize: 0.31
DLResult: /books/J.K. Rowling/Harry Potter and the Chamber of Secrets (610)/Harry Potter and the Chamber of Secrets - J.K. Rowling.epub
Event: Added to Library
philborman commented 6 years ago

Manual is the flag showing you have manually edited the book details so we don't reload them and overwrite your edits.

The correct variable to use would be AuxInfo, but that's not appearing in alternate/manual list, I will look into why.

philborman commented 6 years ago

Ok, that should be fixed in next release. Was a fairly simple addition, thanks for the suggestion

saitoh183 commented 6 years ago

Woot! thanks this will make that I can use my script