Page 1 of 1

Not all data grabbed from DigiGuide

Posted: Wed Mar 04, 2009 1:48 am
by mortstar
Hi, I posted this on the SageTV - DG2XML Forum but I thing it may have been deleted for mentioning MediaPortal - which is a shame.

I'm using DG2XML and XMLTV GUI (thanks!) to create an xmltv file for import into MediaPortal. I've begun playing around with the Program Detail postprocessor and wanted to suffix the program description with some video-metadata, as Digiguide provides data as to whether the program is widescreen or HD etc.

I've looked at the xml file created by XMLTV GUI and the audio and video metadata is not being downloaded from Digiguide. For example this program in Digiguide:
Image

Produces this data from XMLTV GUI:

Code: Select all

<programme start="20090305031500 +0000" stop="20090305041500 +0000" channel="441">
<title>Christianity: A History</title>
<desc>Eminent scientist Colin Blakemore examines Christianity&apos;s relationship with science. He argues that science is the biggest challenge Christianity has ever faced, and questions whether the fundamental tension between the two can ever be resolved. Or will science eventually make religion redundant?</desc>
<category>Religious</category>
<previously-shown/>
<subtitles type="teletext"></subtitles>
</programme>
Is this normal behaviour or is there something I am missing? Any help, as always, very much appreciated!

Re: Not all data grabbed from DigiGuide

Posted: Wed Mar 04, 2009 8:34 am
by alanbirtles
i'm not processing those elements. if you look in lib\xmltv_parse.lua from line 352 onwards. i cant really do much myself as my digiguide subscription has expired

Re: Not all data grabbed from DigiGuide

Posted: Wed Mar 04, 2009 7:59 pm
by mortstar
Thanks Alan for pointing me the right way. I've got the tags I want (HD or not, Part x of y ) in to descriptions. Having a bit of a problem with a cosmetic change I'd like to make.

I'd like Programme Details to convert 'Part 1 of 3' to just display as 1/3 (or 1 of 3 if '/' is not a valid character). I'm okay following the logic in lua to move things around but this manipulation of strings would probably take me an age.

I'm looking at functions like this in the code:
local function splitEpisodeNumString(str)
if string.find(str,"%/") then
local _,_,a,b = string.find(str,"%s*(%d*)%s*%/%s*(%d*)%s*")
a = tonumber(a)
b = tonumber(b)
if a and b then
if ShortEpisodeForm then
return (a+1).."/"..b
else
return (a+1).." of "..b
end
end
end
local num = tonumber(str)
if num then
return num+1
else
return ""
end
end
the highlighted bit is the one I just can't work out.

Re: Not all data grabbed from DigiGuide

Posted: Wed Mar 04, 2009 8:11 pm
by alanbirtles
for more information about string patterns see http://www.lua.org/pil/20.2.html.
The pattern means find any number of whitespace characters (%s*, %=white space *=0 or more times), folowed by any number of numbers (%d*) followed by whitespace followed by a slash (%/) followed by whitespace, numbers and more whitespace. The brackets represent captures. The first results are the locations in the string where the captues are found (we dont need these so they are both assigned to "_" (ignored)), the next results are the contents of the captures.