Ticket #3842: 3842-remove-new-handling-fixes-v1.patch
| File 3842-remove-new-handling-fixes-v1.patch, 4.3 KB (added by , 18 years ago) |
|---|
-
libs/libmythtv/datadirect.h
215 215 { 216 216 public: 217 217 DDStructureParser(DataDirectProcessor& _ddparent) : 218 parent(_ddparent) , saw_repeat(false), saw_new(false){}218 parent(_ddparent) {} 219 219 220 220 bool startElement(const QString &pnamespaceuri, const QString &plocalname, 221 221 const QString &pqname, const QXmlAttributes &pxmlatts); … … 240 240 DataDirectProductionCrew curr_productioncrew; 241 241 DataDirectGenre curr_genre; 242 242 QString lastprogramid; 243 bool saw_repeat;244 bool saw_new;245 243 }; 246 244 247 245 -
libs/libmythtv/datadirect.cpp
168 168 curr_schedule.duration = QTime(durstr.mid(2, 2).toInt(), 169 169 durstr.mid(5, 2).toInt(), 0, 0); 170 170 171 QString isrepeat = pxmlatts.value("repeat"); 172 curr_schedule.repeat = (isrepeat == "true"); 173 saw_repeat |= !isrepeat.isEmpty(); 174 175 QString isnew = pxmlatts.value("new"); 176 curr_schedule.isnew = (isnew == "true"); 177 saw_new |= !isnew.isEmpty(); 178 171 curr_schedule.repeat = (pxmlatts.value("repeat") == "true"); 172 curr_schedule.isnew = (pxmlatts.value("new") == "true"); 179 173 curr_schedule.stereo = (pxmlatts.value("stereo") == "true"); 180 174 curr_schedule.subtitled = (pxmlatts.value("subtitled") == "true"); 181 175 curr_schedule.hdtv = (pxmlatts.value("hdtv") == "true"); … … 420 414 421 415 bool DDStructureParser::endDocument() 422 416 { 423 MSqlQuery query(MSqlQuery::DDCon());424 query.prepare(425 "INSERT INTO dd_state (sawrepeat, sawnew) "426 "VALUES (:SAWREPEAT, :SAWNEW)");427 query.bindValue(":SAWREPEAT", saw_repeat);428 query.bindValue(":SAWNEW", saw_new);429 430 if (!query.exec())431 MythContext::DBError("Inserting into dd_state", query);432 433 417 return true; 434 418 } 435 419 … … 617 601 { 618 602 MSqlQuery query(MSqlQuery::DDCon()); 619 603 620 query.prepare(621 "SELECT sawrepeat, sawnew "622 "FROM dd_state");623 624 if (!query.exec())625 {626 MythContext::DBError("Querying into dd_state", query);627 return;628 }629 630 if (!query.next())631 {632 VERBOSE(VB_IMPORTANT, LOC_ERR + "UpdateProgramViewTable no dd_state!");633 return;634 }635 636 bool saw_repeat = query.value(0).toUInt(); (void) saw_repeat;637 bool saw_new = query.value(1).toUInt(); (void) saw_new;638 639 // VERBOSE(VB_GENERAL, LOC + QString("Saw new: %1, saw repeat: %2")640 // .arg(saw_new).arg(saw_repeat));641 642 604 if (!query.exec("TRUNCATE TABLE dd_v_program;")) 643 605 MythContext::DBError("Truncating temporary table dd_v_program", query); 644 606 … … 654 616 " tvrating, mpaarating, programid ) " 655 617 "SELECT chanid, scheduletime, endtime, " 656 618 " title, subtitle, description, " 657 " year, stars, %1,"619 " year, stars, isrepeat, " 658 620 " stereo, subtitled, hdtv, " 659 621 " closecaptioned, partnumber, parttotal, " 660 622 " seriesid, originalairdate, showtype, " … … 665 627 " (channel.xmltvid = dd_schedule.stationid) AND " 666 628 " (channel.sourceid = :SOURCEID))"; 667 629 668 QString repeat = (saw_new) ? 669 "(not isnew) AND " 670 "(SUBSTRING(dd_program.programid,1,2) IN ('EP', 'SH'))" : 671 "isrepeat"; 630 query.prepare(qstr); 672 631 673 query.prepare(qstr.arg(repeat));674 675 632 query.bindValue(":SOURCEID", sourceid); 676 633 677 634 if (!query.exec()) … … 1244 1201 { 1245 1202 QMap<QString,QString> dd_tables; 1246 1203 1247 dd_tables["dd_state"] =1248 "( sawrepeat bool, sawnew bool )";1249 1250 1204 dd_tables["dd_station"] = 1251 1205 "( stationid char(12), callsign char(10), " 1252 1206 " stationname varchar(40), affiliate varchar(25), "
