ginjaninja 537 Posted January 7, 2023 Share Posted January 7, 2023 (edited) Background I wanted my movie versions eg. "Directors Cut" to show in UI even if only one version available. This is only possible with Global advanced library option and Embedded Titles... .However all my embedded [in mkv] titles were all over the place, so I wrote this script to clean embedded names on Video, Audio and Subtitle tracks Along the way, the script protects track names containing special words [customisable] and if the subtitle has "forced" in the title sets the forced flag (if language is in preferred list). Installation Requires powershell 7 and MKVToolnix (tested with version 73) Review and edit config.psd1 set track naming tokens and protected names $logonly=true - just dumps the current tags in emby and mkvs (belt and braces) < use this first and save log $testmode=true logs what changes would have been made. Notes only works on mkvs. test on a backed up library, mkvpropedit makes changes to track names and removes track properties on the files on your filesystem. Review the naming logic, it may not be to your preference. If there is no version, i remove the name because i am happy with Emby's default for blank trackname. With a bit of tlc a user could write their own set of rules for how they want their tags cleaned up - the script has the bare bones and builds up an array of mkvpropedit commands to send in one go. best to use a monospaced font like courier new to view logs. warning - "mostly only useful for people who have done zero tag maintenance on their mkvs - experienced taggers would probably want to improve the rules in the script". Issues and Suggestions Welcome - The rules are rudimentary to clean ui for most titles and protect tracks with useful data - stage 1 Examples Movie version present but not embedded No movie version, but subtitle has a protected name eg 'SDH' or 'Commentary' Forced Subtitle by trackname but not property in preferred language - now Emby auto selects the forced track Changes SetMKVTitlebyVersion v0.0.0.1.zip Edited January 7, 2023 by ginjaninja 1 2 Link to comment Share on other sites More sharing options...
ginjaninja 537 Posted January 29, 2023 Author Share Posted January 29, 2023 SetMKVTitlebyVersion v0.0.0.2.zip v0.0.0.2 Added logic to set the language of video, audio and subtitle tracks to either 'mylangauge' when undefined or to the language of the [video|audio] track in safe (non multi video|audio track) scenarios. Added option to set subtitle tracks with 'sdh' in name to 'default'. Added function and option to clear segment title (emby doesnt use segment titles so this is purely ocd) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now