home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
Overlapping programs cleanup script for TVGuide
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Dirk" data-source="post: 65349" data-attributes="member: 11937"><p>Being an database adminstrator myself, I have written a sql script that removes overlapping programs and leaves the smaller ones. For instance things like 'Nederland 3' and 'Z@pp', CNBC, Jetix, </p><p>or 'Science Fiction week' are automatically removed.</p><p></p><p>I have made 2 sqlscripts;</p><p>This first sqlscript only shows the results,</p><p>the second one <strong>really removes</strong> them.</p><p></p><p>The scripts can be started within <strong>'SQLite Database Browser'</strong> found in the <strong>Docs</strong> directory of mediaportal, use the execute SQL tab.</p><p>You need to open the file <strong>TVDatabaseV21.db3</strong></p><p>in the subdirectory <strong>database</strong> of mediaportal</p><p>Don't forget to save it before exitting SQLite Database Browser.</p><p></p><p>This is also exactly my present problem: how can I automate this?</p><p>Or can it be incorporated in mediaportal tvguide import routine itself?</p><p></p><p>The <strong>first/(show)</strong> script:</p><p>The name of the overlapping program, the names of the first and the last program within the timeframe of the overlapping program are shown.</p><p>Followed by the times:</p><p>starttime of the overlapping show, </p><p>startime of first show, </p><p>endtime of last show and the </p><p>endtime of the overlapping show</p><p></p><p>[code]Select p1.strTitle</p><p>, p2.strTitle</p><p>, p3.strTitle</p><p>, p1.iStartTime</p><p>, p2.iStartTime</p><p>, p3.iEndTime</p><p>, p1.iEndTime</p><p>From tblPrograms p1</p><p>, tblPrograms p2</p><p>, tblPrograms p3</p><p>where p2.iStartTime >= p1.iStartTime</p><p>and p2.iEndTime < p1.iEndTime</p><p>and p2.idChannel = p1.idChannel</p><p>and p3.iStartTime > p1.iStartTime</p><p>and p3.iEndTime <= p1.iEndTime</p><p>and p3.idChannel = p1.idChannel[/code]</p><p></p><p>The <strong>second/(delete)</strong> script:</p><p>[code]Delete tblPrograms p1</p><p>where exists (Select 0 </p><p> from tblPrograms p2</p><p> where p2.iStartTime >= p1.iStartTime</p><p> and p2.iEndTime < p1.iEndTime</p><p> and p2.idChannel = p1.idChannel)</p><p> and exists (Select 0 </p><p> from tblPrograms p3</p><p> where p3.iStartTime > p1.iStartTime</p><p> and p3.iEndTime <= p1.iEndTime</p><p> and p3.idChannel = p1.idChannel)</p><p>[/code]</p><p></p><p>I hope you like it!</p></blockquote><p></p>
[QUOTE="Dirk, post: 65349, member: 11937"] Being an database adminstrator myself, I have written a sql script that removes overlapping programs and leaves the smaller ones. For instance things like 'Nederland 3' and 'Z@pp', CNBC, Jetix, or 'Science Fiction week' are automatically removed. I have made 2 sqlscripts; This first sqlscript only shows the results, the second one [b]really removes[/b] them. The scripts can be started within [b]'SQLite Database Browser'[/b] found in the [b]Docs[/b] directory of mediaportal, use the execute SQL tab. You need to open the file [b]TVDatabaseV21.db3[/b] in the subdirectory [b]database[/b] of mediaportal Don't forget to save it before exitting SQLite Database Browser. This is also exactly my present problem: how can I automate this? Or can it be incorporated in mediaportal tvguide import routine itself? The [b]first/(show)[/b] script: The name of the overlapping program, the names of the first and the last program within the timeframe of the overlapping program are shown. Followed by the times: starttime of the overlapping show, startime of first show, endtime of last show and the endtime of the overlapping show [code]Select p1.strTitle , p2.strTitle , p3.strTitle , p1.iStartTime , p2.iStartTime , p3.iEndTime , p1.iEndTime From tblPrograms p1 , tblPrograms p2 , tblPrograms p3 where p2.iStartTime >= p1.iStartTime and p2.iEndTime < p1.iEndTime and p2.idChannel = p1.idChannel and p3.iStartTime > p1.iStartTime and p3.iEndTime <= p1.iEndTime and p3.idChannel = p1.idChannel[/code] The [b]second/(delete)[/b] script: [code]Delete tblPrograms p1 where exists (Select 0 from tblPrograms p2 where p2.iStartTime >= p1.iStartTime and p2.iEndTime < p1.iEndTime and p2.idChannel = p1.idChannel) and exists (Select 0 from tblPrograms p3 where p3.iStartTime > p1.iStartTime and p3.iEndTime <= p1.iEndTime and p3.idChannel = p1.idChannel) [/code] I hope you like it! [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Electronic Program Guide
WebEPG
Overlapping programs cleanup script for TVGuide
Contact us
RSS
Top
Bottom