Ticket #9381: 9381-1.patch

File 9381-1.patch, 7.7 KB (added by gigem, 8 years ago)
  • mythtv/programs/mythfrontend/progfind.cpp

    diff --git a/mythtv/programs/mythfrontend/progfind.cpp b/mythtv/programs/mythfrontend/progfind.cpp
    index 2bcc94a..960d8dc 100644
    a b void ProgFinder::selectShowData(QString progTitle, int newCurShow) 
    567567
    568568    MSqlBindings bindings;
    569569    QString querystr = "WHERE program.title = :TITLE "
    570                        "  AND program.endtime > :ENDTIME ";
     570                       "  AND program.endtime > :ENDTIME "
     571                       "  AND channel.visible = 1 ";
    571572    bindings[":TITLE"] = progTitle;
    572573    bindings[":ENDTIME"] = progStart.toString("yyyy-MM-ddThh:mm:50");
    573574
    void ProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindings 
    602603
    603604    if (searchChar.contains('@'))
    604605    {
    605         where = "SELECT DISTINCT title FROM program WHERE ( "
    606                    "title NOT REGEXP '^[A-Z0-9]' AND "
    607                    "title NOT REGEXP '^The [A-Z0-9]' AND "
    608                    "title NOT REGEXP '^A [A-Z0-9]' AND "
    609                    "title NOT REGEXP '^An [A-Z0-9]' AND "
    610                    "starttime > :STARTTIME ) ";
     606        where = "SELECT DISTINCT title FROM program "
     607                "LEFT JOIN channel ON program.chanid = channel.chanid "
     608                "WHERE channel.visible = 1 AND "
     609                "( title NOT REGEXP '^[A-Z0-9]' AND "
     610                "  title NOT REGEXP '^The [A-Z0-9]' AND "
     611                "  title NOT REGEXP '^A [A-Z0-9]' AND "
     612                "  title NOT REGEXP '^An [A-Z0-9]' AND "
     613                "  starttime > :STARTTIME ) ";
    611614        if (!m_searchStr.isEmpty())
    612615        {
    613616            where += "AND title LIKE :SEARCH ";
    void ProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindings 
    625628        QString three = QString("A ") + one;
    626629        QString four = QString("An ") + one;
    627630
    628         where = "SELECT DISTINCT title "
    629                 "FROM program "
    630                 "WHERE ( title LIKE :ONE OR title LIKE :TWO "
    631                 "        OR title LIKE :THREE "
    632                 "        OR title LIKE :FOUR ) "
     631        where = "SELECT DISTINCT title FROM program "
     632                "LEFT JOIN channel ON program.chanid = channel.chanid "
     633                "WHERE channel.visible = 1 "
     634                "AND ( title LIKE :ONE OR title LIKE :TWO "
     635                "      OR title LIKE :THREE "
     636                "      OR title LIKE :FOUR ) "
    633637                "AND starttime > :STARTTIME ";
    634638        if (!m_searchStr.isEmpty())
    635639            where += "AND title LIKE :SEARCH ";
    void JaProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindin 
    782786    QDateTime progStart = QDateTime::currentDateTime();
    783787    int charNum = m_alphabetList->GetCurrentPos();
    784788
    785     where = "SELECT DISTINCT title FROM program ";
     789    where = "SELECT DISTINCT title FROM program "
     790            "LEFT JOIN channel ON program.chanid = channel.chanid "
     791            "WHERE channel.visible = 1 ";
    786792
    787793    switch (charNum) {
    788794    case 0:
    789         where += "WHERE ( title_pronounce >= 'あ' AND title_pronounce <= 'お') ";
     795        where += "AND ( title_pronounce >= 'あ' AND title_pronounce <= 'お') ";
    790796        break;
    791797    case 1:
    792         where += "WHERE ( title_pronounce >= 'か' AND title_pronounce <= 'ご') ";
     798        where += "AND ( title_pronounce >= 'か' AND title_pronounce <= 'ご') ";
    793799        break;
    794800    case 2:
    795         where += "WHERE ( title_pronounce >= 'さ' AND title_pronounce <= 'そ') ";
     801        where += "AND ( title_pronounce >= 'さ' AND title_pronounce <= 'そ') ";
    796802        break;
    797803    case 3:
    798         where += "WHERE ( title_pronounce >= 'た' AND title_pronounce <= 'ど') ";
     804        where += "AND ( title_pronounce >= 'た' AND title_pronounce <= 'ど') ";
    799805        break;
    800806    case 4:
    801         where += "WHERE ( title_pronounce >= 'な' AND title_pronounce <= 'の') ";
     807        where += "AND ( title_pronounce >= 'な' AND title_pronounce <= 'の') ";
    802808        break;
    803809    case 5:
    804         where += "WHERE ( title_pronounce >= 'は' AND title_pronounce <= 'ぜ') ";
     810        where += "AND ( title_pronounce >= 'は' AND title_pronounce <= 'ぜ') ";
    805811        break;
    806812    case 6:
    807         where += "WHERE ( title_pronounce >= 'た' AND title_pronounce <= 'も') ";
     813        where += "AND ( title_pronounce >= 'た' AND title_pronounce <= 'も') ";
    808814        break;
    809815    case 7:
    810         where += "WHERE ( title_pronounce >= 'や' AND title_pronounce <= 'よ') ";
     816        where += "AND ( title_pronounce >= 'や' AND title_pronounce <= 'よ') ";
    811817        break;
    812818    case 8:
    813         where += "WHERE ( title_pronounce >= 'ら' AND title_pronounce <= 'ろ') ";
     819        where += "AND ( title_pronounce >= 'ら' AND title_pronounce <= 'ろ') ";
    814820        break;
    815821    case 9:
    816         where += "WHERE ( title_pronounce >= 'わ' AND title_pronounce <= 'ん') ";
     822        where += "AND ( title_pronounce >= 'わ' AND title_pronounce <= 'ん') ";
    817823        break;
    818824    case 10:
    819         where += "WHERE ( title_pronounce >= '' AND title_pronounce <= '') ";
     825        where += "AND ( title_pronounce >= '' AND title_pronounce <= '') ";
    820826        break;
    821827    case 11:
    822         where += "WHERE ( title_pronounce >= '' AND title_pronounce <= '') ";
     828        where += "AND ( title_pronounce >= '' AND title_pronounce <= '') ";
    823829        break;
    824830    }
    825831
    void HeProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings &bindin 
    890896    if (searchChar.isEmpty())
    891897        searchChar = searchChars[0];
    892898
    893     where = "SELECT DISTINCT title FROM program ";
     899    where = "SELECT DISTINCT title FROM program "
     900            "LEFT JOIN channel ON program.chanid = channel.chanid "
     901            "WHERE channel.visible = 1 ";
    894902
    895903    if (searchChar.contains('E'))
    896904    {
    897         where += "WHERE ( title REGEXP '^[A-Z]') ";
     905        where += "AND ( title REGEXP '^[A-Z]') ";
    898906    }
    899907    else if (searchChar.contains('#'))
    900908    {
    901         where += "WHERE ( title REGEXP '^[0-9]') ";
     909        where += "AND ( title REGEXP '^[0-9]') ";
    902910    }
    903911    else
    904912    {
    905913        QString one = searchChar + '%';
    906914        bindings[":ONE"] = one;
    907         where += "WHERE ( title LIKE :ONE ) ";
     915        where += "AND ( title LIKE :ONE ) ";
    908916    }
    909917
    910918    where += "AND starttime > :STARTTIME ";
    void RuProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings 
    982990
    983991  if (searchChar.contains('@'))
    984992   {
    985        where = "SELECT DISTINCT title FROM program WHERE ( "
     993       where = "SELECT DISTINCT title FROM program "
     994               "LEFT JOIN channel ON program.chanid = channel.chanid "
     995               "WHERE channel.visible = 1 AND "
     996               "( "
    986997                  "title NOT REGEXP '^[A-Z0-9]' AND "
    987998                  "title NOT REGEXP '^The [A-Z0-9]' AND "
    988999                  "title NOT REGEXP '^A [A-Z0-9]' AND "
    void RuProgFinder::whereClauseGetSearchData(QString &where, MSqlBindings 
    10061017       QString four = QString("An ") + one;
    10071018       QString five = QString("\"") + one;
    10081019
    1009        where = "SELECT DISTINCT title "
    1010                "FROM program "
    1011                "WHERE ( title LIKE :ONE OR title LIKE :TWO "
    1012                "        OR title LIKE :THREE "
    1013                "        OR title LIKE :FOUR  "
    1014                "        OR title LIKE :FIVE )"
     1020       where = "SELECT DISTINCT title FROM program "
     1021               "LEFT JOIN channel ON program.chanid = channel.chanid "
     1022               "WHERE channel.visible = 1 "
     1023               "AND ( title LIKE :ONE OR title LIKE :TWO "
     1024               "      OR title LIKE :THREE "
     1025               "      OR title LIKE :FOUR  "
     1026               "      OR title LIKE :FIVE )"
    10151027               "AND starttime > :STARTTIME ";
    10161028       if (!m_searchStr.isEmpty())
    10171029           where += "AND title LIKE :SEARCH ";