Ticket #4615: property_flags_v2.diff

File property_flags_v2.diff, 15.8 KB (added by Janne Grunau, 12 years ago)
  • libs/libmythtv/eit.cpp

     
    133133        "SELECT title,          subtitle,      description, "
    134134        "       category,       category_type, "
    135135        "       starttime,      endtime, "
    136         "       closecaptioned, stereo,        hdtv, "
     136        "       subtitletypes,  audioprop,     videoprop, "
    137137        "       seriesid,       programid, "
    138138        "       partnumber,     parttotal, "
    139139        "       syndicatedepisodenumber, "
     
    351351        "    description    = :DESC, "
    352352        "    category       = :CAT,       category_type = :CATTYPE, "
    353353        "    starttime      = :STARTTIME, endtime       = :ENDTIME, "
    354         "    closecaptioned = :CC, "
     354        "    closecaptioned = :CC,        subtitled     = :SUBTITLED, "
    355355        "    stereo         = :STEREO,    hdtv          = :HDTV, "
     356        "    subtitletypes  = :SUBTYPE, "
     357        "    audioprop      = :AUDIOPROP, videoprop     = :VIDEOPROP, "
    356358        "    partnumber     = :PARTNO,    parttotal     = :PARTTOTAL, "
    357359        "    syndicatedepisodenumber = :SYNDICATENO, "
    358360        "    airdate        = :AIRDATE,   originalairdate=:ORIGAIRDATE, "
     
    371373    query.bindValue(":CATTYPE",     lcattype.utf8());
    372374    query.bindValue(":STARTTIME",   starttime);
    373375    query.bindValue(":ENDTIME",     endtime);
    374     query.bindValue(":CC",          lsubtype);
    375     query.bindValue(":STEREO",      laudio);
    376     query.bindValue(":HDTV",        lvideo);
     376    query.bindValue(":CC",          lsubtype & SUB_HARDHEAR ? true : false);
     377    query.bindValue(":SUBTITLED",   lsubtype & SUB_NORMAL ? true : false);
     378    query.bindValue(":STEREO",      laudio & AUD_STEREO ? true : false);
     379    query.bindValue(":HDTV",        lvideo & VID_HDTV ? true : false);
     380    query.bindValue(":SUBTYPE",     lsubtype);
     381    query.bindValue(":AUDIOPROP",   laudio);
     382    query.bindValue(":VIDEOPROP",   lvideo);
    377383    query.bindValue(":PARTNO",      lpartnumber);
    378384    query.bindValue(":PARTTOTAL",   lparttotal);
    379385    query.bindValue(":SYNDICATENO", lsyndicatedepisodenumber.utf8());
     
    505511        "  chanid,         title,          subtitle,        description, "
    506512        "  category,       category_type, "
    507513        "  starttime,      endtime, "
    508         "  closecaptioned,      stereo,          hdtv, "
     514        "  closecaptioned, stereo,         hdtv,            subtitled, "
     515        "  subtitletypes,  audioprop,      videoprop, "
    509516        "  partnumber,     parttotal, "
    510517        "  syndicatedepisodenumber, "
    511518        "  airdate,        originalairdate,listingsource, "
     
    514521        " :CHANID,        :TITLE,         :SUBTITLE,       :DESCRIPTION, "
    515522        " :CATEGORY,      :CATTYPE, "
    516523        " :STARTTIME,     :ENDTIME, "
    517         " :CC,            :STEREO,         :HDTV, "
     524        " :CC,            :STEREO,        :HDTV,           :SUBTITLED, "
     525        " :SUBTYPES,      :AUDIOPROP,     :VIDEOPROP, "
    518526        " :PARTNUMBER,    :PARTTOTAL, "
    519527        " :SYNDICATENO, "
    520528        " :AIRDATE,       :ORIGAIRDATE,   :LSOURCE, "
    521         " :SERIESID,      :PROGRAMID ,    :PREVSHOWN) ");
     529        " :SERIESID,      :PROGRAMID,     :PREVSHOWN) ");
    522530
    523531    QString cattype = myth_category_type_to_string(category_type);
    524532
     
    530538    query.bindValue(":CATTYPE",     cattype.utf8());
    531539    query.bindValue(":STARTTIME",   starttime);
    532540    query.bindValue(":ENDTIME",     endtime);
    533     query.bindValue(":CC",          subtitleType);
    534     query.bindValue(":STEREO",      audioProps);
    535     query.bindValue(":HDTV",        videoProps);
     541    query.bindValue(":CC",          subtitleType & SUB_HARDHEAR ? true : false);
     542    query.bindValue(":STEREO",      audioProps & AUD_STEREO ? true : false);
     543    query.bindValue(":HDTV",        videoProps & VID_HDTV ? true : false);
     544    query.bindValue(":SUBTITLED",   subtitleType & SUB_NORMAL ? true : false);
     545    query.bindValue(":SUBTYPES",    subtitleType);
     546    query.bindValue(":AUDIOPROP",   audioProps);
     547    query.bindValue(":VIDEOPROP",   videoProps);
    536548    query.bindValue(":PARTNUMBER",  partnumber);
    537549    query.bindValue(":PARTTOTAL",   parttotal);
    538550    query.bindValue(":SYNDICATENO", syndicatedepisodenumber.utf8());
  • libs/libmythtv/dbcheck.cpp

     
    1313#define MINIMUM_DBMS_VERSION 5
    1414
    1515/// This is the DB schema version expected by the running MythTV instance.
    16 const QString currentDatabaseVersion = "1209";
     16const QString currentDatabaseVersion = "1210";
    1717
    1818static bool UpdateDBVersionNumber(const QString &newnumber);
    1919static bool performActualUpdate(const QString updates[], QString version,
     
    34493449            return false;
    34503450    }
    34513451
     3452    if (dbver == "1209")
     3453    {
     3454        const QString updates[] = {
     3455"ALTER TABLE program ADD audioprop     tinyint(3) unsigned NOT NULL; ",
     3456"ALTER TABLE program ADD subtitletypes tinyint(3) unsigned NOT NULL; ",
     3457"ALTER TABLE program ADD videoprop     tinyint(3) unsigned NOT NULL; ",
     3458"ALTER TABLE recordedprogram ADD audioprop     tinyint(3) unsigned NOT NULL; ",
     3459"ALTER TABLE recordedprogram ADD subtitletypes tinyint(3) unsigned NOT NULL; ",
     3460"ALTER TABLE recordedprogram ADD videoprop     tinyint(3) unsigned NOT NULL; ",
     3461"UPDATE program SET audioprop     = stereo;",
     3462"UPDATE program SET subtitletypes = closecaptioned | (subtitled << 1);",
     3463"UPDATE program SET videoprop     = hdtv;",
     3464"UPDATE recordedprogram SET audioprop     = stereo;",
     3465"UPDATE recordedprogram SET subtitletypes = closecaptioned | (subtitled << 1);",
     3466"UPDATE recordedprogram SET videoprop     = hdtv;",
     3467""
     3468};
     3469        if (!performActualUpdate(updates, "1210", dbver))
     3470            return false;
     3471    }
     3472
    34523473//"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22
    34533474//"ALTER TABLE channel DROP COLUMN atscsrcid;" in 0.22
    34543475//"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22
     
    34623483//"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22
    34633484//"ALTER TABLE channel DROP COLUMN commfree;" in 0.22
    34643485
     3486//"ALTER TABLE program DROP column stereo;" deprecated
     3487//"ALTER TABLE program DROP column hdtv;" deprecated
     3488//"ALTER TABLE program DROP column closecaptioned;" deprecated
     3489//"ALTER TABLE program DROP column subtitled;" deprecated
     3490//"ALTER TABLE program DROP column stereo;" deprecated
     3491//"ALTER TABLE recordedprogram DROP column stereo;" deprecated
     3492//"ALTER TABLE recordedprogram DROP column hdtv;" deprecated
     3493//"ALTER TABLE recordedprogram DROP column closecaptioned;" deprecated
     3494//"ALTER TABLE recordedprogram DROP column subtitled;" deprecated
     3495
    34653496    return true;
    34663497}
    34673498
  • libs/libmythtv/datadirect.cpp

     
    2222#include "mythcontext.h"
    2323#include "mythdbcon.h"
    2424#include "util.h"
     25#include "programinfo.h"
    2526
    2627#define SHOW_WGET_OUTPUT 0
    2728
     
    804805    if (!query.exec("INSERT IGNORE INTO program (chanid, starttime, endtime, "
    805806                    "title, subtitle, description, "
    806807                    "showtype, category, category_type, "
    807                     "airdate, stars, previouslyshown, stereo, subtitled, "
     808                    "airdate, stars, previouslyshown, audioprop, "
     809                    "subtitletypes, videoprop, stereo, subtitled, "
    808810                    "hdtv, closecaptioned, partnumber, parttotal, seriesid, "
    809811                    "originalairdate, colorcode, syndicatedepisodenumber, "
    810812                    "programid) "
     
    813815                    "DATE_ADD(endtime, INTERVAL channel.tmoffset MINUTE), "
    814816                    "title, subtitle, description, "
    815817                    "showtype, dd_genre.class, category_type, "
    816                     "airdate, stars, previouslyshown, stereo, subtitled, "
     818                    "airdate, stars, previouslyshown, stereo, "
     819                    "(subtitled << 1 ) | closecaptioned, hdtv, "
     820                    "stereo, subtitled, "
    817821                    "hdtv, closecaptioned, partnumber, parttotal, seriesid, "
    818822                    "originalairdate, colorcode, syndicatedepisodenumber, "
    819823                    "dd_v_program.programid FROM (dd_v_program, channel) "
  • libs/libmythtv/programdata.cpp

     
    240240                              "stars >= (:STARS - 0.001) AND stars <= (:STARS + 0.001) AND "
    241241                              "previouslyshown=:PREVIOUSLYSHOWN AND "
    242242                              "title_pronounce=:TITLE_PRONOUNCE AND "
    243                               "stereo=:STEREO AND "
    244                               "hdtv=:HDTV AND "
    245                               "closecaptioned=:CLOSECAPTIONED AND "
     243                              "audioprop=:AUDIOPROP AND "
     244                              "videoprop=:VIDEOPROP AND "
     245                              "subtitletypes=:SUBTYPES AND "
    246246                              "partnumber=:PARTNUMBER AND "
    247247                              "parttotal=:PARTTOTAL AND "
    248248                              "seriesid=:SERIESID AND "
     
    262262                query.bindValue(":STARS", (*i).stars.utf8());
    263263                query.bindValue(":PREVIOUSLYSHOWN", (*i).previouslyshown);
    264264                query.bindValue(":TITLE_PRONOUNCE", (*i).title_pronounce.utf8());
    265                 query.bindValue(":STEREO", (*i).audioproperties);
    266                 query.bindValue(":HDTV", (*i).videoproperties);
    267                 query.bindValue(":CLOSECAPTIONED", (*i).subtitletype);
     265                query.bindValue(":AUDIOPROP", (*i).audioproperties);
     266                query.bindValue(":VIDEOPROP", (*i).videoproperties);
     267                query.bindValue(":SUBTYPES", (*i).subtitletype);
    268268                query.bindValue(":PARTNUMBER", (*i).partnumber);
    269269                query.bindValue(":PARTTOTAL", (*i).parttotal);
    270270                query.bindValue(":SERIESID", (*i).seriesid);
     
    341341                              "title,subtitle,description,category,"
    342342                              "category_type,airdate,stars,previouslyshown,"
    343343                              "title_pronounce,stereo,hdtv,"
     344                              "audioprop,videoprop,subtitled,subtitletypes,"
    344345                              "closecaptioned,partnumber,parttotal,"
    345346                              "seriesid,originalairdate,showtype,colorcode,"
    346347                              "syndicatedepisodenumber,programid) "
     
    348349                              ":SUBTITLE,:DESCRIPTION,:CATEGORY,:CATEGORY_TYPE,"
    349350                              ":AIRDATE,:STARS,:PREVIOUSLYSHOWN,"
    350351                              ":TITLE_PRONOUNCE,:STEREO,:HDTV,"
     352                              ":AUDIOPROP,:VIDEOPROP,:SUBTYPES,:SUBTITLED,"
    351353                              ":CLOSECAPTIONED,:PARTNUMBER,:PARTTOTAL,"
    352354                              ":SERIESID,:ORIGINALAIRDATE,:SHOWTYPE,:COLORCODE,"
    353355                              ":SYNDICATEDEPISODENUMBER,:PROGRAMID);");
     
    363365                query.bindValue(":STARS", (*i).stars.utf8());
    364366                query.bindValue(":PREVIOUSLYSHOWN", (*i).previouslyshown);
    365367                query.bindValue(":TITLE_PRONOUNCE", (*i).title_pronounce.utf8());
    366                 query.bindValue(":STEREO", (*i).audioproperties);
    367                 query.bindValue(":HDTV", (*i).videoproperties);
    368                 query.bindValue(":CLOSECAPTIONED", (*i).subtitletype);
     368                query.bindValue(":AUDIOPROP", (*i).audioproperties);
     369                query.bindValue(":VIDEOPROP", (*i).videoproperties);
     370                query.bindValue(":SUBTYPES", (*i).subtitletype);
     371                query.bindValue(":HDTV", (*i).videoproperties & VID_HDTV ? true : false);
     372                query.bindValue(":STEREO", (*i).audioproperties & AUD_STEREO ? true : false);
     373                query.bindValue(":SUBTITLED", (*i).subtitletype & SUB_NORMAL ? true : false);
     374                query.bindValue(":CLOSECAPTIONED", (*i).subtitletype & SUB_HARDHEAR ? true : false);
    369375                query.bindValue(":PARTNUMBER", (*i).partnumber);
    370376                query.bindValue(":PARTTOTAL", (*i).parttotal);
    371377                query.bindValue(":SERIESID", (*i).seriesid);
  • libs/libmythtv/programinfo.cpp

     
    35423542            ptable = "recordedprogram";
    35433543
    35443544        query.prepare(QString("SELECT category_type, airdate, stars,"
    3545                       " partnumber, parttotal, stereo, hdtv,"
    3546                       " closecaptioned, syndicatedepisodenumber, generic,"
     3545                      " partnumber, parttotal, audioprop, videoprop,"
     3546                      " subtitletypes, syndicatedepisodenumber, generic,"
    35473547                      " showtype, colorcode, title_pronounce"
    35483548                      " FROM %1 WHERE chanid = :CHANID AND"
    35493549                      " starttime = :STARTTIME ;").arg(ptable));
     
    40034003
    40044004    MSqlQuery query(MSqlQuery::InitCon());
    40054005
    4006     query.prepare("SELECT stereo, hdtv, closecaptioned "
     4006    query.prepare("SELECT audioprop, videoprop, subtitletypes "
    40074007                  "FROM recorded LEFT JOIN recordedprogram ON "
    40084008                  "(recorded.chanid = recordedprogram.chanid AND "
    40094009                  "recorded.progstart = recordedprogram.starttime) "
     
    47934793        "recorded.originalairdate, recorded.playgroup, "
    47944794        "recorded.basename, recorded.progstart, "
    47954795        "recorded.progend, recorded.stars, "
    4796         "recordedprogram.stereo, recordedprogram.hdtv, "
    4797         "recordedprogram.closecaptioned, recorded.watched, "
     4796        "recordedprogram.audioprop, recordedprogram.videoprop, "
     4797        "recordedprogram.subtitletypes, recorded.watched, "
    47984798        "recorded.storagegroup "
    47994799        "FROM recorded "
    48004800        "LEFT JOIN record ON recorded.recordid = record.recordid "
  • programs/mythbackend/mainserver.cpp

     
    11251125        "recorded.originalairdate, recorded.playgroup, "
    11261126        "recorded.basename, recorded.progstart, "
    11271127        "recorded.progend, recorded.stars, "
    1128         "recordedprogram.stereo, recordedprogram.hdtv, "
    1129         "recordedprogram.closecaptioned, transcoded, "
     1128        "recordedprogram.audioprop, recordedprogram.videoprop, "
     1129        "recordedprogram.subtitletypes, transcoded, "
    11301130        "recorded.recpriority, watched, recorded.preserve, "
    11311131        "recorded.storagegroup "
    11321132        "FROM recorded "
  • programs/mythbackend/scheduler.cpp

     
    25362536        "(cardinput.cardinputid = RECTABLE.prefinput) * %1").arg(prefinputpri);
    25372537
    25382538    if (hdtvpriority)
    2539         pwrpri += QString(" + (program.hdtv & %1) * %2").arg(VID_HDTV)
    2540             .arg(hdtvpriority);
     2539        pwrpri += QString(" + (program.hdtv > 0) * %1").arg(hdtvpriority);
    25412540
    25422541    QString schedTmpRecord = recordTable;
    25432542
     
    27432742"program.airdate, program.stars, program.originalairdate, RECTABLE.inactive, "
    27442743"RECTABLE.parentid, ") + progfindid + ", RECTABLE.playgroup, "
    27452744"oldrecstatus.recstatus, oldrecstatus.reactivate, "
    2746 "program.hdtv, program.closecaptioned, program.stereo, "
     2745"program.videoprop, program.subtitletypes, program.audioprop, "
    27472746"RECTABLE.storagegroup, capturecard.hostname, recordmatch.oldrecstatus, " +
    27482747    pwrpri + QString(
    27492748"FROM recordmatch "