A Helpful script!!

Discussion of Version 3 and developing lua grabbers
Post Reply
pbathuk
Posts: 8
Joined: Thu Dec 30, 2010 2:52 pm

A Helpful script!!

Post by pbathuk »

Hi all,

I have only recently started using this program but have found it amazingly helpful with linking mediaportal to the EPG.

I did however find one weirdness with mediaportal that was causing me some annoyance.

When I was importing the EPG from XMLTV if a show had a zero length (i.e. Weatherview on BBC One) it would use the start of that program but the end of the next program so I missed out on a few films because of this... I therefore wrote the following script for the Radiotimes downloader.

All it does is check the hour, minute and second of the start and stop time to ensure they are not the same, if they are then it deletes that entry.
To install simply load it into the scripts\uk_rt\ folder and then when you next load up XMLTV gui it be available to select, it does not need any customisation.

Hopefully someone else will find it useful!

Cheers
Last edited by pbathuk on Thu Dec 30, 2010 8:35 pm, edited 1 time in total.
alanbirtles
Site Admin
Posts: 495
Joined: Mon Sep 06, 2004 4:44 pm

Re: A Helpful scripts!!

Post by alanbirtles »

if you upload the script it may be more helpful
pbathuk
Posts: 8
Joined: Thu Dec 30, 2010 2:52 pm

Re: A Helpful scripts!!

Post by pbathuk »

alanbirtles wrote:if you upload the script it may be more helpful
Sorry about that, I did press Choose File and then pressed Add the File but for some unknown reason it decided to drop it off the post.

I have just figured out why though... The forum does not allow Lua scripts to be attached. Therefore Please find below the code

Code: Select all

local channels={}
local grabber


require("timezones")
require("XGUI_Lib")

local function Pass1Func(proc,program)
	local dst,starthour,stophour
	local i,n
	XGUI.SetStatus(2,"Processing "..XGUI_Lib.XS.Val(program.Title))
	if program.Start.Hour==program.Stop.Hour and program.Start.Minute==program.Stop.Minute and program.Start.Second==program.Stop.Second then
	else
	return program
	end
	end

	
PostProcs.UK_RT_Zero_Length_Del={
	Name = "UK - Delete Zero Length Programs",
	Version = "1.00.00",
	Author = "Philip Bath",
	InfoURL = "",
	Grabber = "UK_RT",
	Passes={
		Pass1={
			Type=XGUI.PassTypes.Program,
			Func=Pass1Func,
			},
		},
	}
simply copy the above into a text editor and save as uk_rt_delete_zero_length.lua and add to your scripts folder

Cheers

Phil
Post Reply