freeview channel time limiter
Posted: Thu Nov 24, 2005 11:33 pm
I have made a new script that limits freeview channels to the time when they are broadcast:
save to scripts\uk_rt\ukrt_freeview_limit.lua
to add additional channels simply add a channels id its start and stop hour to the array at the top of the script
Code: Select all
local channels={{id="1856",start=6,stop=18}}
local function Pass1Func(proc,program)
local dst,starthour,stophour
local i,n
XGUI.SetStatus(2,"Processing "..XGUI_Lib.XS.Val(program.Title))
dst=time.IsEUDST(program.Start)
if dst then
starthour=program.Start.Hour+1
stophour=program.Stop.Hour+1
else
starthour=program.Start.Hour
stophour=program.Stop.Hour
end
n=table.getn(channels)
for i=1,n do
if program.Channel==channels[i].id then
if (starthour<channels[i].start)or(stophour<channels[i].start)
or(starthour>=channels[i].stop)or(stophour>channels[i].stop)
or((stophour==channels[i].stop)and(program.Stop.Minute>0))
or((stophour==channels[i].start)and(program.Stop.Minute==0)) then
return XGUI.OK
else return program
end
end
end
return program
end
PostProcs.UK_RT_Free_Limit={
Name = "UK - Radio Times freeview channel time limiter",
Version = "1.0",
Author = "Alan Birtles",
InfoURL = "http://www.birtles.org.uk/xmltv",
Grabber = "UK_RT",
Passes={
Pass1={
Type=XGUI.PassTypes.Program,
Func=Pass1Func,
},
},
}
to add additional channels simply add a channels id its start and stop hour to the array at the top of the script