fix(db migration 9): filename property wasn't written correctly

This commit is contained in:
Jann Stute
2026-07-06 21:31:16 +02:00
parent 87822f6aa7
commit 33bc77cc9d
@@ -598,6 +598,8 @@ class Library:
logger.info(f"[Library] Library migrated to DB version {DB_VERSION}")
# check if folder matching current path exists already
# NOTE: this has been causing new Folders to be created when the library is moved, since
# its introduction
self.folder = session.scalar(select(Folder).where(Folder.path == library_dir))
if not self.folder:
folder = Folder(
@@ -686,7 +688,8 @@ class Library:
# Populate the new filename column.
for entry in self.__all_entries(session):
session.merge(entry).filename = entry.path.name
entry.filename = entry.path.name
session.merge(entry)
session.flush()
logger.info("[Library][Migration][9] Populated filename column in entries table")