NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 83 84 85 86 87 … 433 Next »
Append Channel/Network to file name

Append Channel/Network to file name
MarkMills
Offline

Junior Member

Posts: 3
Threads: 1
Joined: Aug 2017
#1
2017-08-16, 04:00 PM
Hi all,
I've been trying to find away to add the channel/network name to the recorded file name. My intention is that I want to use MCEBuddy to carry out specific tasks dependent on the channel. For example, in the UK, I don't want to carry out a commercial scan for BBC channels. And the add detection for Quest seems to be different for the Dave channel.
I've sort of got Imagegrablite working but cannot see a way to just add the channel name.
Any idea or pointers?
Thanks in advance
Mark
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#2
2017-08-16, 06:38 PM
There is nothing built in that will do that, but the PostProcessing.bat, which is run after each recording, is passed the channel number as the second parameter, so you can hookup your own custom logic if you want.
MarkMills
Offline

Junior Member

Posts: 3
Threads: 1
Joined: Aug 2017
#3
2017-08-16, 09:11 PM
OK, great. Thank you. That's encouraging to know that it's possible. I've made some progress and adapted JavaWiz's batch file as below

:BEGIN
SETLOCAL
Set SCRIPTNAME=%0
Set BASEDIR=c:\Users\Public\NPVR
Set LOGFILE=%BASEDIR%\Logs\BatchProcessing.log

Set FILENAME=%1
Set CH_NUM=%2
Set OID=%3
Set DEV_OID=%4
Set REC_TITLE=%5

Call :LOGMSG Recording complete - filename: %FILENAME% ChannelNUM: %CH_NUM% OID: %OID% DeviceOID: %DEV_OID% Title: %REC_TITLE%

:: EX: Place your system specific commands here...
rename %FILENAME% %REC_TITLE%,%CH_NUM%

GoTo :EXITJOB

--------------------------------------------------------------
:LOGMSG
echo %*
echo %date:~4% %time% [%SCRIPTNAME%] %* >> %LOGFILE%
Goto :EOF

But the rename command has spaces and quote marks in it so that I get:

rename "\\OPENMEDIAVAULT3\TVHRecordings\Room 101\Room 101_20170816_21002140.ts" "Room 101",12
The syntax of the command is incorrect.
I've checked the replace spaces with period characters box.

Any further thoughts would be appreciated.
Regards
Mark
PS Please excuse the TVHeadend reference, that was the previous attempt at getting my ultimate set up. :-)
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#4
2017-08-17, 12:36 AM
You might try something like:

Code:
:BEGIN
    SETLOCAL
    Set SCRIPTNAME=%0
    Set BASEDIR=c:\Users\Public\NPVR
    Set LOGFILE=%BASEDIR%\Logs\BatchProcessing.log

    Set FILENAME=%1
    Set CH_NUM=%2
    Set OID=%3
    Set DEV_OID=%4
    Set REC_TITLE=%5
[B]    [color=#FF0000]Set REC_TITLE=%REC_TITLE:"=%[/color][/B]
    
    Call :LOGMSG Recording complete - filename: %FILENAME% ChannelNUM: %CH_NUM% OID: %OID% DeviceOID: %DEV_OID% Title: %REC_TITLE%

    :: EX: Place your system specific commands here...
    rename %FILENAME% [B][color=#FF0000]"%REC_TITLE%--%CH_NUM%%~x1"[/color][/B]

GoTo :EXITJOB
MarkMills
Offline

Junior Member

Posts: 3
Threads: 1
Joined: Aug 2017
#5
2017-08-17, 08:49 AM
Thank you JavaWiz, I don't think my tinkering would have resulted in anything like that. This achieves the renaming nicely, but I seem to have lost the recordings from the database/recordings screen. Is there a workaround for that or am I venturing into unknown territory at this point?
Thanks again,
Mark.
PS, I assume the first line is redundant??
Set REC_TITLE=%5
Set REC_TITLE=%REC_TITLE:"=%
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#6
2017-08-17, 11:05 AM
First line is not redundant. 1st line loads parameter into variable, 2nd line removes the quotes. It could probably be done in a single statement, but I didn't test it out...

To keep the database in-sync, you'll want to use NScriptHelper.exe. There is some documentation in this thread.

Add something like line below after the rename:

Code:
NScriptHelper.exe %FILENAME% "%REC_TITLE%--%CH_NUM%%~x1"
If NPVR directory is not in your path, you'll have to prefix it with the location of the exe.
pBS
Offline

Posting Freak

Posts: 4,829
Threads: 182
Joined: Aug 2005
#7
2017-08-18, 04:23 PM
an easier way to remove quotes from an incoming parameter is to use %~
example:
Set FILENAME=%~1
Set REC_TITLE=%~5

will load those variables without the quotes surrounding them Smile
and keeps the spaces in the variable..
[note, only works with incoming %x and %%x variables not with normal variables like %REC_TITLE%]
Hardware: HDHR Prime, HDPVR 1212, Raspberry pi2, VFD display w/LCDSmartie
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  incorrect frequency in adelaide .ini file spin35 5 2,989 2023-02-01, 05:40 PM
Last Post: sub
  IR Server Suite Channel Changer BTJustice 26 27,149 2023-01-11, 08:49 PM
Last Post: Frapo
  Device Update - Channel Mapping chezmorris 10 4,666 2022-07-01, 01:59 PM
Last Post: mvallevand
  Recording to a network drive woes. 2leftfeet 12 7,145 2022-04-05, 08:03 PM
Last Post: mvallevand
  ts file shows length too long? SuttonWillow 2 1,887 2021-03-15, 01:56 PM
Last Post: mvallevand
  IPTV Channel Mapping jrockow 15 7,745 2021-03-07, 09:45 PM
Last Post: jrockow
  channel icon location Brucek2839 2 1,702 2021-03-04, 10:30 PM
Last Post: Brucek2839
  UK channel More4 - tunes but cannot view? prothed 7 2,737 2021-02-17, 02:59 PM
Last Post: Graham
  send channel chanes via winLIRC?? chef Paula 67 13,265 2021-02-11, 07:38 PM
Last Post: mvallevand
  NextPVR hangs when tuning to offline channel? CormacBaptiste 2 1,923 2021-02-03, 01:29 PM
Last Post: Graham

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode