0.9.3.2: Delete entry from the DB is the file doesn't exists on the filesystem

This commit is contained in:
Fijxu 2024-11-21 03:23:29 -03:00
parent 9de4960932
commit 99c22095f9
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4
2 changed files with 3 additions and 1 deletions

View file

@ -2,7 +2,7 @@ colorize_logs: true
files: "./files"
thumbnails: "./thumbnails"
generateThumbnails: true
db: "./db.sqlite3"
db: "./db/db.sqlite3"
adminEnabled: true
adminApiKey: "asd"
fileameLength: 3

View file

@ -60,6 +60,8 @@ module Utils
SQL.exec "DELETE FROM files WHERE filename = ?", file[:filename]
rescue ex
LOGGER.error "#{ex.message}"
# Also delete the file entry from the DB if it doesn't exist.
SQL.exec "DELETE FROM files WHERE filename = ?", file[:filename]
end
end
end