Insert HDTV tag based on channel name

Discussion of Version 3 and developing lua grabbers
Post Reply
AdeG43
Posts: 3
Joined: Sat Apr 09, 2011 8:59 pm

Insert HDTV tag based on channel name

Post 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
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Re: Insert HDTV tag based on channel name

Post by alanbirtles »

for performing such modifications it is much better to create a post processor. look in prog_dets.lua for some examples
AdeG43
Posts: 3
Joined: Sat Apr 09, 2011 8:59 pm

Re: Insert HDTV tag based on channel name

Post 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
AdeG43
Posts: 3
Joined: Sat Apr 09, 2011 8:59 pm

Re: Insert HDTV tag based on channel name

Post 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
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Re: Insert HDTV tag based on channel name

Post 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
starfire
Posts: 7
Joined: Wed Sep 01, 2010 9:36 pm

Re: Insert HDTV tag based on channel name

Post 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.
Post Reply