1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 13:18:35 -06:00

chg: Improved qbt send script

This commit is contained in:
Sayantan Santra 2023-12-04 19:09:11 -06:00
parent 25e6944fc9
commit 8dab2cac01
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -12,6 +12,33 @@ if [ "$3" == "add" ]; then
elif [ "$3" == "fin" ]; then elif [ "$3" == "fin" ]; then
size="$(echo $2 | numfmt --to=iec --format %.2f)B" size="$(echo $2 | numfmt --to=iec --format %.2f)B"
message="Finished: [$size] $name" message="Finished: [$size] $name"
if [ "$4" == "movie" ]; then
item=${5/\/downloads\//\.\.\/}
if [ -f "$item" ]; then
cp -l "$item" ../Temp/
cd ../Temp/
old=$(ls)
movie-rename -l *
new=$(ls)
folderify.py
[ "$old" != "$new" ] && mv * ../Movies/
fi
if [ -d "$item" ]; then
cp -lr "$item" ../Temp/
cd ../Temp/
cd *
find . -name "*.srt" | tail -n 1 | xargs -I{} mv {} .
rename-subs en
find . -type d -exec rm -rf "{}" \;
find . \! \( -name "*.mp4" -o -name "*.srt" -o -name "*.mkv" \) -exec rm -f "{}" \;
old=$(ls)
movie-rename -ld "$item"
new=$(ls)
[ "$old" != "$new" ] && mv * ../Movies/
fi
fi
else else
exit exit
fi fi