Ticket #10023: speeduptimequery.patch

File speeduptimequery.patch, 2.9 KB (added by Justin Hornsby, 12 years ago)

The new query was fine but results were being incorrectly assigned - this patch should fix that

  • mythtv/libs/libmyth/programinfo.cpp

    diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
    index 2a253d2..94780a3 100644
    a b static bool FromProgramQuery( 
    40074007    const QString &sql, const MSqlBindings &bindings, MSqlQuery &query)
    40084008{
    40094009    QString querystr = QString(
     4010"select program.description, sub.* from program, ("
    40104011        "SELECT DISTINCT program.chanid, program.starttime, program.endtime, "
    4011         "    program.title, program.subtitle, program.description, "
     4012        "    program.title, program.subtitle, "
    40124013        "    program.category, channel.channum, channel.callsign, "
    40134014        "    channel.name, program.previouslyshown, channel.commmethod, "
    40144015        "    channel.outputfilters, program.seriesid, program.programid, "
    static bool FromProgramQuery( 
    40404041    if (!sql.contains(" LIMIT "))
    40414042        querystr += " LIMIT 20000 ";
    40424043
     4044     querystr += " ) as sub where program.chanid=sub.chanid and program.starttime=sub.starttime";
    40434045    query.prepare(querystr);
    40444046    MSqlBindings::const_iterator it;
    40454047    for (it = bindings.begin(); it != bindings.end(); ++it)
    bool LoadFromProgram( 
    40724074    {
    40734075        destination.push_back(
    40744076            new ProgramInfo(
    4075                 query.value(3).toString(), // title
    4076                 query.value(4).toString(), // subtitle
    4077                 query.value(5).toString(), // description
     4077                query.value(4).toString(), // title
     4078                query.value(5).toString(), // subtitle
     4079                query.value(0).toString(), // description
    40784080                query.value(6).toString(), // category
    40794081
    4080                 query.value(0).toUInt(), // chanid
     4082                query.value(1).toUInt(), // chanid
     4083
    40814084                query.value(7).toString(), // channum
    40824085                query.value(8).toString(), // chansign
    40834086                query.value(9).toString(), // channame
    40844087                query.value(12).toString(), // chanplaybackfilters
    40854088
    4086                 query.value(1).toDateTime(), // startts
    4087                 query.value(2).toDateTime(), // endts
    4088                 query.value(1).toDateTime(), // recstartts
    4089                 query.value(2).toDateTime(), // recendts
     4089                query.value(2).toDateTime(), // startts
     4090                query.value(3).toDateTime(), // endts
     4091                query.value(2).toDateTime(), // recstartts
     4092                query.value(3).toDateTime(), // recendts
     4093
    40904094
    40914095                query.value(13).toString(), // seriesid
    40924096                query.value(14).toString(), // programid
    bool LoadFromProgram( 
    40994103                query.value(19).toUInt(), // recordid
    41004104                RecordingType(query.value(20).toInt()), // rectype
    41014105                query.value(22).toUInt(), // findid
    4102 
    41034106                query.value(11).toInt() == COMM_DETECT_COMMFREE, // commfree
    41044107                query.value(10).toInt(), // repeat
    41054108