2010-03-12, 10:47 AM
Python 2.4.4 works a treat! Great work Ton!
Thanks for including the source for 2xbmc.exe.
Can you foresee any problems with getting 2xbmc.exe to rename the recording and it's associated files and update the pointer in the gbpvr database instead of copying/creating a new file? I don't know C# at all so I have no idea how easy that would be to achieve.
In the mean time I knocked out this batch file to simply generate an NFO. It's not as elegant and (as you can probably tell) I'm not a coder so it's a real hack job but seems to work with my basic testing:
Thanks for including the source for 2xbmc.exe.
Can you foresee any problems with getting 2xbmc.exe to rename the recording and it's associated files and update the pointer in the gbpvr database instead of copying/creating a new file? I don't know C# at all so I have no idea how easy that would be to achieve.
In the mean time I knocked out this batch file to simply generate an NFO. It's not as elegant and (as you can probably tell) I'm not a coder so it's a real hack job but seems to work with my basic testing:
Code:
rem CHANGE TO RECORDING'S DIRECTORY
%~d1
cd %~p1
rem FIND RECORDING's programme_oid AND SAVE TO VARIABLE
"C:\Program Files\devnz\gbpvr\sqlite3.exe" "C:\Program Files\devnz\gbpvr\gbpvr.db3" "SELECT programme_oid FROM RECORDING_SCHEDULE where filename like '%%%~n1.%%';" > "oid.tmp"
For /F "Tokens=*" %%I in (oid.tmp) Do set my_programme_oid=%%I
del oid.tmp
echo %my_programme_oid%
rem GET VALUES AND WRITE TO TEMP FILES
"C:\Program Files\devnz\gbpvr\sqlite3.exe" "C:\Program Files\devnz\gbpvr\gbpvr.db3" "SELECT name FROM PROGRAMME where oid = %my_programme_oid%;" > "name.tmp"
"C:\Program Files\devnz\gbpvr\sqlite3.exe" "C:\Program Files\devnz\gbpvr\gbpvr.db3" "SELECT sub_title FROM PROGRAMME where oid = %my_programme_oid%;" > "sub.tmp"
"C:\Program Files\devnz\gbpvr\sqlite3.exe" "C:\Program Files\devnz\gbpvr\gbpvr.db3" "SELECT description FROM PROGRAMME where oid = %my_programme_oid%;" > "desc.tmp"
"C:\Program Files\devnz\gbpvr\sqlite3.exe" "C:\Program Files\devnz\gbpvr\gbpvr.db3" "SELECT start_time FROM PROGRAMME where oid = %my_programme_oid%;" > "time.tmp"
rem READ TEMP FILE VALUES IN VARIABLES
For /F "Tokens=*" %%I in (name.tmp) Do set my_name=%%I
For /F "Tokens=*" %%I in (sub.tmp) Do set my_sub=%%I
For /F "Tokens=*" %%I in (desc.tmp) Do set my_desc=%%I
For /F "Tokens=1" %%I in (time.tmp) Do set my_time=%%I
rem APPEND SEPERATOR TO SUBTITLE IF IT IS NOT BLANK
if not (%my_sub%)==() set my_sub=%my_sub% - -
rem echo %my_sub%
rem GENERATE NFO FILE
echo ^<episodedetails^> > "%~n1.nfo"
echo ^<title^>%my_name%^</title^> >> "%~n1.nfo"
echo ^<rating^>5.00^</rating^> >> "%~n1.nfo"
echo ^<season^>01^</season^> >> "%~n1.nfo"
echo ^<episode^>01^</episode^> >> "%~n1.nfo"
echo ^<plot^>%my_sub%%my_desc%^</plot^> >> "%~n1.nfo"
echo ^<credits^>^</credits^> >> "%~n1.nfo"
echo ^<director^>^</director^> >> "%~n1.nfo"
echo ^<aired^>%my_time%^</aired^> >> "%~n1.nfo"
echo ^<actor^>^</actor^> >> "%~n1.nfo"
echo ^</episodedetails^> >> "%~n1.nfo"
rem CLEAN UP...
del "name.tmp"
del "sub.tmp"
del "desc.tmp"
del "time.tmp"
rem pause