avoid incorrect thumbnails

This commit is contained in:
2026-05-16 19:41:06 -04:00
parent 7bca2ade5a
commit 7187232236
2 changed files with 11 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ from sqlalchemy import select
from app.database import SessionLocal
from app.models import Library, MediaItem
from app.services.scanner import classify, hash_file
from app.services.thumbnails import thumbnail_path
log = logging.getLogger(__name__)
@@ -59,6 +60,7 @@ class LibraryEventHandler(FileSystemEventHandler):
)
item = result.scalars().first()
if item:
thumbnail_path(item.id).unlink(missing_ok=True)
item.rel_path = dest_rel
item.filename = Path(event.dest_path).name
item.missing = False