Ticket #2461: filldatabase.patch
File filldatabase.patch, 6.6 KB (added by , 18 years ago) |
---|
-
programs/mythfilldatabase/filldata.cpp
old new void fixProgramList(QValueList<ProgInfo> 1808 1808 1809 1809 if (!quiet) 1810 1810 { 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 1815 1817 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; 1820 1822 } 1821 1823 1822 1824 if (todelete == i) … … void handlePrograms(int id, QMap<QString 2259 2261 "subtitle=:SUBTITLE AND description=:DESC AND " 2260 2262 "category=:CATEGORY AND " 2261 2263 "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 " 2263 2266 "previouslyshown=:PREVIOUSLYSHOWN AND " 2264 2267 "title_pronounce=:TITLE_PRONOUNCE AND " 2265 2268 "stereo=:STEREO AND subtitled=:SUBTITLED AND " … … void handlePrograms(int id, QMap<QString 2268 2271 "partnumber=:PARTNUMBER AND " 2269 2272 "parttotal=:PARTTOTAL AND " 2270 2273 "seriesid=:SERIESID AND " 2274 "( (:ORIGINALAIRDATE is null AND originalairdate is null) OR " 2275 "originalairdate=:ORIGINALAIRDATE ) AND " 2271 2276 "showtype=:SHOWTYPE AND " 2272 2277 "colorcode=:COLORCODE AND " 2273 2278 "syndicatedepisodenumber=:SYNDICATEDEPISODENUMBER AND " … … void handlePrograms(int id, QMap<QString 2290 2295 query.bindValue(":CLOSECAPTIONED", (*i).closecaptioned); 2291 2296 query.bindValue(":PARTNUMBER", (*i).partnumber); 2292 2297 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()); 2298 2304 query.exec(); 2299 2305 2300 2306 if (query.isActive() && query.size() > 0) … … void handlePrograms(int id, QMap<QString 2318 2324 while (query.next()) 2319 2325 { 2320 2326 cerr << "removing existing program: " 2321 << (*i).channel.local8Bit() << " "2322 << QString::fromUtf8(query.value(0).toString()).local8Bit() << " "2323 2327 << 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; 2325 2331 } 2326 2332 2327 2333 cerr << "inserting new program : " 2334 << (*i).start.toString(Qt::ISODate) << " - " 2335 << (*i).end.toString(Qt::ISODate) << " " 2328 2336 << (*i).channel.local8Bit() << " " 2329 << (*i).title.local8Bit() << " " 2330 << (*i).start.toString() << " - " 2331 << (*i).end.toString() << endl << endl; 2337 << (*i).title.local8Bit() << "\n" << endl; 2332 2338 } 2333 2339 2334 2340 MSqlQuery subquery(MSqlQuery::InitCon()); … … void handlePrograms(int id, QMap<QString 2392 2398 query.bindValue(":CLOSECAPTIONED", (*i).closecaptioned); 2393 2399 query.bindValue(":PARTNUMBER", (*i).partnumber); 2394 2400 query.bindValue(":PARTTOTAL", (*i).parttotal); 2395 query.bindValue(":SERIESID", (*i).seriesid );2401 query.bindValue(":SERIESID", (*i).seriesid.utf8()); 2396 2402 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()); 2401 2407 if (!query.exec()) 2402 2408 MythContext::DBError("program insert", query); 2403 2409