From 44540a7b7f1bbbc9d2c6140f32eb1ed50775c163 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 6 Oct 2019 16:43:17 -0400 Subject: [PATCH] Changed cover image detection to favor Null --- lib/storage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/storage.py b/lib/storage.py index b52e761..a4b186e 100644 --- a/lib/storage.py +++ b/lib/storage.py @@ -46,7 +46,10 @@ class Storage: except: cover_image = book[2] x = self.cursor.execute(q_x, (book[0],)) try: len(x.fetchone()) > 0 - except Exception: self.cursor.execute(q, (book[0], book[1], cover_image, book[3])) + except Exception: + if not book[2]: # If cover image is missing unset entry + cover_image = None + self.cursor.execute(q, (book[0], book[1], cover_image, book[3])) return True except Exception as e: print(e)