2022-01-15, 07:00 PM
(This post was last modified: 2022-02-15, 07:40 PM by mvallevand.)
Using NScripthelper and batch files to create custom filename can be difficult so I decided to create a utility based on a smart regex based renamer I have used for years https://github.com/nicjansma/rename-regex
This utility can be run from the command line and via post processing.bat It can be run before or after other utilities like comskip since it also renames all matching files with different extensions
Before giving you the syntax NOTE that you should test this from the command line using the /p (pretend) option to confirm the naming is what you'd like. Also make sure that all the variables are in double quotes.
The utility has more options but the syntax options I have used and tested are
RRImport filespec|recording_id regex newname [/p]
If it doesn't match the regex nothing is changed.
A "regex" is a geeky what of parsing a file into component pieces. If you don't know what you are doing I wouldn't use it as there are two "built-in" options default and plex. The prime purpose of this utility is for users who don't like the NextPVR generic names.
The new name can have regex variables, named variable I show below. It isn't as complicated as it looks and is a lot easier then scripting.
For geeks the regex variable are $1, $2 etc.
I'll provide some common examples in the next post. It might be better just to ask question on what you want.
Currently this is only for Windows. To install unzip the attached in the NextPVR program folder and also this needed DLL
Martin
This utility can be run from the command line and via post processing.bat It can be run before or after other utilities like comskip since it also renames all matching files with different extensions
Before giving you the syntax NOTE that you should test this from the command line using the /p (pretend) option to confirm the naming is what you'd like. Also make sure that all the variables are in double quotes.
The utility has more options but the syntax options I have used and tested are
RRImport filespec|recording_id regex newname [/p]
If it doesn't match the regex nothing is changed.
A "regex" is a geeky what of parsing a file into component pieces. If you don't know what you are doing I wouldn't use it as there are two "built-in" options default and plex. The prime purpose of this utility is for users who don't like the NextPVR generic names.
The new name can have regex variables, named variable I show below. It isn't as complicated as it looks and is a lot easier then scripting.
Code:
?rn - Recording name
?t - EPG title
?st - EPG subtitle
?se - S#E# if it exists.
?cn - Recorded channel name
?ys - EPG year start
?Ms -EPG month start
?ds - EPG day start
?hs - EPG hour start
?ms - EPG minute start
?ye - EPG year end
?Me -EPG month end
?de - EPG day end
?he - EPG hour end
?me - EPG minute end
?rys - Recording year start
?rMs -Recording month start
?rds - Recording day start
?rhs - Recording hour start
?rms - Recording minute start
?rye - Recording year end
?rMe -Recording month end
?rde - Recording day end
?rhe - Recording hour end
?rms - Recording minute
For geeks the regex variable are $1, $2 etc.
I'll provide some common examples in the next post. It might be better just to ask question on what you want.
Currently this is only for Windows. To install unzip the attached in the NextPVR program folder and also this needed DLL
Code:
copy "C:\Program Files\NextPVR\runtimes\win-x64\native\e_sqlite3.dll" "C:\Program Files\NextPVR"
Martin