Page 1 of 1

Insert HDTV tag based on channel name

Posted: Sun Apr 10, 2011 4:55 pm
by AdeG43
Hi, I've tried a few options and settled on the Radio Times guide into SageTV. I've got it working OK but the down side is the lack of the HDTV tag from the UK Radio Times info.

One thought I've had is to insert the tag on the fly if the channel name contains 'HD'. From what I can make out this would involve amending some code into the xmltv_parse file, probably at this point?

if DigiMiscFind(miscTag, "(High Definition)") then
if not prog.Video then
prog.Video = {}
end
prog.Video.Quality = "HDTV"
end

From my very limited knowledge of programming this might involve amending the first line above to check if 'HD' (in caps, no space between the H and the D) is contained in the name of the channel. eg Comedy Channel HD

Am I on the right track here and if so what would the code be that check to see 'if channel name contains HD'

many thanks - I've tried to take this as far as I can on my own but I'm stuck at the final hurdle.

Ade

Re: Insert HDTV tag based on channel name

Posted: Thu Apr 14, 2011 7:48 am
by alanbirtles
for performing such modifications it is much better to create a post processor. look in prog_dets.lua for some examples

Re: Insert HDTV tag based on channel name

Posted: Fri Apr 15, 2011 9:10 pm
by AdeG43
Thanks Alan, this is beyond me but if anyone ever takes it on I'd be grateful if they could share it.
thanks again
Ade

Re: Insert HDTV tag based on channel name

Posted: Wed Apr 20, 2011 12:16 am
by AdeG43
Thanks for the advice. I'm trying to alter the prog_details.lua and have been able to include an 'AddHD' option in the PrgDets post-processor settings menu.
I'm working on the script but am very stuck at this point.

if AddHD then
program.Video.Quality="HDTV"
end

The GUI returns that" attempt to index field "Video" ( a nil value)".
Could you help me out with how to set the value of <video><quality>?

If I can get this I'll work on an IF THEN statement to detect if HD is in the channel name.

thanks again
Ade

Re: Insert HDTV tag based on channel name

Posted: Fri Apr 22, 2011 6:45 pm
by alanbirtles
program.Video may be null so you need to make sure its a table before you try to modify it:

Code: Select all

if AddHD then
   if not program.Video then
      program.Video = {}
      end
   program.Video.Quality="HDTV"
end
note that the above code hasn't been tested

Re: Insert HDTV tag based on channel name

Posted: Wed Nov 21, 2012 9:38 am
by starfire
Hi,

Did anyone get anywhere with this?

I too would like to have the ability to set the HDTV flag on all programs based on the channel name as Radio Times do not present this data?

Thanks.