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

Unhandled exception in libraryScan: Traceback (most recent call last): File "C:\Users\mstrdraco\Downloads\LazyLibrarian-1.6.1\lazylibrarian\librarysync.py", line 718, in LibraryScan newauthor, authorid, new = addAuthorNameToDB(author) # get the author name as we know it... File "C:\Users\mstrdraco\Downloads\LazyLibrarian-1.6.1\lazylibrarian\importer.py", line 52, in addAuthorNameToDB match_fuzz = fuzz.ratio(item['AuthorName'].lower(), match_name) AttributeError: 'NoneType' object has no attribute 'lower' #1547

Closed mstrdraco closed 6 years ago

mstrdraco commented 6 years ago

Unhandled exception in libraryScan: Traceback (most recent call last): File "C:\Users\mstrdraco\Downloads\LazyLibrarian-1.6.1\lazylibrarian\librarysync.py", line 718, in LibraryScan newauthor, authorid, new = addAuthorNameToDB(author) # get the author name as we know it... File "C:\Users\mstrdraco\Downloads\LazyLibrarian-1.6.1\lazylibrarian\importer.py", line 52, in addAuthorNameToDB match_fuzz = fuzz.ratio(item['AuthorName'].lower(), match_name) AttributeError: 'NoneType' object has no attribute 'lower'

To help with identifying and fixing issues, please include as much information as possible, including:

LazyLibrarian version number (at the bottom of config page)

Current Version: bbb36a41779e0a68958c54ccb3dc26749490c143

Operating system used (windows, mac, linux, NAS type)

Windows Server 2016

Interface in use (default, bookstrap)

Bookstrap

Which api (Goodreads, GoogleBooks, both)

Goodreads

Source of your LazyLibrarian installation (git, zip file, 3rd party package)

zip

Relevant debug log with api keys and any passwords redacted

debug.zip

Please note - usually a single line of log is not sufficient. The lines just before the error occurs can give useful context and greatly assist with debugging.

There is a built-in debug log creator on the logs page which makes it easy to provide this information

philborman commented 6 years ago

Looks like you have an author entry in your database with no authorname. This shouldn't really happen. I will add some code to check for it and work around the problem. Shouldn't take long.

mstrdraco commented 6 years ago

Thank you :) 👍

philborman commented 6 years ago

There is some code to check for empty author names in the database upgrade code, so it looks like it's been a problem before, but I guess it's fairly rare or it would be run more regularly. Are you up to using a bit of command line to fix it, if not there will be a fix in the next release anyway, maybe after the weekend. It can be fixed with one simple sqlite command if you're ok with that... PRAGMA user_version=38; which forces lazylibrarian to "upgrade" the database from v38 to v39 (current) and after the redundant upgrade it will clean the database and remove any empty author names.

mstrdraco commented 6 years ago

Sure I'll give it a try I've ran into it a few times and figured it was a bad book that I had in my collection so deleted the book but I can do the command to see if it resolves future issues. I don't mind waiting until the release either now that I know it's just a small bug. New to this app so trying to get used to it.

mstrdraco commented 6 years ago

Stupid question though.. where would I run this command at?

philborman commented 6 years ago

Hmm, not stupid at all. On linux you would just fire up a terminal and type sqlite3 lazylibrarian.db "PRAGMA user_version=38;" on windows I think there is an sqlite3.exe command?

mstrdraco commented 6 years ago

Ok I ran it Hopefully won't run into the problem again lol :)