X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/3355979d8bc66c57f1237ba35f2560d8f3cc371d..refs/heads/lazyvim:/bin/mkvsettitle diff --git a/bin/mkvsettitle b/bin/mkvsettitle index 71619c3..26443fb 100755 --- a/bin/mkvsettitle +++ b/bin/mkvsettitle @@ -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