Skip to content

Commit

Permalink
Fix check for missing books on libraryscan
Browse files Browse the repository at this point in the history
  • Loading branch information
philborman committed Jun 21, 2017
1 parent fb777e1 commit 25b2ee4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lazylibrarian/librarysync.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def LibraryScan(startdir=None, library='eBook'):
for book in books:
bookfile = book['BookFile']

if not (bookfile and os.path.isfile(bookfile)):
if bookfile and not os.path.isfile(bookfile):
myDB.action('update books set Status="%s",BookFile="",BookLibrary="" where BookID="%s"' %
(status, book['BookID']))
logger.warn('eBook %s - %s updated as not found on disk' %
Expand All @@ -350,7 +350,7 @@ def LibraryScan(startdir=None, library='eBook'):
for book in books:
bookfile = book['AudioFile']

if not (bookfile and os.path.isfile(bookfile)):
if bookfile and not os.path.isfile(bookfile):
myDB.action('update books set AudioStatus="%s",AudioFile="",AudioLibrary="" where BookID="%s"' %
(status, book['BookID']))
logger.warn('Audiobook %s - %s updated as not found on disk' %
Expand Down

0 comments on commit 25b2ee4

Please sign in to comment.