]> git.rmz.io Git - dotfiles.git/commitdiff
make it work for webm
authorSamir Benmendil <ram-z@chakra-project.org>
Sat, 17 Nov 2012 20:31:05 +0000 (21:31 +0100)
committerSamir Benmendil <ram-z@chakra-project.org>
Sat, 17 Nov 2012 20:31:05 +0000 (21:31 +0100)
bin/mkvsettitle

index 71619c3860b5c09c086caba539413c2ed838f7be..f9a8c8d356ea0dcfec88f054ed027faf083b91d4 100755 (executable)
@@ -2,7 +2,13 @@
 # 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%.*}
     mkvpropedit --set title="$t" "$f" > /dev/null
 done