avoid incorrect thumbnails
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user