MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Main Features (talk, share your ideas, get support) » Electronic Program Guide » xmlTV


xmlTV everything related to xmlTV in here

Reply
 
Thread Tools Display Modes
Old 2008-04-25, 22:45   #1 (permalink)
mbb
Portal Member
 
Join Date: Nov 2004
Posts: 148
Thanks: 0
Thanked 2 Times in 2 Posts

Country:


fixed TVServer Import error episode-num field

since my tvguide provider add some new feature the TVguide.xml import fail.

status:tvguide.xml:Invalid XML file:Input string was not in a correct format.;

After some investigation, it seems that MP doesnt handle well the episode-num field.
I asked my provider about this and he claims that he respects the xmltv.dtd standard about this: XML: XMLTV - DTD for TV listings

I did some some test by replacing some string:
xmltv_ns">.. by xmltv_ns">
..</episode-num> by </episode-num>
xmltv_ns">0.. by xmltv_ns">0
and the same for 1.., 2.., 3.., etc

It works, and seems to confirm that the episode-num field parsing have something wrong.

I upload the file to test and some logs

Thanks
mbb
Attached Files
File Type: zip xmltv.zip (7.8 KB, 25 views)
mbb is offline   Reply With Quote
Old 2008-04-29, 22:30   #2 (permalink)
mbb
Portal Member
 
Join Date: Nov 2004
Posts: 148
Thanks: 0
Thanked 2 Times in 2 Posts

Country:


fixed

Ok I take time to run it in debug mode and I found the problem ... and the the solution

in XMLTVImport.cs the code doesnt work for this example 3..38/40 because it presume that p as only one digit, but 38 have 2 digits

we have to replace
Code:
 
int p = 0;
int t = 0;
if (Convert.ToInt32(episodePart.Substring(0, 1)) == 0)
{
    p = Convert.ToInt32(episodePart.Substring(0, 1)) + 1;
}
else
{
    p = Convert.ToInt32(episodePart.Substring(0, 1));
}
t = Convert.ToInt32(episodePart.Substring(2, 1));
episodePart = Convert.ToString(p) + "/" + Convert.ToString(t);
by
Code:
 
int p = 0;
int t = 0;
if (Convert.ToInt32(episodePart.Substring(0, episodePart.IndexOf("/", 0))) == 0)
{
    p = Convert.ToInt32(episodePart.Substring(0, episodePart.IndexOf("/", 0))) + 1;
}
else
{
    p = Convert.ToInt32(episodePart.Substring(0, episodePart.IndexOf("/", 0)));
}
t = Convert.ToInt32(episodePart.Substring(episodePart.IndexOf("/", 0) + 1, episodePart.Length -  episodePart.IndexOf("/", 0) + 1)));
episodePart = Convert.ToString(p) + "/" + Convert.ToString(t);
mbb is offline   Reply With Quote
Old 2008-04-30, 23:19   #3 (permalink)
mbb
Portal Member
 
Join Date: Nov 2004
Posts: 148
Thanks: 0
Thanked 2 Times in 2 Posts

Country:


Default

Finally I rewrite all the episode-num parsing in a more universal manner
It follow now the XMLTV DTD standard in all case

I join the fixed XmlTvImport.cs sources and the compiled dll to test the fix.
Attached Files
File Type: zip XmlTvImport.zip (39.4 KB, 48 views)
mbb is offline   Reply With Quote
This User Say Thank You:
Old 2008-05-01, 09:56   #4 (permalink)
Portal Member
 
Join Date: Mar 2007
Location: Normandie
Age: 36
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

This solved my problem, now my EPG works great !!!!

Thank a lot !!!!
ovni is offline   Reply With Quote
Old 2008-05-01, 11:28   #5 (permalink)
Portal Tester
 
ronilse's Avatar
 
Join Date: Jul 2005
Posts: 3,126
Thanks: 18
Thanked 84 Times in 70 Posts

Country:

My System

Default

Hi,
Have added this bug to Mantis & link to patch.

Thanks for testing

Regards
Roy
ronilse is offline   Reply With Quote
Old 2008-05-06, 16:51   #6 (permalink)
Portal Developer
 
gemx's Avatar
 
Join Date: Oct 2006
Age: 32
Posts: 1,258
Thanks: 24
Thanked 188 Times in 99 Posts

Country:

My System

Default

Fixed in rev. 19047.

mbb
__________________
ACCENT HT-100 | 2x16 VFD | ADM Athlon 64 3500+ | Win XP SP2 | SkyStar 2 DVB-S PCI | TT connect S2-3600
gemx is offline   Reply With Quote
Old 2008-08-16, 11:42   #7 (permalink)
Portal Member
 
Join Date: Nov 2006
Posts: 57
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Send a message via Skype™ to blaudden
Default

Hi,

just found another problem in XMLTvImport, the function 'CorrectEpisodeNum' throws an exception from Int32.Parse, have written a patch and attached to the below mention thread. The patch will catch the exception, log a message about the problem to the log and then return an empty string.

XMLTvImport fails to parse malformed episode part

/ Magnus
blaudden is offline   Reply With Quote
Reply

Bookmarks

Tags
episodenum, field, import, tvserver

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Import channel list from Mediaportal into TVserver Redfish Improvement Suggestions 2 2008-07-02 18:04
Why was the db-field for episode names dropped? Maschine Development 0 2007-10-04 13:56
Error Retrieving Episode information Bobb25 My TVSeries 12 2007-08-14 06:52
XMLTV import does not work on TVServer HanuIv pre 1.0 RC1 0 2007-07-01 12:20
Import of episode info XMLTV sunsetdk Get Support 1 2007-06-28 19:37


All times are GMT +1. The time now is 06:46.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress