Ticket #2992: 2992_fix.diff
File 2992_fix.diff, 4.5 KB (added by , 17 years ago) |
---|
-
mythtv/programs/mythfilldatabase/filldata.cpp
382 382 int total_sources = sourcelist.size(); 383 383 int source_channels = 0; 384 384 385 query.exec(QString("SELECT MAX(endtime) FROM program WHERE manualid=0;"));386 if (query.isActive() && query.size() > 0)387 {388 query.next();389 390 if (!query.isNull(0))391 GuideDataBefore = QDateTime::fromString(query.value(0).toString(),392 Qt::ISODate);393 }394 395 385 QString sidStr = QString("Updating source #%1 (%2) with grabber %3"); 396 386 397 387 need_post_grab_proc = false; 388 int nonewdata = 0; 398 389 399 390 for (it = sourcelist.begin(); it != sourcelist.end(); ++it) 400 391 { 392 393 query.prepare("SELECT MAX(endtime) FROM program p LEFT JOIN channel c ON p.chanid=c.chanid WHERE c.sourceid= :SRCID AND manualid = 0;"); 394 query.bindValue(":SRCID", (*it).id); 395 query.exec(); 396 if (query.isActive() && query.size() > 0) 397 { 398 query.next(); 399 400 if (!query.isNull(0)) 401 GuideDataBefore = QDateTime::fromString(query.value(0).toString(), 402 Qt::ISODate); 403 } 404 401 405 channel_update_run = false; 402 406 endofdata = false; 403 407 … … 818 822 { 819 823 break; 820 824 } 825 826 query.prepare("SELECT MAX(endtime) FROM program p LEFT JOIN channel c ON p.chanid=c.chanid WHERE c.sourceid= :SRCID AND manualid = 0;"); 827 query.bindValue(":SRCID", (*it).id); 828 query.exec(); 829 if (query.isActive() && query.size() > 0) 830 { 831 query.next(); 832 833 if (!query.isNull(0)) 834 GuideDataAfter = QDateTime::fromString(query.value(0).toString(), 835 Qt::ISODate); 836 } 837 838 if (GuideDataAfter == GuideDataBefore) 839 { 840 nonewdata++; 841 } 821 842 } 822 843 823 844 if (only_update_channels && !need_post_grab_proc) 824 845 return true; 825 846 826 query.exec(QString("SELECT MAX(endtime) FROM program WHERE manualid=0;"));827 if (query.isActive() && query.size() > 0)828 {829 query.next();830 831 if (!query.isNull(0))832 GuideDataAfter = QDateTime::fromString(query.value(0).toString(),833 Qt::ISODate);834 }835 836 847 if (failures == 0) 837 848 { 838 if ( (GuideDataAfter == GuideDataBefore)&&849 if (nonewdata > 0 && 839 850 (total_sources != externally_handled)) 840 status = "mythfilldatabase ran, but did not insert "841 "any new data into the Guide . This can indicate a "842 "potential grabber failure." ;851 status = QString("mythfilldatabase ran, but did not insert " 852 "any new data into the Guide for %1 of %2 sources. This can indicate a " 853 "potential grabber failure.").arg(nonewdata).arg(total_sources); 843 854 else 844 855 status = "Successful."; 845 856 -
mythtv/programs/mythfilldatabase/main.cpp
482 482 "WHERE value='mythfilldatabaseLastRunStatus'") 483 483 .arg(status)); 484 484 485 query.exec("SELECT MAX(endtime) FROM program WHERE manualid = 0;"); 485 query.prepare("SELECT MAX(endtime) FROM program p LEFT JOIN channel c ON p.chanid=c.chanid WHERE c.sourceid= :SRCID AND manualid = 0;"); 486 query.bindValue(":SRCID", fromfile_id); 487 query.exec(); 486 488 if (query.isActive() && query.size() > 0) 487 489 { 488 490 query.next(); … … 501 503 "WHERE value='mythfilldatabaseLastRunEnd'") 502 504 .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm"))); 503 505 504 query.exec("SELECT MAX(endtime) FROM program WHERE manualid = 0;"); 506 query.prepare("SELECT MAX(endtime) FROM program p LEFT JOIN channel c ON p.chanid=c.chanid WHERE c.sourceid= :SRCID AND manualid = 0;"); 507 query.bindValue(":SRCID", fromfile_id); 508 query.exec(); 505 509 if (query.isActive() && query.size() > 0) 506 510 { 507 511 query.next();