update
This commit is contained in:
30
tvshow_prune
Executable file
30
tvshow_prune
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to process files
|
||||
process_files() {
|
||||
local pattern="$1"
|
||||
shift
|
||||
local replacements=("$@")
|
||||
|
||||
for file in *"$pattern"*; do
|
||||
echo "==== $file ===="
|
||||
for replacement in "${replacements[@]}"; do
|
||||
local new_name="${file/$pattern/$replacement}"
|
||||
if [ -e "$new_name" ]; then
|
||||
echo "$new_name to be removed!"
|
||||
rm "$new_name"
|
||||
else
|
||||
echo "$new_name NOT found"
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Process 720p files
|
||||
process_files "720p-NEXT" "720p.H264-F1RST" "720p-NICE" "720p.WANNA"
|
||||
|
||||
# Process 1080p files with 1080p.H264-F1RST
|
||||
process_files "1080p.H264-F1RST" "1080p-NICE" "1080p.WANNA" "720p-NEXT"
|
||||
|
||||
# Process 1080p files with 1080p-NEXT
|
||||
process_files "1080p-NEXT" "720p-NEXT" "1080p.H264-F1RST" "1080p-NICE" "1080p.WANNA"
|
||||
Reference in New Issue
Block a user