From aeffd00a00f67ca34cf0fc5e4116a8adf0d6b52a Mon Sep 17 00:00:00 2001 From: use Date: Sat, 27 Jan 2024 14:51:07 -0800 Subject: [PATCH] findVideos.sh now renames files with double spaces and alters the corresponding .nfo file when necessary --- findVideos.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/findVideos.sh b/findVideos.sh index a32a0b2..518ff11 100644 --- a/findVideos.sh +++ b/findVideos.sh @@ -10,8 +10,25 @@ while read -r line; do codec="$( $ffBin/ffprobe -loglevel error -select_streams v:0 -show_entries \ stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$line" )" - if ! [[ $codec == *"av1"* ]] + if [ $? -eq 0 ] then + if [[ $codec == *"264"* ]] + then + #Sometimes scp has issues with double spaces? + if [[ "$line" == *" "* ]] + then + repLine="$( echo "$line" | sed "s/ //g" )" + mv "$line" "$repLine" + if [ -f "$( dirname "$line" )/$( basename "$line" .mkv ).nfo" ] + then + mv "$( dirname "$line" )/$( basename "$line" .mkv ).nfo" "$( dirname "$repLine" )/$( basename "$repLine" .mkv ).nfo" + fi + line=$repLine + unset repLine + fi echo "$line" >>"$destDir/list.txt" fi + else + echo "NON-ZERO for $line" + fi done<<<"$( find "$parentDir" -name "*.mkv" -print )"