From e3298b92729dadfee1140d45d4020763e15fd5af Mon Sep 17 00:00:00 2001 From: 6543 Date: Thu, 7 Feb 2019 23:40:32 +0100 Subject: [PATCH] add function db_F-ID_getPath -> --- 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 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