xmltv 2 ? (source + binary now available) (4 Viewers)

Laban

Portal Pro
July 1, 2007
206
18
Luleå
Home Country
Sweden Sweden
Hi

I had a few issues with the xmltv plugin as i've mentioned here in another thread:

https://forum.team-mediaportal.com/xmltv_guide_channel_mapping-t25072.html

So i decided to have a go at doing some changes that i think/hope will help (at least help me) when using the xmltv plugin.

The basic idea is that you'll map the channels "manually" (channel.externalid -> guide.id) using a new mapping function that i've added to the XmlTvImport plugin.

The import is then changed so that it maps the guidechannels using channel.externalid - guide.id instead of channel.Name - guide.display-name.

I've attached some screenshots on how you use this mapping tool.

It works like this:

1:

You'll load the channels/mappings (firstload.jpg). The tvguide-channels are loaded from the tvguide.xml (tvguide.lst...) and mapped using the display-name. Start by using the exact name, then first word and then three first letters.
Mappings that are marked (right column) green are exact matches, yellow partial match, red = no match. White = already mapped. Should be no such columns before the first mapping.

2: Edit the channelmappings (removed some incorrect mappings). Click save. (abouttosave.jpg). All mapped channel will be saved.

3: Click Load/Refresh again. All mapped channels should be marked white. (aftersave.jpg)

You can of course order the mappings by clicking on the headers. Id, Name and so forth.

It seems to work as it should but i haven't done any testing of the actual import (programs), i'm saving that for tomorrow. Perhaps i've fucked up the whole thing :)

But i'd like to get some input on this little project so let me know what you think.

Not sure what to do if this turns out to be something worth adding to the official code but perhaps i'm getting ahead of things here.

Edit: i'll put the source + binaries in this msg from now on. Makes it easier to find it.

Last updates:

fixed bug where the importer would run once every minute.

BBC3 and BBC 3 will now become an exact match (green) rather then a partial (yellow).

Added support for 1-n display names in the tvguide

Fixed bug concerning duplicate display-names in the tvguide.

Edit: 2007-07-16:

Added group combobox when loading channels
Added "load radio" channels checkbox, default off

The screenshots aren't exactly up-to-date atm, though i guess it doesn't matter that much

I'll start to call it a Beta release from now on, seems to work as it should, for me at least :)

Edit: 20070814:

Fixed importing .lst files and a progressbar issue when saving the mappings. Source code not available in the latest .zip, i'll fix that asap.

Edit: 20070823: latest SVN introduces a change in the channel , name and displayname are separated (a really good idea). Added a fix for this (download the _latestsvn version). Haven't had time to test it but it should work. There are some additional stuff in this version also, checkbox for visible in guide in the mappings table f.e

Edit: 20070824: fixed star-rating bug

Edit: 20070910: for the latest svn. (Note: might work, will test it after work today)

Edit: 20070929: Fixed the & problem, hopefully (used ConvertHTMLToAnsi.. for the title & description)

Edit: 20071023: Changed the "Delete before import" functionality. Now it only removes the programs the for the channels available in the tvguide.xml file(s) before importing, used to be "delete from program".

/Laban
 

Attachments

  • XmlTvImport2.zip
    30.6 KB

Laban

Portal Pro
July 1, 2007
206
18
Luleå
Home Country
Sweden Sweden
And of course there's a little bug if you look at the screenshots.. Fixed.. Hopefully, nobody noticed :)

I also added a checkbox for turning on/off partial matches. The idea is that you have it on the first time you do the mappings, when you do the major part of the work. Then you have it off when you f.e make a new autotune to scan for changes, new channels . I noticed that it can be rather annoying to have to go through all the partial matches and turn them off when you know that they aren't correct anyway.
 

fab70

Portal Member
February 11, 2007
27
0
Home Country
Italy Italy
I was following the thread on the xmltv, and it seems to me a good idea to manage in a flexible manner the import of the tv guide.
Look forward to test the new plugin.

Thx
 

Laban

Portal Pro
July 1, 2007
206
18
Luleå
Home Country
Sweden Sweden
Ok, here's the ALPHA version. Seems to work as it should, though i've only done some limited testing. Will test it more when my TV-Card wants to cooperate a bit better with the TV-Engine (Technotrend S-3200 + CI).

The XmlTvImport2.dll is included in the .zip file. And the sourcecode, if someone is interested.

Installation: copy the XmlTvImport2.dll to the mediaportal - tv-server installaton dir, plugin dir, in my case:

C:\Program Files\Team MediaPortal\MediaPortal TV Server\Plugins

Use: uncheck the xmltv plugin, check xmltv2.plugin in the TV-Server plugins.

Although you could actually skip checking the xmltv2 plugin initially, until you verified that the mappings are ok.

Autotune if it's a new installation, do the mappings, save, load if you want to verify the mappings. Go to the settings, try a manual import (added a import button). See that the result is is "..imported successfully", can take some time depending on the amount of days forward you grab the programs.

And you're done. Don't forget to enable the xmltv2 plugin if you skipped that initially.

UPDATE: improved import. Now handles multiple channels mapped to the same guide channel. Should also be a lot faster if i'm not mistaken.

UPDATE2: removed the automatic import of channels if their name's are matching. This means that channels won't be mapped unless you do it through the mapping function. Also added a export function that just writes all the channels that are mapped (from the grid/gui, not the database, so you need to load the mappings first) to a file. And another one by request, a choice to remove all current programs on every import so that potential incorrect data is replaced.

Send bugreports to dev@null.com ;)

Edit: i moved the binaries + source to the first post
/Laban
 

Hemin

Portal Pro
December 29, 2006
59
4
Home Country
Spain Spain
Hi Laban, I hope that this "little" plugin will be included on the official releases.

Thank you for your great work!

I will try it next, and let you know.
 

Laban

Portal Pro
July 1, 2007
206
18
Luleå
Home Country
Sweden Sweden
Noticed a bug, a last minute change that i forgot to test. Not sure if it's in the .dll that i've added to my previous post but i've updated the .zip file with both the binary and source code with the fix, just in case.
 

Laban

Portal Pro
July 1, 2007
206
18
Luleå
Home Country
Sweden Sweden
Noticed another bug. The import doesn't handle mappings where one guide channel is mapped to two tuning channels, as i suspected. I need to rewrite some parts of the import for this to work. Shouldn't be a big problem though.
 

fab70

Portal Member
February 11, 2007
27
0
Home Country
Italy Italy
Hi Laban,

tested with a very simple configuration (1 card and few channels) and it worked perfectly.

I'll test a more complex configuration in coming days and I let you know.

Ciao
 

Users who are viewing this thread

Top Bottom