Bug #3931

%p post_processor format string is virtually always empty

Added by Steve Black over 6 years ago. Updated almost 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Found in version:
4.1.2146 and prior
Affected Versions:


I think I have seen this field getting populated in the past, but I cannot prove it at this point. In every recording example I check, my script messaging shows it to be empty. I have updated the command string in the recording profile to put parenthesis around it ( "(%p)" ) to prove I was using it correctly, and the result was a set of empty parentheses.



Updated by Steve Black over 6 years ago

Should be categorized as PVR, rather than DVB


Updated by Jaroslav Kysela over 6 years ago

It depends on your EPG data. Some sources does not have this information or TVH is not able to extract this information from the description.

Do you see 'Content type' information in the bottom of the EPG dialog (when you click on an event in the EPG tab in webui)?


Updated by Steve Black over 6 years ago

Well... Yeesh!

I've been working hard on my post processing script this weekend and somewhere along the line I decided to try uppercase P instead of lowercase. No joy so I changed it back. Then BOOM, it started working and hasn't stopped. I PROMISE I played around with this more than once before reporting it.

To respond to your response:
  • My EPG does have episodes where appropriate.
  • Yes, I do see 'Content type' info in the dialog for those few events where it also appears in the Content Type column. (Does this question pertain to this issue, or my other issue about a content-type format string?)

In any case, this issue can be closed. My content-type issue remains an active request.

Thanks for the response, and apologies for the red herring.


Updated by Jaroslav Kysela over 6 years ago

  • Status changed from New to Invalid

Updated by Steve Black over 6 years ago

Sorry, but there IS still an issue here. I am getting a value for %p most of the time, but it is sometimes missing in cases where it does appear in the EPG and file name. Here is some output from my script. The first rows (through Streams) correspond to the passed parameters and are printed before any other processing is done. (See SourceFile and Episode lines)

2016-08-15 06:01:00.134 spawn: ******************** /home/kodi1/ started
2016-08-15 06:01:00.142 spawn:     SourceFile : /media/NetPVR/recordings/test/The Donna Reed Show/The Donna Reed Show.S04E11.Private Tutor.ts
2016-08-15 06:01:00.145 spawn:    Source Path : /media/NetPVR/recordings/test/The Donna Reed Show
2016-08-15 06:01:00.152 spawn:      Base Name : The Donna Reed Show.S04E11.Private Tutor.ts
2016-08-15 06:01:00.161 spawn:      Extension : ts
2016-08-15 06:01:00.170 spawn:    Source Name : The Donna Reed Show.S04E11.Private Tutor
2016-08-15 06:01:00.175 spawn:        Channel : MeTV
2016-08-15 06:01:00.179 spawn:          Owner : kodi1
2016-08-15 06:01:00.185 spawn:        Creator : kodi1
2016-08-15 06:01:00.192 spawn:          Title : The Donna Reed Show
2016-08-15 06:01:00.197 spawn:       Subtitle : Private Tutor
2016-08-15 06:01:00.203 spawn:        Episode : 
2016-08-15 06:01:00.209 spawn:    Description : Mary hopes for romance with her French-language tutor.
2016-08-15 06:01:00.215 spawn:  Error Message : OK
2016-08-15 06:01:00.220 spawn:          Start : 1471253340
2016-08-15 06:01:00.225 spawn:            End : 1471255260
2016-08-15 06:01:00.232 spawn:         Errors : 0
2016-08-15 06:01:00.238 spawn:    Data Errors : 9
2016-08-15 06:01:00.243 spawn:        Streams : 
2016-08-15 06:01:00.248 spawn:    ContentType : 
2016-08-15 06:01:00.254 spawn:     SourcePath : /media/NetPVR/recordings/test/The Donna Reed Show
2016-08-15 06:01:00.259 spawn:      Extension : ts
2016-08-15 06:01:00.267 spawn:     SourceName : The Donna Reed Show.S04E11.Private Tutor
2016-08-15 06:01:00.272 spawn:         TmpLog : /media/NetPVR/recordings/test/The Donna Reed Show/The Donna Reed Show.S04E11.Private Tutor.log
2016-08-15 06:01:00.278 spawn:        LibType : Movies
2016-08-15 06:01:00.283 spawn:     TargetPath : /media/NetPVR/recordings/test/Movies/The Donna Reed Show
2016-08-15 06:01:00.289 spawn:     ShowFolder : The Donna Reed Show
2016-08-15 06:01:00.297 spawn:   SeasonFolder : 
2016-08-15 06:01:00.301 spawn:           IsTV : FALSE
2016-08-15 06:01:00.308 spawn:     TVH Result : OK (0 errors, 9 data errors)
2016-08-15 06:01:00.340 spawn: ******************** /home/kodi1/ ended

Updated by Steve Black over 6 years ago

Just tried to get a little more logging, but it was futile for two reasons. 1) debug isn't providing any more info and 2) it looks like there may be a difference between the manual "record program" and recording by autorec. When I start manually (in WebUI) I always seem to get an episode value. Autorecs seem to never get the value.


Updated by Jaroslav Kysela over 6 years ago

Could you check, if you see "episode" field in the config files in the <CONFIGROOT>/dvr/log directory after the recordings finished (and your post-processor script was called)?


Updated by Steve Black over 6 years ago

The log for the show presented above does contain:
"episode": "Season 4.Episode 11"


Updated by Steve Black over 6 years ago

In the course of this evening, 7 consecutive autorecs have started and ended without intervention. All 7 had episode info in the guide. All 7 failed to get episode info in the script. While this was going on, I also manually started two other recordings and allowed them to finish without intervention. These got the same result.

At this point I'm fairly certain that the magic happens when a recording is terminated manually. I will try to stop several autorecs tomorrow evening and report the results.


Updated by Jaroslav Kysela over 6 years ago

The episode / series info is taken directly from the EPG database and I suspect, that under some circumstances, the related EPG event might be removed from the database before the post-processing script is executed (thus the information is lost). I'll try to save this info when the recording starts.


Updated by Steve Black over 6 years ago

Understood. I will stop reporting details unless I find something I didn't expect.


Updated by Steve Black over 5 years ago

I now have TVH 4.2 installed and populated with AutoRecs. The episode number is still not arriving in %p for most, if not all recordings that complete normally, though it was appearing during my initial testing, wherein I typically stopped the recording right after starting it. In other words, it seems to have the same behavior as it did as of my last update.

Since this is currently marked as Invalid, I'm not sure if it will catch your attention, so please respond if you see it.

FWIW, I am parsing the episode from the filename, so I am not waiting breathlessly for a fix.


Updated by Jaroslav Kysela over 5 years ago

  • Status changed from Invalid to New

Updated by Steve Black over 5 years ago

Seems that Description (%d) and Content-Type (%g) are also not coming through, regardless of recording stop method.


Updated by Ludi K. over 5 years ago

The problem is also occurring in tvheadend 4.4.20170707 available for the Synology NAS.


Updated by Steve Black over 3 years ago

Just FYI, this behavior remains unchanged. Currently using 4.2.8 from SynoCommunity package.


Updated by Flole Systems over 3 years ago

Try using latest 4.3


Updated by Steve Black almost 3 years ago

Now using latest SynoCommunity package (4.3.20191128~221c29b-17). Problem remains unchanged.

Also available in: Atom PDF