Ticket #713: perchanneloffset_cp_v1.diff

File perchanneloffset_cp_v1.diff, 4.4 KB (added by cpinkham, 14 years ago)

Patch against SVN v9270 with changes described in my message from 5 minutes ago.

  • libs/libmythtv/channelsettings.cpp

     
    8282    };
    8383};
    8484
     85class TimeOffset: public SpinBoxSetting, public CSetting {
     86public:
     87    TimeOffset(const ChannelID& id):
     88        SpinBoxSetting(-1440, 1440, 1), CSetting(id, "tmoffset") {
     89        setLabel(QObject::tr("DataDirect") + " " + QObject::tr("Time Offset"));
     90        setHelpText(QObject::tr("Offset (in minutes) to apply to the program "
     91                    "guide data during import.  This can be used when the "
     92                    "listings for a particular channel are in a different "
     93                    "time zone.") + " " +
     94                    QObject::tr("(Works for DataDirect listings only.)"));
     95    };
     96};
     97
    8598class Rank: public SpinBoxSetting, public CSetting {
    8699public:
    87100    Rank(const ChannelID& id):
     
    284297    connect(source,SIGNAL(valueChanged(const QString&)),this,SLOT(sourceChanged(const QString&)));
    285298#else
    286299    addChild(new XmltvID(id));
     300    addChild(new TimeOffset(id));
    287301#endif
    288302};
    289303
     
    347361    addChild(new Colour(id));
    348362    addChild(new Hue(id));
    349363};
     364
     365/* vim: set expandtab tabstop=4 shiftwidth=4: */
  • libs/libmythtv/dbcheck.cpp

     
    1010#include "mythdbcon.h"
    1111
    1212/// This is the DB schema version expected by the running MythTV instance.
    13 const QString currentDatabaseVersion = "1129";
     13const QString currentDatabaseVersion = "1130";
    1414
    1515static bool UpdateDBVersionNumber(const QString &newnumber);
    1616static bool performActualUpdate(const QString updates[], QString version,
     
    240240The 'xmltvid' field is used to identify this channel to the listings
    241241provider.
    242242
     243The 'tmoffset' field is used to apply an offset (in minutes) from the listings
     244provided by the provider to a new time in the MythTV program guide database.
     245This is very handy when the listings provider has listings which are offset
     246by a few hours on individual channels with the rest of them being correct.
     247
    243248The 'recpriority' field is used tell the scheduler from which of two
    244249otherwise equivalent programs on two different channels should be
    245250prefered, a higher number means this channel is more preferred.
     
    21122117            return false;
    21132118    }
    21142119
     2120    if (dbver == "1129")
     2121    {
     2122        const QString updates[] = {
     2123"ALTER TABLE channel ADD COLUMN tmoffset INT NOT NULL default '0';",
     2124""
     2125};
     2126
     2127        if (!performActualUpdate(updates, "1130", dbver))
     2128            return false;
     2129    }
     2130
    21152131//"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21
    21162132//"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21
    21172133
  • programs/mythfilldatabase/filldata.cpp

     
    988988                    "hdtv, closecaptioned, partnumber, parttotal, seriesid, "
    989989                    "originalairdate, colorcode, syndicatedepisodenumber, "
    990990                    "programid) "
    991                     "SELECT chanid, starttime, endtime, "
     991                    "SELECT dd_v_program.chanid, "
     992                    "DATE_ADD(starttime, INTERVAL channel.tmoffset MINUTE), "
     993                    "DATE_ADD(endtime, INTERVAL channel.tmoffset MINUTE), "
    992994                    "title, subtitle, description, "
    993995                    "showtype, dd_genre.class, category_type, "
    994996                    "airdate, stars, previouslyshown, stereo, subtitled, "
    995997                    "hdtv, closecaptioned, partnumber, parttotal, seriesid, "
    996998                    "originalairdate, colorcode, syndicatedepisodenumber, "
    997                     "dd_v_program.programid FROM dd_v_program "
     999                    "dd_v_program.programid FROM dd_v_program, channel "
    9981000                    "LEFT JOIN dd_genre ON ("
    9991001                    "dd_v_program.programid = dd_genre.programid AND "
    1000                     "dd_genre.relevance = '0');"))
     1002                    "dd_genre.relevance = '0') "
     1003                    "WHERE dd_v_program.chanid = channel.chanid;"))
    10011004        MythContext::DBError("Inserting into program table", query);
    10021005
    10031006    //cerr << "Finished adding rows to main program table...\n";