From a2ca34a5fa007f51737e3fff7f9bfd695cc223d1 Mon Sep 17 00:00:00 2001 From: shuaikangzhou <863909694@qq.com> Date: Thu, 18 Jan 2024 19:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86HardLinkVideoAttribute?= =?UTF-8?q?=E8=A1=A8=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/hard_link.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/DataBase/hard_link.py b/app/DataBase/hard_link.py index 881f636..f802bc5 100644 --- a/app/DataBase/hard_link.py +++ b/app/DataBase/hard_link.py @@ -169,6 +169,8 @@ class HardLink: video_db_lock.acquire(True) try: self.video_cursor.execute(sql, [md5]) + except sqlite3.OperationalError: + return None except AttributeError: self.init_database() self.video_cursor.execute(sql, [md5]) @@ -218,6 +220,8 @@ class HardLink: # dir0 = 'Thumb' if thumb else 'Image' dat_image = os.path.join(video_root_path, dir2, data_image) return dat_image + else: + return '' def close(self): if self.open_flag: