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

searchrss.py wishlist adds all books as audiobook wanted #1606

Closed jcal22 closed 5 years ago

jcal22 commented 5 years ago

I have wishlists through Goodreads and want to add ebooks only. It's adding audiobooks as well.

providers.py line 721 add sets types='E'

In searchrss.py line 67 it looks as if audio_status will be set to "Skipped"

If the book is not in the db, it runs

import_book(book['rss_bookid'], ebook_status, audio_status)
                    new_books += 1

which is correct, but on subsequent runs it looks like it will always run

else: # skipped/ignored logger.info('Found audiobook %s, marking as "Wanted"' % bookname) controlValueDict = {"BookID": book['rss_bookid']} newValueDict = {"AudioStatus": "Wanted"} myDB.upsert("books", newValueDict, controlValueDict) new_books += 1

It's not checking the audio_status that I can tell.

I think it's adding the wishlist books to audiobooks on the second run whether or not they're marked to be skipped. I'm not positive it's why, but I tried to poke around.

Debug log doesn't show anything except that it's adding the audiobooks as wanted.

jcal22 commented 5 years ago

2018-10-12 15:46:44 | INFO | WEBSERVER | searchrss.py | search_wishlist | 87 | Found audiobook Pale Demon, marking as "Wanted"
-- | -- | -- | -- | -- | -- | --
2018-10-12 15:46:44 | INFO | WEBSERVER | searchrss.py | search_wishlist | 87 | Found audiobook A Perfect Blood, marking as "Wanted"
2018-10-12 15:46:44 | INFO | WEBSERVER | searchrss.py | search_wishlist | 87 | Found audiobook Ever After, marking as "Wanted"
2018-10-12 15:46:44 | INFO | WEBSERVER | searchrss.py | search_wishlist | 87 | Found audiobook Top Secret Twenty-One, marking as "Wanted"
philborman commented 5 years ago

Yes that looks like a bug. Unfortunately I'm away this weekend so won't get a chance to fix it for a few days.

Th fix is fairly simple if you want to try it... change the else: to elif audio_status == 'Wanted': (and a similar change to the else: for ebook_status a few lines earlier)