Best way to insert programs in database (1 Viewer)

Edalex

Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    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?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    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.
     

    Edalex

    Community Plugin Dev
  • Premium Supporter
  • January 3, 2008
    2,955
    1,264
    Saratov
    Home Country
    Russian Federation Russian Federation
    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.
    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.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    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.
    If you convert to XMLTV, it enables standard tools to be used for data enriching (adding series + episode info).

    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.
    The PowerScheduler plugin can do the triggering.
    The XMLTV plugin will automatically import when it detects the file change.

    WebEPG is not the option...
    Did you think of improving it?
     

    Users who are viewing this thread

    Top Bottom