]> git.rmz.io Git - dotfiles.git/blobdiff - bin/mkvsettitle
fix retroarch-joyconfig path, test more config
[dotfiles.git] / bin / mkvsettitle
index 8afbee69cbea2aaa71023681a87894a6c263cf7b..f9a8c8d356ea0dcfec88f054ed027faf083b91d4 100755 (executable)
@@ -1,7 +1,14 @@
 #! /bin/bash
 # sets the title of all mkv videos to the filename without extension
 
 #! /bin/bash
 # sets the title of all mkv videos to the filename without extension
 
-for f in *.mkv; do
-    t=${f%.mkv}
-    mkvpropedit --set title="$t" "$f"
+dir=${1-.}
+for f in "$dir"/*; do
+    case "$f" in
+        *.mkv)  ext=mkv ;;
+        *.webm) ext=webm ;;
+        *)      continue ;;
+    esac
+    t=$(basename "$f" "$ext")
+    t=${t%.*}
+    mkvpropedit --set title="$t" "$f" > /dev/null
 done
 done