metadata scripts
This commit is contained in:
1 parent
57d5cf3d34
commit
b37ee0bd27
2 files changed
+56
No files matched your search
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: $0 <dir1> <dir2> [del]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dir1="$1"
|
||||
dir2="$2"
|
||||
|
||||
find "$dir1" -mindepth 2 -maxdepth 2 -type d -printf '%P\n' |
|
||||
while IFS= read -r rel; do
|
||||
if [[ -d "$dir2/$rel" ]]; then
|
||||
# Exists in both
|
||||
if [[ "$3" == "del" ]]; then
|
||||
echo "Deleting: $dir1/$rel"
|
||||
rm -rf -- "$dir1/$rel"
|
||||
|
||||
# Remove empty author directory
|
||||
author="${rel%%/*}"
|
||||
rmdir --ignore-fail-on-non-empty "$dir1/$author" 2>/dev/null
|
||||
fi
|
||||
else
|
||||
# Only exists in $1
|
||||
echo "$rel"
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <Series> [additional ffmpeg_handling.py args...]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
series="$1"
|
||||
shift
|
||||
|
||||
for d in */; do
|
||||
[ -d "$d" ] || continue
|
||||
name="${d%/}"
|
||||
|
||||
# extract leading number (int or float)
|
||||
if [[ $name =~ ([0-9]+([.,][0-9]+)?) ]]; then
|
||||
num="${BASH_REMATCH[1]}"
|
||||
else
|
||||
continue
|
||||
fi
|
||||
echo $d $num
|
||||
~/git/serverhost/.venv/bin/python \
|
||||
~/git/serverhost/ffmpeg_handling.py \
|
||||
ms "$name" \
|
||||
--override \
|
||||
-k grouping \
|
||||
-v "$series #$num" \
|
||||
"$@"
|
||||
done
|
||||
Reference in new issue
Block a user