From 6174c863dfd943f2d73cf61e003dc81358500ec8 Mon Sep 17 00:00:00 2001 From: 6543 Date: Thu, 7 Feb 2019 22:49:08 +0100 Subject: [PATCH] add draft for md5_in_add --- tools/db/import-md5-list | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/db/import-md5-list b/tools/db/import-md5-list index ab40c54..6698224 100644 --- a/tools/db/import-md5-list +++ b/tools/db/import-md5-list @@ -62,6 +62,16 @@ if [ "$mode" == "help" ] && help ## functions function md5_in_add() { + + cat data_shares_Filme | while read line; do + md5=$(echo $line | cut -c -32) + path=$(echo $line | cut -c 33- | sed 's/^\ //g') + relrevpath=$(echo $path | sed "s|$moviedir||g" | sed 's|^/||g' | sed 's|/$||g' | rev) + name=$(echo $relrevpath | cut -d '/' -f 1 | rev) + folder=$(echo $relrevpath | cut -d '/' -f 2- | rev) + db_query "INSERT INTO File (MD5, Folder, Name) VALUES ('$md5', '$folder', '$name' );" #-> handle in future: ";'()" + done + exit 0 }