XMLTV file not importing to database automatically (1 Viewer)

arion_p

Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    As always, logs are needed.
     

    Beast

    Portal Member
    April 30, 2012
    8
    0
    48
    Home Country
    Germany Germany
    Sorry, here are the log files.
    I just grabbed the EPG using WebGrab++ and waitet some time. But nothing was imported to MediaPortal.
     

    Brudertac

    MP Donator
  • Premium Supporter
  • October 26, 2006
    978
    277
    Augsburg
    Home Country
    Germany Germany
    Beast,

    have you found a Solution? I have the same Problem here. Log´s shows nothing. (no error no event...)

    Thanks!

    Found it. Had to copy the File to the xmltv Folder instead of "create it" there.
     
    Last edited:

    Beast

    Portal Member
    April 30, 2012
    8
    0
    48
    Home Country
    Germany Germany
    Hi,

    from on day to the other ist works without doing anything. So I don't know whats wrong.
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    Please remember: XMLTV import plugin will try to import tvguile.xml once its "modified date" changes. If you have your grabber write the file directly to the xmltv directory, XMLTV import plugin will start importing before the grabber finishes writing to the file (which means it may try to import a partial or even empty file). As a result, grabbing to a temporary file and then moving the file to the proper location (xmltv directory) is MANDATORY.
     

    andy_p

    Portal Member
    July 10, 2008
    14
    1
    London
    Home Country
    United Kingdom United Kingdom
    Please remember: XMLTV import plugin will try to import tvguile.xml once its "modified date" changes. If you have your grabber write the file directly to the xmltv directory, XMLTV import plugin will start importing before the grabber finishes writing to the file (which means it may try to import a partial or even empty file). As a result, grabbing to a temporary file and then moving the file to the proper location (xmltv directory) is MANDATORY.

    Aha. That explains why so many people (including me) see it working when they press the manual import button, and when the service restarts, but not when their grabber generates the tvguide.xml file to the directory as specified in several guides.

    How can I add this extra deployment step to my grabber process? I am currently using a task scheduler task to trigger the console version of xmltv gui. I guess I could change the task to run a batch file, but it all seems quite clumsy.

    My preference, though, would be for the XMLTV import plugin to wait (and keep retrying) until it could get an exclusive write lock on the entire file. This would ensure that the grabbers had finished before the plugin starts to read in the file. Is the source available / can I try to add that to it myself?
     

    RonD

    Test Group
  • Team MediaPortal
  • December 20, 2011
    911
    278
    SillyValley CA
    Home Country
    United States of America United States of America
    I'm curious about how xmltv reads data from tvguide.xml. I've always used a 2 line batch file with mc2xml that does the following and I've never seen a problem when I do the copy. Does xmltv/mc2xml work if you use the "mc2xml -o tvguide.xml" option?

    mc2xml -c us -g ZIPCODE
    copy xmltv.xml tvguide.xml
     

    TLD

    Portal Pro
    October 26, 2007
    949
    386
    Rainy Washington
    Home Country
    United States of America United States of America
    I always used the "mc2xml -o tvguide.xml" option in the task scheduler and never had a problem writing to the file where xmltv plugin looked for the tvguide.xml.
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    How can I add this extra deployment step to my grabber process? I am currently using a task scheduler task to trigger the console version of xmltv gui. I guess I could change the task to run a batch file, but it all seems quite clumsy.
    That is usually the best choice, unless ofc the xmltv grabber already incorporates such a feature. For example WebEPG inherently writes the new tvguide.xml in a temporary file. When finished, it deletes the original tvguide.xml and renames the temporary file to tvguide.xml. This way the change is instant (even copying can be caught in the middle if the file is to big, not to mention that copying is inefficient).

    My preference, though, would be for the XMLTV import plugin to wait (and keep retrying) until it could get an exclusive write lock on the entire file. This would ensure that the grabbers had finished before the plugin starts to read in the file.
    That could cause a lot of issues. Off the top of my head: if tvguide.xml resides in a location where xmltv import plugin has read-only access, it will never be able to get a write lock. Also a write lock requires opening the file in write mode which would essentially change its modified time. There are probably other issues that would surface should we implement this idea.
     

    andy_p

    Portal Member
    July 10, 2008
    14
    1
    London
    Home Country
    United Kingdom United Kingdom
    My preference, though, would be for the XMLTV import plugin to wait (and keep retrying) until it could get an exclusive write lock on the entire file. This would ensure that the grabbers had finished before the plugin starts to read in the file.
    That could cause a lot of issues. Off the top of my head: if tvguide.xml resides in a location where xmltv import plugin has read-only access, it will never be able to get a write lock. Also a write lock requires opening the file in write mode which would essentially change its modified time. There are probably other issues that would surface should we implement this idea.
    Ok, but there must be some way to wait until the grabber has finished, like opening it in exclusive read mode as detailed here: http://stackoverflow.com/questions/685135/open-file-in-exclusive-mode-in-c-sharp
     

    Users who are viewing this thread

    Top Bottom