When a photo is deleted or moved on the file system, the coresponding cache folder and database record are deleted.

fixes #56
This commit is contained in:
stz184
2020-07-24 20:37:58 +03:00
parent 3e4b232b1e
commit e89c84f45f
2 changed files with 71 additions and 0 deletions

View File

@@ -67,6 +67,11 @@ func scanAlbum(album *models.Album, cache *AlbumScannerCache, db *sql.DB) {
}
}
cleanup_errors := CleanupMedia(db, album.AlbumID, albumPhotos)
for _, err := range cleanup_errors {
ScannerError("Failed to delete old media: %s", err)
}
if album_has_changes {
timeoutDelay := 2000
notification.BroadcastNotification(&models.Notification{