I have some folders that contain only sub-folders and no image files. I found these folders are always treated as new folders and get scanned again and again. I think the bug is in def __update_folder_info. There we only do an "UPDATE" without an "INSERT" like when we are dealing with image files.
I made the following changes by following the treatment of files and it seems to fix the problem.
def __update_folder_info(self, folder_collection):
if not folder_collection: return # **ADDED**
update_data = []
insert_data = [] # **ADDED**
sql_insert = "INSERT OR IGNORE INTO folder(name) VALUES(?)" # **ADDED**
sql = "UPDATE folder SET last_modified = ?, missing = 0 WHERE name = ?"
for folder, modtime in folder_collection:
update_data.append((modtime, folder))
insert_data.append((folder,)) # **ADDED**
self.__db_write_lock.acquire()
self.__db.executemany(sql_insert, insert_data) # **ADDED**
self.__db.executemany(sql, update_data)
self.__db_write_lock.release()
Please verify if that's the right fix.
Thanks for all the great work!
Vincent.
I have some folders that contain only sub-folders and no image files. I found these folders are always treated as new folders and get scanned again and again. I think the bug is in
def __update_folder_info
. There we only do an "UPDATE" without an "INSERT" like when we are dealing with image files.I made the following changes by following the treatment of files and it seems to fix the problem.
Please verify if that's the right fix. Thanks for all the great work! Vincent.