Copy EPG data of one channel to another? (1 Viewer)

d3cadent

Portal Member
April 19, 2008
47
3
Hi there,

I would like to copy programme info from one channel to another.
My provider has no EPG for some HD channels. However, the same channel is also available in SD format, which indeed has EPG data. Now, I would like to retrieve EPG for the SD channel and use it on the HD channel. How's the best way to do this?
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    How's the best way to do this?
    There are multiple ways. The best way depends on your preference.

    One way is to merge the channels.
    Another way is to use an external EPG grabber/source. Both XMLTV and WebEPG plugins enable you to specify which EPG data is linked to each channel, and the same EPG data can be linked to more than one channel.
     

    d3cadent

    Portal Member
    April 19, 2008
    47
    3
    I will definitely look into merging.
    Extra question: will this leave me with the option of watching specifically the SD or HD channel at wish? Or do I need to make a permanent decision which one will be the one available?

    WebEPG / XMLTV: currently no data source for my region. I am an avid XMLTV user, but after the latest site change of our local programme portal, XMLTV / WebEPG can not grab programme data anymore (at least this is the situation right now, may change later - depending on XMLTV developers). This is why I have to resort to DVB EPG data.
     

    regeszter

    Retired Team Member
  • Premium Supporter
  • October 29, 2005
    5,335
    4,954
    Home Country
    Hungary Hungary
    Extra question: will this leave me with the option of watching specifically the SD or HD channel at wish? Or do I need to make a permanent decision which one will be the one available?

    The TVServer will select the available tuner by priority.
     

    d3cadent

    Portal Member
    April 19, 2008
    47
    3
    Well, and what happens if both channels are on the same tuner? These are channels of the same provider. Can I control which one I wish to view?
     

    Nervesagent

    Portal Pro
    February 26, 2014
    150
    19
    44
    Home Country
    Denmark Denmark
    I wrote a MS Access form to take care of this for me. You'd need to know how to install an odbc driver and create a form with a button though..

    Here's my code:

    Code:
    Dim sSource As String
    Dim sTarget As String
    Dim ssql
    
    With Form.Recordset
    If Not Form.Recordset.EOF = True Then
        Form.Recordset.MoveLast
        Form.Recordset.MoveFirst
    End If
    While Not Form.Recordset.EOF = True
        sSource = Form.Recordset("Channel")
        sTarget = Form.Recordset("CopyToChannel")
        ssql = "SELECT program.* INTO tblTemp FROM program WHERE program.idChannel=" & sSource
        DoCmd.RunSQL ssql
        DoCmd.RunSQL "UPDATE tblTemp SET idchannel=" & sTarget
        DoCmd.RunSQL "UPDATE tblTemp SET idprogram=NULL"
        DoCmd.RunSQL "INSERT INTO program SELECT * FROM tblTemp"
        DoCmd.RunSQL "DROP TABLE tblTemp"
        Form.Recordset.MoveNext
    Wend
    End With
    End Sub
     

    Nervesagent

    Portal Pro
    February 26, 2014
    150
    19
    44
    Home Country
    Denmark Denmark
    You can use autorun on opening the .mdb and you can put that in a task scheduler.

    Currently I've started writing a standalone tool (in vb or powershell, don't know yet) just for this purpose (and to keep up with my programming skills)
     

    Nervesagent

    Portal Pro
    February 26, 2014
    150
    19
    44
    Home Country
    Denmark Denmark
    For anybody who wants to mess with it.
    I've kinda extracted the epgcopy part from my extensive Ms Access - MediaPortal toolkit which I use to maintain channels and stuff.
    I havent tested my install instructions but let me know if you run into any issues.
     

    Attachments

    • epgcopy.zip
      5.7 MB

    d3cadent

    Portal Member
    April 19, 2008
    47
    3
    Thank you, Nervesagent.

    There is one small error (or something is different on my machine then on yours): when running the command "UPDATE tblTemp SET idprogram=NULL" I get an SQL error that idprogram cannot be null. Anyway, a "UPDATE tblTemp SET idprogram=idprogram + 500000" is just as fine.

    Two other possible options for running the queries besides MS Access:
    - use Windows Scheduler to run the SQL queries from a batch file
    - MySQL has an internal feature called Event Scheduler that can be used for running scheduled query batches, without external scheduler.

    Anyway, MS Access is also a possible tool. I just don't have it installed on my media server...
     

    Users who are viewing this thread

    Top Bottom