diff --git a/tools/db/import-md5-list b/tools/db/import-md5-list index d59a9d4..100ae01 100755 --- a/tools/db/import-md5-list +++ b/tools/db/import-md5-list @@ -62,6 +62,8 @@ if [ "$mode" == "help" ] && help fi } [ -d "$moviedir" ] || { echo "moviedir \"$moviedir\" do not exist"; exit 3; } # check moviedir +moviedir=""$(echo $moviedir | sed 's|/$||g')"" +[ -z "$moviedir" ] && exit 255 #catch case moviedir="/" ## functions function md5_in_add() { @@ -117,6 +119,14 @@ function db_exist_md5() { fi } +# db_F-ID_getPath -> +function db_id_getPath() { + local ID=$1 + local Folder=$(db_query "SELECT Folder FROM File WHERE ID=$ID;") + local Name=$(db_query "SELECT Name FROM File WHERE ID=$ID;") + echo "$moviedir/$Folder/$Name" +} + case "$mode" in "a") #in_add md5_in_add