Ticket #2461: filldatabase.patch

File filldatabase.patch, 6.6 KB (added by paulx@…, 18 years ago)

Description of the file (optional)

  • programs/mythfilldatabase/filldata.cpp

    old new void fixProgramList(QValueList<ProgInfo> 
    18081808
    18091809            if (!quiet)
    18101810            {
    1811                 cerr << "removing conflicting program: "
    1812                      << (*todelete).channel << " "
    1813                      << (*todelete).title.local8Bit() << " "
    1814                      << (*todelete).startts << "-" << (*todelete).endts << endl;
     1811                cerr << "ignoring conflicting program: "
     1812                     << (*todelete).start.toString(Qt::ISODate) << "-"
     1813                     << (*todelete).end.toString(Qt::ISODate) << " "
     1814                     << (*todelete).channel.local8Bit() << " "
     1815                     << (*todelete).title.local8Bit() << endl;
     1816
    18151817                cerr << "conflicted with             : "
    1816                      << (*tokeep).channel << " "
    1817                      << (*tokeep).title.local8Bit() << " "
    1818                      << (*tokeep).startts << "-" <<   (*tokeep).endts << endl;
    1819                 cerr << endl;
     1818                     << (*tokeep).start.toString(Qt::ISODate) << "-"
     1819                     << (*tokeep).end.toString(Qt::ISODate) << " "
     1820                     << (*tokeep).channel.local8Bit() << " "
     1821                     << (*tokeep).title.local8Bit() << "\n" << endl;
    18201822            }
    18211823
    18221824            if (todelete == i)
    void handlePrograms(int id, QMap<QString 
    22592261                              "subtitle=:SUBTITLE AND description=:DESC AND "
    22602262                              "category=:CATEGORY AND "
    22612263                              "category_type=:CATEGORY_TYPE AND "
    2262                               "airdate=:AIRDATE AND stars=:STARS AND "
     2264                              "airdate=:AIRDATE AND "
     2265                              "stars >= (:STARS - 0.001) AND stars <= (:STARS + 0.001) AND "
    22632266                              "previouslyshown=:PREVIOUSLYSHOWN AND "
    22642267                              "title_pronounce=:TITLE_PRONOUNCE AND "
    22652268                              "stereo=:STEREO AND subtitled=:SUBTITLED AND "
    void handlePrograms(int id, QMap<QString 
    22682271                              "partnumber=:PARTNUMBER AND "
    22692272                              "parttotal=:PARTTOTAL AND "
    22702273                              "seriesid=:SERIESID AND "
     2274                              "( (:ORIGINALAIRDATE is null AND originalairdate is null) OR "
     2275                              "originalairdate=:ORIGINALAIRDATE ) AND "
    22712276                              "showtype=:SHOWTYPE AND "
    22722277                              "colorcode=:COLORCODE AND "
    22732278                              "syndicatedepisodenumber=:SYNDICATEDEPISODENUMBER AND "
    void handlePrograms(int id, QMap<QString 
    22902295                query.bindValue(":CLOSECAPTIONED", (*i).closecaptioned);
    22912296                query.bindValue(":PARTNUMBER", (*i).partnumber);
    22922297                query.bindValue(":PARTTOTAL", (*i).parttotal);
    2293                 query.bindValue(":SERIESID", (*i).seriesid);
    2294                 query.bindValue(":SHOWTYPE", (*i).showtype);
    2295                 query.bindValue(":COLORCODE", (*i).colorcode);
    2296                 query.bindValue(":SYNDICATEDEPISODENUMBER", (*i).syndicatedepisodenumber);
    2297                 query.bindValue(":PROGRAMID", (*i).programid);
     2298                query.bindValue(":SERIESID", (*i).seriesid.utf8());
     2299                query.bindValue(":ORIGINALAIRDATE", (*i).originalairdate);
     2300                query.bindValue(":SHOWTYPE", (*i).showtype.utf8());
     2301                query.bindValue(":COLORCODE", (*i).colorcode.utf8());
     2302                query.bindValue(":SYNDICATEDEPISODENUMBER", (*i).syndicatedepisodenumber.utf8());
     2303                query.bindValue(":PROGRAMID", (*i).programid.utf8());
    22982304                query.exec();
    22992305
    23002306                if (query.isActive() && query.size() > 0)
    void handlePrograms(int id, QMap<QString 
    23182324                        while (query.next())
    23192325                        {
    23202326                            cerr << "removing existing program: "
    2321                                  << (*i).channel.local8Bit() << " "
    2322                                  << QString::fromUtf8(query.value(0).toString()).local8Bit() << " "
    23232327                                 << query.value(1).toDateTime().toString(Qt::ISODate) << " - "
    2324                                  << query.value(2).toDateTime().toString(Qt::ISODate) << endl;
     2328                                 << query.value(2).toDateTime().toString(Qt::ISODate) << " "
     2329                                 << (*i).channel.local8Bit() << " "
     2330                                 << QString::fromUtf8(query.value(0).toString()).local8Bit() << endl;
    23252331                        }
    23262332
    23272333                        cerr << "inserting new program    : "
     2334                             << (*i).start.toString(Qt::ISODate) << " - "
     2335                             << (*i).end.toString(Qt::ISODate) << " "
    23282336                             << (*i).channel.local8Bit() << " "
    2329                              << (*i).title.local8Bit() << " "
    2330                              << (*i).start.toString() << " - "
    2331                              << (*i).end.toString() << endl << endl;
     2337                             << (*i).title.local8Bit() << "\n" << endl;
    23322338                    }
    23332339
    23342340                    MSqlQuery subquery(MSqlQuery::InitCon());
    void handlePrograms(int id, QMap<QString 
    23922398                query.bindValue(":CLOSECAPTIONED", (*i).closecaptioned);
    23932399                query.bindValue(":PARTNUMBER", (*i).partnumber);
    23942400                query.bindValue(":PARTTOTAL", (*i).parttotal);
    2395                 query.bindValue(":SERIESID", (*i).seriesid);
     2401                query.bindValue(":SERIESID", (*i).seriesid.utf8());
    23962402                query.bindValue(":ORIGINALAIRDATE", (*i).originalairdate);
    2397                 query.bindValue(":SHOWTYPE", (*i).showtype);
    2398                 query.bindValue(":COLORCODE", (*i).colorcode);
    2399                 query.bindValue(":SYNDICATEDEPISODENUMBER", (*i).syndicatedepisodenumber);
    2400                 query.bindValue(":PROGRAMID", (*i).programid);
     2403                query.bindValue(":SHOWTYPE", (*i).showtype.utf8());
     2404                query.bindValue(":COLORCODE", (*i).colorcode.utf8());
     2405                query.bindValue(":SYNDICATEDEPISODENUMBER", (*i).syndicatedepisodenumber.utf8());
     2406                query.bindValue(":PROGRAMID", (*i).programid.utf8());
    24012407                if (!query.exec())
    24022408                    MythContext::DBError("program insert", query);
    24032409