Best way to insert programs in database

Discussion in 'TV-Server Plugins' started by Edalex, May 21, 2017.

  1. Edalex
    • Premium Supporter

    Edalex Community Plugin Dev

    Joined:
    January 3, 2008
    Messages:
    2,901
    Likes Received:
    709
    Gender:
    Male
    Location:
    Saratov
    Ratings:
    +1,223 / 9
    Home Country:
    Russian Federation Russian Federation
    Show System Specs
    Hi there!
    I'm currently developing TVServer plugin for grabbing EPG from one site and I wonder what way is better to insert programs.
    My data is full EPG for one week for all my channels. So it's 10-50 k records. Should I do it once for all programs or maybe better split insertion process by channels?
    Also since my data is full week EPG I have a problem with db updating. Insertion in clean db takes several seconds but the same data could take several hours to insert in full db because of tvserver's deduplication process. So I assume I should clear db before every import with layer.RemoveAllPorgrams(idChannel) but iteration thought all channels deleted all data in db in act but looks like tvserver doesn't know about it/ Shouls I use new tvbusinesslayer for inserting to exclude deduplication or what?


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,734
    Ratings:
    +8,200 / 17
    Home Country:
    New Zealand New Zealand
    I suggest you try to write a WebEPG grabber... and if you can't do that, generate an XMLTV file that can be imported by the XMLTV plugin.
     
  4. Edalex
    • Premium Supporter

    Edalex Community Plugin Dev

    Joined:
    January 3, 2008
    Messages:
    2,901
    Likes Received:
    709
    Gender:
    Male
    Location:
    Saratov
    Ratings:
    +1,223 / 9
    Home Country:
    Russian Federation Russian Federation
    Show System Specs
    Right, XMLTV...
    I can make XMLTV Export but it will be 2 additional conversions (raw data ->xml in my plugin and xml->raw data in xmltv) in which I don't see any benefits but it will produce some problems with escaping/formatting data for xml compliance. First I thought I could use xmltv scheduler for importing my plugin's files in such case but now I realize I still need a trigger for my plugin execution.
    But since xmltv file is similar to mine (one file for all week for all channels) I'll look into its code for importing.
    WebEPG is not the option since a) it's ugly to use parsing for API b) I need to make some advanced data modofication like splitting episodes which is not possible with WebEPG.
     
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,734
    Ratings:
    +8,200 / 17
    Home Country:
    New Zealand New Zealand
    If you convert to XMLTV, it enables standard tools to be used for data enriching (adding series + episode info).

    The PowerScheduler plugin can do the triggering.
    The XMLTV plugin will automatically import when it detects the file change.

    Did you think of improving it?
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!