瀏覽代碼

Automatically clean recode leftovers

Zachary Kotlarek 8 年之前
父節點
當前提交
09595060eb
共有 1 個文件被更改,包括 11 次插入 和 0 次删除
  1. 11 0
      yt/ytDupCheck

+ 11 - 0
yt/ytDupCheck

@@ -39,6 +39,17 @@ for k in *; do
 				echo "Missing video: ${k}/${i}"
 			fi
 		else
+			# Recode remnants
+			if [ ${#ext} -gt 3 ] && [ "${i}" == "S${s}E${e} - ${id}.${ext}" ]; then
+				MTIME=`stat -c '%Y' "${i}"`
+				TIME=`date '+%s'`
+				if [ $(( $TIME - $MTIME )) -gt 3600 ]; then
+					echo "Deleting recode remnant: ${i}"
+					rm -f -- "${i}"
+					continue
+				fi
+			fi
+
 			# Missing NFO
 			n="`echo "${i}" | sed 's%\.'"${ext}"'$%.nfo%'`"
 			if [ ! -r "${n}" ]; then