DVR Recording Filename

I put together a windows batch job to parse the JSON for movies .... You can just drag and drop the mpg file or schedule to run on each mpg file. I use the old reliable Dirmon2 to to run it.

Final Destination (2000) 2020-09-12-1914.mpg.properties
Title=Final Destination (2000)
Description=Death stalks the survivors (Devon Sawa, Ali Larter, Kerr Smith) of a doomed airliner.
Year=2000
Genre=Horror/Thriller

JSON2PROPMovies.bat
CD /d "%~dp0"
set filein="%~f1"
set ext=%~x1

if %ext% EQU .mpg set jsonin=%filein:.mpg=.json%

if %ext% EQU .mpg set propin=%filein:.mpg=.mpg.properties%

SET /P jsonin=<%jsonin%
set jsonin=%jsonin:"=%

set Title=%jsonin:*,Title=%
Set Title=%Title:~1,-1%

Set Description=%jsonin:*Description:=%
set Description=%Description:Episode=}%
for /f "tokens=1 delims=}" %%a in ("%Description%") do set Description=%%a
Set Description=%Description:~0,-1%

set year=%Title:~-6%
set year=%year:~1,-1%

set Genres=%jsonin:*Genres=%
set Genres=%Genres:IsMovie=}%
for /f "tokens=1 delims=}" %%a in ("%Genres%") do set Genres=%%a
set Genres=%Genres:~2,-2%
set Genres=%Genres:,=/%

echo Title=%Title%>%propin%
echo Description=%Description%>>%propin%
echo Year=%year%>>%propin%
echo Genre=%Genres%>>%propin%

exit

1 Like

What would be great if channels had naming control similar to cTivo where you could build your own or use a preset. Ie [seriestitle]-[episode#]…..

2 Likes