diff --git a/mythtv/libs/libmyth/programinfo.cpp b/mythtv/libs/libmyth/programinfo.cpp
index 8c8991a..4ee9ad1 100644
a
|
b
|
bool ProgramInfo::LoadProgramFromRecorded( |
1589 | 1589 | "WHERE r.chanid = :CHANID AND " |
1590 | 1590 | " r.starttime = :RECSTARTTS"); |
1591 | 1591 | query.bindValue(":CHANID", _chanid); |
1592 | | query.bindValue(":RECSTARTTS", _recstartts); |
| 1592 | query.bindValue(":RECSTARTTS", _recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
1593 | 1593 | |
1594 | 1594 | if (!query.exec()) |
1595 | 1595 | { |
… |
… |
void ProgramInfo::SaveFilesize(uint64_t fsize) |
2067 | 2067 | " starttime = :STARTTIME"); |
2068 | 2068 | query.bindValue(":FILESIZE", (quint64)fsize); |
2069 | 2069 | query.bindValue(":CHANID", chanid); |
2070 | | query.bindValue(":STARTTIME", recstartts); |
| 2070 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
2071 | 2071 | |
2072 | 2072 | if (!query.exec()) |
2073 | 2073 | MythDB::DBError("File size update", query); |
… |
… |
QDateTime ProgramInfo::QueryBookmarkTimeStamp(void) const |
2182 | 2182 | "WHERE chanid = :CHANID AND" |
2183 | 2183 | " starttime = :STARTTIME"); |
2184 | 2184 | query.bindValue(":CHANID", chanid); |
2185 | | query.bindValue(":STARTTIME", recstartts); |
| 2185 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
2186 | 2186 | |
2187 | 2187 | QDateTime ts; |
2188 | 2188 | |
… |
… |
bool ProgramInfo::QueryIsInUse(QStringList &byWho) const |
2422 | 2422 | if (!IsRecording()) |
2423 | 2423 | return false; |
2424 | 2424 | |
2425 | | QDateTime oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60); |
2426 | 2425 | MSqlQuery query(MSqlQuery::InitCon()); |
2427 | 2426 | |
2428 | 2427 | query.prepare("SELECT hostname, recusage FROM inuseprograms " |
2429 | 2428 | " WHERE chanid = :CHANID" |
2430 | 2429 | " AND starttime = :STARTTIME " |
2431 | | " AND lastupdatetime > :ONEHOURAGO ;"); |
| 2430 | " AND lastupdatetime > NOW() - INTERVAL 1 HOUR ;"); |
2432 | 2431 | query.bindValue(":CHANID", chanid); |
2433 | 2432 | query.bindValue(":STARTTIME", recstartts); |
2434 | | query.bindValue(":ONEHOURAGO", oneHourAgo); |
2435 | 2433 | |
2436 | 2434 | byWho.clear(); |
2437 | 2435 | if (query.exec() && query.size() > 0) |
… |
… |
void ProgramInfo::SaveAutoExpire(AutoExpireType autoExpire, bool updateDelete) |
2631 | 2629 | " AND starttime = :STARTTIME ;"); |
2632 | 2630 | query.bindValue(":AUTOEXPIRE", (uint)autoExpire); |
2633 | 2631 | query.bindValue(":CHANID", chanid); |
2634 | | query.bindValue(":STARTTIME", recstartts); |
| 2632 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
2635 | 2633 | |
2636 | 2634 | if (!query.exec()) |
2637 | 2635 | MythDB::DBError("AutoExpire update", query); |
… |
… |
void ProgramInfo::UpdateLastDelete(bool setTime) const |
2664 | 2662 | query.prepare("UPDATE record SET last_delete = :TIME, " |
2665 | 2663 | "avg_delay = (avg_delay * 3 + :DELAY) / 4 " |
2666 | 2664 | "WHERE recordid = :RECORDID"); |
2667 | | query.bindValue(":TIME", timeNow); |
| 2665 | query.bindValue(":TIME", timeNow.toString("yyyy-MM-dd hh:mm:ss")); |
2668 | 2666 | query.bindValue(":DELAY", delay); |
2669 | 2667 | } |
2670 | 2668 | else |
2671 | 2669 | { |
2672 | | query.prepare("UPDATE record SET last_delete = '0000-00-00T00:00:00' " |
| 2670 | query.prepare("UPDATE record SET last_delete = '0000-00-00 00:00:00' " |
2673 | 2671 | "WHERE recordid = :RECORDID"); |
2674 | 2672 | } |
2675 | 2673 | query.bindValue(":RECORDID", recordid); |
… |
… |
void ProgramInfo::SaveMarkupMap( |
2888 | 2886 | " (chanid, starttime, mark, type)" |
2889 | 2887 | " VALUES ( :CHANID , :STARTTIME , :MARK , :TYPE );"); |
2890 | 2888 | query.bindValue(":CHANID", chanid); |
2891 | | query.bindValue(":STARTTIME", recstartts); |
| 2889 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
2892 | 2890 | } |
2893 | 2891 | query.bindValue(":MARK", (quint64)frame); |
2894 | 2892 | query.bindValue(":TYPE", mark_type); |
… |
… |
void ProgramInfo::QueryMarkupMap( |
2962 | 2960 | " type = :TYPE " |
2963 | 2961 | "ORDER BY mark"); |
2964 | 2962 | query.bindValue(":CHANID", chanid); |
2965 | | query.bindValue(":STARTTIME", recstartts); |
| 2963 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
2966 | 2964 | query.bindValue(":TYPE", type); |
2967 | 2965 | |
2968 | 2966 | if (!query.exec()) |
… |
… |
void ProgramInfo::SaveAspect( |
3288 | 3286 | " VALUES" |
3289 | 3287 | " ( :CHANID, :STARTTIME, :MARK, :TYPE, :DATA);"); |
3290 | 3288 | query.bindValue(":CHANID", chanid); |
3291 | | query.bindValue(":STARTTIME", recstartts); |
| 3289 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
3292 | 3290 | |
3293 | 3291 | query.bindValue(":MARK", (quint64)frame); |
3294 | 3292 | query.bindValue(":TYPE", type); |
… |
… |
void ProgramInfo::SaveFrameRate(uint64_t frame, uint framerate) |
3317 | 3315 | " VALUES" |
3318 | 3316 | " ( :CHANID, :STARTTIME, :MARK, :TYPE, :DATA);"); |
3319 | 3317 | query.bindValue(":CHANID", chanid); |
3320 | | query.bindValue(":STARTTIME", recstartts); |
| 3318 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
3321 | 3319 | query.bindValue(":MARK", (quint64)frame); |
3322 | 3320 | query.bindValue(":TYPE", MARK_VIDEO_RATE); |
3323 | 3321 | query.bindValue(":DATA", framerate); |
… |
… |
void ProgramInfo::SaveTotalDuration(int64_t duration) |
3351 | 3349 | " VALUES" |
3352 | 3350 | " ( :CHANID, :STARTTIME, 0, :TYPE, :DATA);"); |
3353 | 3351 | query.bindValue(":CHANID", chanid); |
3354 | | query.bindValue(":STARTTIME", recstartts); |
| 3352 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
3355 | 3353 | query.bindValue(":TYPE", MARK_DURATION_MS); |
3356 | 3354 | query.bindValue(":DATA", (uint)(duration / 1000)); |
3357 | 3355 | |
… |
… |
void ProgramInfo::SaveResolution(uint64_t frame, uint width, uint height) |
3375 | 3373 | " VALUES" |
3376 | 3374 | " ( :CHANID, :STARTTIME, :MARK, :TYPE, :DATA);"); |
3377 | 3375 | query.bindValue(":CHANID", chanid); |
3378 | | query.bindValue(":STARTTIME", recstartts); |
| 3376 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
3379 | 3377 | query.bindValue(":MARK", (quint64)frame); |
3380 | 3378 | query.bindValue(":TYPE", MARK_VIDEO_WIDTH); |
3381 | 3379 | query.bindValue(":DATA", width); |
… |
… |
void ProgramInfo::SaveResolution(uint64_t frame, uint width, uint height) |
3388 | 3386 | " VALUES" |
3389 | 3387 | " ( :CHANID, :STARTTIME, :MARK, :TYPE, :DATA);"); |
3390 | 3388 | query.bindValue(":CHANID", chanid); |
3391 | | query.bindValue(":STARTTIME", recstartts); |
| 3389 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
3392 | 3390 | query.bindValue(":MARK", (quint64)frame); |
3393 | 3391 | query.bindValue(":TYPE", MARK_VIDEO_HEIGHT); |
3394 | 3392 | query.bindValue(":DATA", height); |
… |
… |
void ProgramInfo::MarkAsInUse(bool inuse, QString usedFor) |
3822 | 3820 | return; |
3823 | 3821 | |
3824 | 3822 | // Let others know we changed status |
3825 | | QDateTime oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60); |
3826 | 3823 | query.prepare("SELECT DISTINCT recusage " |
3827 | 3824 | "FROM inuseprograms " |
3828 | | "WHERE lastupdatetime >= :ONEHOURAGO AND " |
| 3825 | "WHERE lastupdatetime >= NOW() - INTERVAL 1 HOUR AND " |
3829 | 3826 | " chanid = :CHANID AND " |
3830 | 3827 | " starttime = :STARTTIME"); |
3831 | 3828 | query.bindValue(":CHANID", chanid); |
3832 | 3829 | query.bindValue(":STARTTIME", recstartts); |
3833 | | query.bindValue(":ONEHOURAGO", oneHourAgo); |
3834 | 3830 | if (!query.exec()) |
3835 | 3831 | return; // not safe to send update event... |
3836 | 3832 | |
… |
… |
void ProgramInfo::SubstituteMatches(QString &str) |
4017 | 4013 | QMap<QString,uint32_t> ProgramInfo::QueryInUseMap(void) |
4018 | 4014 | { |
4019 | 4015 | QMap<QString, uint32_t> inUseMap; |
4020 | | QDateTime oneHourAgo = QDateTime::currentDateTime().addSecs(-61 * 60); |
4021 | 4016 | |
4022 | 4017 | MSqlQuery query(MSqlQuery::InitCon()); |
4023 | 4018 | |
4024 | 4019 | query.prepare("SELECT DISTINCT chanid, starttime, recusage " |
4025 | | "FROM inuseprograms WHERE lastupdatetime >= :ONEHOURAGO"); |
4026 | | query.bindValue(":ONEHOURAGO", oneHourAgo); |
| 4020 | "FROM inuseprograms WHERE lastupdatetime >= NOW() - INTERVAL 1 HOUR"); |
4027 | 4021 | |
4028 | 4022 | if (!query.exec()) |
4029 | 4023 | return inUseMap; |
diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp
index fa43d1a..f21ec29 100644
a
|
b
|
NULL |
2019 | 2019 | "UPDATE settings SET value = 'MythFillGrabberSuggestsTime' " |
2020 | 2020 | "WHERE value = 'HonorGrabberNextSuggestedMythfilldatabaseRunTime';", |
2021 | 2021 | "UPDATE settings SET value = 'MythFillSuggestedRunTime', " |
2022 | | " data = '1970-01-01T00:00:00' " |
| 2022 | " data = '1970-01-01 00:00:00' " |
2023 | 2023 | "WHERE value = 'NextSuggestedMythfilldatabaseRun';", |
2024 | 2024 | NULL |
2025 | 2025 | }; |
diff --git a/mythtv/libs/libmythtv/jobqueue.cpp b/mythtv/libs/libmythtv/jobqueue.cpp
index e12a245..a984bdc 100644
a
|
b
|
enum JobStatus JobQueue::GetJobStatus( |
1501 | 1501 | |
1502 | 1502 | query.bindValue(":TYPE", jobType); |
1503 | 1503 | query.bindValue(":CHANID", chanid); |
1504 | | query.bindValue(":STARTTIME", recstartts); |
| 1504 | query.bindValue(":STARTTIME", recstartts.toString("yyyy-MM-dd hh:mm:ss")); |
1505 | 1505 | |
1506 | 1506 | if (query.exec()) |
1507 | 1507 | { |
diff --git a/mythtv/libs/libmythtv/recordinginfo.cpp b/mythtv/libs/libmythtv/recordinginfo.cpp
index da235dd..08bdb7e 100644
a
|
b
|
void RecordingInfo::AddHistory(bool resched, bool forcedup) |
1141 | 1141 | ":CATEGORY,:SERIESID,:PROGRAMID,:FINDID,:RECORDID," |
1142 | 1142 | ":STATION,:RECTYPE,:RECSTATUS,:DUPLICATE,:REACTIVATE);"); |
1143 | 1143 | result.bindValue(":CHANID", chanid); |
1144 | | result.bindValue(":START", startts.toString(Qt::ISODate)); |
1145 | | result.bindValue(":END", endts.toString(Qt::ISODate)); |
| 1144 | result.bindValue(":START", startts.toString("yyyy-MM-dd hh:mm:ss")); |
| 1145 | result.bindValue(":END", endts.toString("yyyy-MM-dd hh:mm:ss")); |
1146 | 1146 | result.bindValue(":TITLE", title); |
1147 | 1147 | result.bindValue(":SUBTITLE", subtitle); |
1148 | 1148 | result.bindValue(":DESC", description); |
diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
index bd81323..76b5308 100644
a
|
b
|
void Scheduler::UpdateRecStatus(RecordingInfo *pginfo) |
532 | 532 | { |
533 | 533 | if (p->GetRecordingStatus() != pginfo->GetRecordingStatus()) |
534 | 534 | { |
535 | | VERBOSE(VB_IMPORTANT, |
| 535 | VERBOSE(VB_IMPORTANT, |
536 | 536 | QString("Updating status for %1 on cardid %2 (%3 => %4)") |
537 | 537 | .arg(p->toString(ProgramInfo::kTitleSubtitle)) |
538 | 538 | .arg(p->GetCardID()) |
539 | | .arg(toString(p->GetRecordingStatus(), |
| 539 | .arg(toString(p->GetRecordingStatus(), |
540 | 540 | p->GetRecordingRuleType())) |
541 | | .arg(toString(pginfo->GetRecordingStatus(), |
| 541 | .arg(toString(pginfo->GetRecordingStatus(), |
542 | 542 | p->GetRecordingRuleType()))); |
543 | | bool resched = |
| 543 | bool resched = |
544 | 544 | ((p->GetRecordingStatus() != rsRecording && |
545 | 545 | p->GetRecordingStatus() != rsTuning) || |
546 | 546 | (pginfo->GetRecordingStatus() != rsRecording && |
… |
… |
void Scheduler::UpdateRecStatus(uint cardid, uint chanid, |
577 | 577 | |
578 | 578 | if (p->GetRecordingStatus() != recstatus) |
579 | 579 | { |
580 | | VERBOSE(VB_IMPORTANT, |
| 580 | VERBOSE(VB_IMPORTANT, |
581 | 581 | QString("Updating status for %1 on cardid %2 (%3 => %4)") |
582 | 582 | .arg(p->toString(ProgramInfo::kTitleSubtitle)) |
583 | 583 | .arg(p->GetCardID()) |
584 | | .arg(toString(p->GetRecordingStatus(), |
| 584 | .arg(toString(p->GetRecordingStatus(), |
585 | 585 | p->GetRecordingRuleType())) |
586 | | .arg(toString(recstatus, |
| 586 | .arg(toString(recstatus, |
587 | 587 | p->GetRecordingRuleType()))); |
588 | | bool resched = |
| 588 | bool resched = |
589 | 589 | ((p->GetRecordingStatus() != rsRecording && |
590 | 590 | p->GetRecordingStatus() != rsTuning) || |
591 | 591 | (recstatus != rsRecording && |
… |
… |
void Scheduler::UpdateNextRecord(void) |
1446 | 1446 | if (nextRecMap[recid].isNull() || !next_record.isValid()) |
1447 | 1447 | { |
1448 | 1448 | subquery.prepare("UPDATE record " |
1449 | | "SET next_record = '0000-00-00T00:00:00' " |
| 1449 | "SET next_record = '0000-00-00 00:00:00' " |
1450 | 1450 | "WHERE recordid = :RECORDID;"); |
1451 | 1451 | subquery.bindValue(":RECORDID", recid); |
1452 | 1452 | } |
… |
… |
void Scheduler::UpdateNextRecord(void) |
1455 | 1455 | subquery.prepare("UPDATE record SET next_record = :NEXTREC " |
1456 | 1456 | "WHERE recordid = :RECORDID;"); |
1457 | 1457 | subquery.bindValue(":RECORDID", recid); |
1458 | | subquery.bindValue(":NEXTREC", nextRecMap[recid]); |
| 1458 | subquery.bindValue(":NEXTREC", nextRecMap[recid].toString("yyyy-MM-dd hh:mm:ss")); |
1459 | 1459 | } |
1460 | 1460 | if (!subquery.exec()) |
1461 | 1461 | MythDB::DBError("Update next_record", subquery); |
… |
… |
static bool comp_storage_perc_free_space(FileSystemInfo *a, FileSystemInfo *b) |
3876 | 3876 | if (b->totalSpaceKB == 0) |
3877 | 3877 | return true; |
3878 | 3878 | |
3879 | | if ((a->freeSpaceKB * 100.0) / a->totalSpaceKB > |
| 3879 | if ((a->freeSpaceKB * 100.0) / a->totalSpaceKB > |
3880 | 3880 | (b->freeSpaceKB * 100.0) / b->totalSpaceKB) |
3881 | 3881 | return true; |
3882 | 3882 | |