This project has moved. For the latest updates, please go here.

Updating NPVR Database

Sep 2, 2015 at 1:08 PM
Hello,

Is there some way we can add an option to update the filename in the NPVR database after the conversion? I currently do this with a batch file.

I would like for either MCEBuddy to do it or to have the option to call a batch file (and pass arguments) after MCEBuddy has completed the transcode/comskip etc

Thanks

M
Coordinator
Sep 2, 2015 at 1:59 PM
you can use the CustomCommand parameters to call the batch file after commercial detection is completed. See the documentation for details.

Coordinator
Sep 2, 2015 at 1:59 PM
Interestingly please feel free to share you script with the community if you'd like we can host it on the server also under the community section.

Sep 2, 2015 at 2:09 PM
Hello,

I need to run the script after the commercial detection and transcode has been completed - is this possible?

M
Coordinator
Sep 2, 2015 at 6:52 PM
See the documentation. There are many different points at which you can run custom commands

Sep 6, 2015 at 7:16 AM
madas wrote:
Hello,

I need to run the script after the commercial detection and transcode has been completed - is this possible?

M
The "PostCustomCommand" sounds like what you are after.
I do something similar with ArgusTV - luckily they provide a utility that allows direct manipulation of the TV recording database

I have the following in my profiles.conf to achieve this, which has worked flawlessly ->

PostCustomCommandPath="C:\Program Files (x86)\ArgusBatch\ArgusTV.Batch.ProcessCommand.exe"
PostCustomCommandParameters=rename "%sourcefile%" "%convertedfile%"
PostCustomCommandHangPeriod=120
PostCustomCommandCritical=false
Sep 8, 2015 at 2:54 PM
Edited Sep 8, 2015 at 3:00 PM
You can use NScriptHelper.exe it comes with NEXTPVR ... it is really easy to do. What NScriptHelper.exe does is rename the file in the DB to the new filename.


PostCustomCommandPath=C:\MCEBuddy_Tools\NPVRTOOLS\RenameNPVR.bat
PostCustomCommandParameters=""%sourcefile%" "%convertedfile%""
PostCustomCommandHangPeriod=300
PostCustomCommandCritical=true
PostCustomCommandUISession=false
PostCustomCommandShowWindow=false

RenameNPVR.bat
If /I "%~d1%~p1%~n1" EQU "%~d2%~p2%~n2" if /I "%~x1" NEQ "%~x2" exit 0
"C:\Program Files (x86)\NPVR\NScriptHelper.exe" -Rename "%~f1" "%~f2"

You should delete the file upon completion or archive to another folder.


Below is the NScriptHelper Doc

NPVR documentation for NScriptHelper.exe
I've gathered some info on the batch helper utility NScriptHelper.exe. Unfortunately, my id has expired on the Wiki and cannot add the page to the Utility section. If someone has the time and access, here is the content I was planning to add:


NScriptHelper.exe is a helper utility which is part of the core NPVR package. The utility provides a command line (i.e. batch) interface which can query the NPVR recording service. The executable can be found in the NPVR executables location.

Below lists the functions and calling syntax as of NPVR 3.1.1

NScriptHelper -Description filename
  • Output description of recording from the EPG
Ex:
c:\Program Files\NPVR>NScriptHelper -Description "d:\pvr\Recordings\Revolution\Revolution.S01E11.Th e Stand.ts"

2013-03-25: Miles leads the rebels out of Philadelphia and away from Monroe's machine guns; Rachel is forced to leave her children behind -- again -- as she provides power to the rebels.

NScriptHelper -Cancel oid
  • Cancel recording with specific OID

NScriptHelper -Pending
  • Output list of pending recordings
Ex:
c:\Program Files\NPVR>NScriptHelper -pending
3089 534 2014/02/01 21:00:00 Black Sails
3087 8 2014/02/03 20:00:00 Almost Human
3091 10 2014/02/04 20:00:00 Marvel's Agents of S.H.I.E.L.D
3092 8 2014/02/06 21:00:00 Rake
3093 62 2014/02/08 18:05:00 The Walking Dead
3090 534 2014/02/08 21:00:00 Black Sails
3094 62 2014/02/09 21:00:00 The Walking Dead

3088 8 2014/02/10 20:00:00 Almost Human

NScriptHelper -Title filename
  • Output title of recording from the EPG
Ex:
c:\Program Files\NPVR>NScriptHelper -title "d:\pvr\Recordings\Revolution\Revolution.S01E11.Th e Stand.ts"

Revolution

NScriptHelper -SubTitle filename
  • Output the subtitle of recording from the EPG
Ex:
c:\Program Files\NPVR>NScriptHelper -subTitle "d:\pvr\Recordings\Revolution\Revolution.S01E11.Th e Stand.ts"

The Stand

NScriptHelper -Rename srcFileName tgtFileName
  • Rename the recording in the EPG to new name(location)
    Does NOT move/rename the actual file, only updates the database.

NScriptHelper -Delete filename
  • Delete the recording in the NPVR database
    Does NOT delete the actual file, only updates the database.

NScriptHelper -isRecording
This function does not seem to work, always returns NOT RECORDING

Ex:
c:\Program Files\NPVR>NScriptHelper -isRecording

NOT RECORDING

NScriptHelper -isInUse
  • Display status of tuner (Recording or Not Recording)
Ex:
c:\Program Files\NPVR>NScriptHelper -isInUse
RECORDING
c:\Program Files\NPVR>NScriptHelper -isInUse
NOT RECORDING
Sep 14, 2015 at 1:16 PM
I'm using 2.4 Beta 3 and its seems to be struggling to get the show titles from the npvr recordings. Example below. If I check the NPVR DB there is a subtitle for this program. Am I missing a step on NPVR recordings to get this to work?

INFORMATION> 2015-09-14T09:05:38 MCEBuddy.Engine.ConversionJob --> Running custom commands
2015-09-14T09:05:38 MCEBuddy.Engine.ConversionJob --> Finished pre metadata custom command, source file size [KB] 2,231,051.00
INFORMATION> 2015-09-14T09:05:38 MCEBuddy.Engine.ConversionJob --> Getting show information and banner from Internet sources
2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Extracting metadata from file -> D:\Media\NPVR\Mickey Mouse Clubhouse\Mickey Mouse Clubhouse_20150914_08300900.ts
INFORMATION> 2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Extracting Generic Tags
WARNING> 2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Unable to extract meta data from file D:\Media\NPVR\Mickey Mouse Clubhouse\Mickey Mouse Clubhouse_20150914_08300900.ts. D:\Media\NPVR\Mickey Mouse Clubhouse\Mickey Mouse Clubhouse_20150914_08300900.ts (taglib/ts)
2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Trying to match nPVR/SiliconDust series showname -> Mickey Mouse Clubhouse_20150914_08300900
2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Trying to match nPVR movie showname -> Mickey Mouse Clubhouse_20150914_08300900
2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Trying to extract generic nPVR filename details -> Mickey Mouse Clubhouse_20150914_08300900
2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Extracted Original Broadcast Date from Filename -> 2015-09-14
2015-09-14T09:05:38 MCEBuddy.MetaData.VideoMetaData --> Video Tags extracted ->
Title: Mickey Mouse Clubhouse
SubTitle:
Description:
Network:
Parental Rating:
Media Credits:
Genres: Season: 0
Episode: 0
Banner:
Banner URL:
IMDB Id:
MovieDB Id:
TVDB Id:
Is Show Movie: False
Is Show Sports: False
OriginalBroadcastDateTime: 2015-09-14T00:00:00
RecordedDateTime: 1899-12-31T19:00:00
SeriesPremiereDate: 1899-12-31T19:00:00
CopyProtected: False
SageTV FileID:
SageTV MediaFileID:
Sep 14, 2015 at 1:37 PM
Nevermind - I found the option in NPVR config.xml to enable the XML generation.
<StoreSeparateMetadataXml>true</StoreSeparateMetadataXml>
Marked as answer by rboy1 on 10/15/2015 at 2:33 AM