]> git.rmz.io Git - dotfiles.git/blobdiff - bin/mkvsettitle
nvim: add FPP copyright snippet
[dotfiles.git] / bin / mkvsettitle
index 71619c3860b5c09c086caba539413c2ed838f7be..26443fb9b70263a86cf355da0b13850145cdfef4 100755 (executable)
@@ -2,7 +2,16 @@
 # sets the title of all mkv videos to the filename without extension
 
 dir=${1-.}
-for f in "$dir"/*.mkv; do
-    t=$(basename "$f" .mkv)
+for f in "$dir"/*; do
+    case "$f" in
+        *.mkv)  ext=mkv ;;
+        *.webm) ext=webm ;;
+        *)      continue ;;
+    esac
+    t=$(basename "$f" "$ext")
+    t=${t%.*}
+    # remove also (2013){1080p}[en] stuff
+    t=${t% (*)\{*\}*}
+    echo "Set title: $t"
     mkvpropedit --set title="$t" "$f" > /dev/null
 done