add function db_F-ID_getPath <F-ID> -> <Path>

This commit is contained in:
6543 2019-02-07 23:40:32 +01:00
parent 821dbe2e81
commit e3298b9272

View File

@ -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 <F-ID> -> <Path>
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