diff --git a/compare.sh b/compare.sh new file mode 100644 index 0000000..025453d --- /dev/null +++ b/compare.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [[ $# -lt 2 ]]; then + echo "Usage: $0 [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 diff --git a/ffmpeg.sh b/ffmpeg.sh new file mode 100755 index 0000000..bd0747a --- /dev/null +++ b/ffmpeg.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 [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