Skip to content

Instantly share code, notes, and snippets.

@rwenz3l
Last active February 28, 2020 04:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwenz3l/38df928b65bc3d99cb2f to your computer and use it in GitHub Desktop.
Save rwenz3l/38df928b65bc3d99cb2f to your computer and use it in GitHub Desktop.
Sets the MKV Title Attribute to the filename
declare mkvpropedit="/usr/bin/mkvpropedit"
declare movieDir="/path/to/movies"
function mkvTitleEdit {
filename=$(basename "${1}")
filename="${filename%.*}"
echo mkvpropedit --set title "${filename}" "${1}"
}
export -f mkvTitleEdit
find ${movieDir} -type f -name "*.mkv" -exec bash -c 'mkvTitleEdit "$@"' bash /{} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment