diff --git a/tools/db/update-file-state b/tools/db/update-file-state index 18256de..24ed505 100644 --- a/tools/db/update-file-state +++ b/tools/db/update-file-state @@ -76,9 +76,16 @@ function main() { #for each ID with an old check date ... ID=$line TTSync=$(db_query "SELECT TTSync FROM File WHERE ID=$ID;") + FILE=$(db_query "SELECT CONCAT('$moviedir/', Folder, '/', Name) FROM File WHERE ID=$ID;") + if [ -f "$FILE"]; then + SIZE=$(db_query "SELECT Size FROM File WHERE ID=$ID;") + [ "$SIZE" != "$(file_size "$FILE")"] && { + echo "FILE CHANGE: $FILE" + #recalc md5 ... + check + #update DB + } + - - SIZE=$(db_query "SELECT Size FROM File WHERE ID=$ID;") MD5=$(db_query "SELECT MD5 FROM File WHERE ID=$ID;") done