Page 1 of 1
Change Channel ID feature from V2
Posted: Sun Mar 05, 2006 10:38 am
by simon
Hi,
I have upgraded from v2 to the latest v3 and am using the UK_RT grabber. One feature I can't seem to find is the ability to change the punctuation in the channel IDs. For example, in v2 I could change the colon in TMF:The Music Channel to TMF. The Music Channel. This allowed me to use a Channel logo in GBPVR.
Can anyone help me and show me where this feature is in v3?
Thanks,
Simon
Posted: Sun Mar 05, 2006 10:40 am
by alanbirtles
you would need to write a post processor script to do this
Posted: Sun Mar 05, 2006 11:27 am
by alanbirtles
add the following code to the end of lib\xgui_lib.lua
Code: Select all
XGUI_Lib.XS.Replace = function (xstr,str)
if not xstr then return str
elseif not str then return xstr
end
local xtype=XGUI_Lib.XS.Type(xstr)
if xtype==XGUI_Lib.XS.Type_String then return str
elseif xtype==XGUI_Lib.XS.Type_XString then
xstr.Value=str
return xstr
else
xstr[1]=XGUI_Lib.XS.Replace(xstr[1],str)
return xstr
end
end
then save this script to the scripts directory
Code: Select all
require("XGUI_Lib")
local RepChar
local function Pass1Func(proc,channel)
local cname=XGUI_Lib.XS.Val(channel.Name)
XGUI.SetStatus(2,"Processing "..cname)
cname,_=string.gsub(cname,":",RepChar)
channel.Name=XGUI_Lib.XS.Replace(channel.Name,cname)
return channel
end
local function Pass1Start(proc)
RepChar=XGUI.GetSetting(proc,"RepChar","-")
return XGUI.OK
end
local function Init(proc)
XGUI.AddSetting(proc,"RepChar",XGUI.SettingType.String,"-","Character(s) to replace \":\" with:")
return XGUI.OK
end
PostProcs.ChanColon={
Name = "Channel Colon Replacer",
Version = "1.00.00",
Author = "Alan Birtles",
InfoURL = "http://www.birtles.org.uk/xmltv/wiki/index.php?title=ChanColon",
Passes={
Pass1={
Start=Pass1Start,
Type=XGUI.PassTypes.Channel,
Func=Pass1Func,
},
},
Init=Init,
}
Posted: Fri Mar 10, 2006 6:37 pm
by alanbirtles
the above script is now included in v3.03.00