wip on android

This commit is contained in:
6543 2019-05-10 21:17:04 +02:00 committed by root
parent 32df13b2dd
commit a6abdc45ea

View File

@ -147,9 +147,23 @@ function file_size() {
}

function file_add() {
echo "dumy func file_add [rel. path]
#chek if path still esist chek usw...
#chek if size ->md5 exist -> not new MV !!!
echo 2DO
local relrevpath="$(echo $1 | sed 's|^/||g' | sed 's|/$||g' | rev | sed "s/'/''/g")" #last statement set ' as '' so it wont have an evect in the sql statement
local name="$(echo $relrevpath | cut -d '/' -f 1 | rev)"
local folder="$(echo $relrevpath | cut -d '/' -f 2- | rev)"
local FILE="$moviedir/$(echo $relrevpath | rev)"
[ -f "$FILE" ] || return 1 #errer file not exist
local MD5_new=$(md5sum "$FILE" | cut -c -32)
local SIZE_new="$(file_size "$FILE")"

#db path exist && md5 same -> update this entry
#db path exist && ttsync=exist/backup && md5 !same -> ttsync=del + new db entry
#or new db entry

#db entry is{
# chek if size ->md5 exist -> update path&name (MV)
# else complete new entry
#}
}