commit c91e4d30e64642a90a3cbff55588d1206677621f
Author: Mark Spieth <mspieth@digivation.com.au>
Date: Tue Jan 26 13:17:09 2010 +1100
input pref recording attribute will test by input group if available
diff --git a/mythplugins/mythweb/modules/tv/classes/Schedule.php b/mythplugins/mythweb/modules/tv/classes/Schedule.php
index 6bb5dad..d559169 100644
a
|
b
|
class Schedule { |
254 | 254 | _or($this->autouserjob4, 0, true), |
255 | 255 | _or($this->playgroup, 'Default' ), |
256 | 256 | _or($this->storagegroup, 'Default' ), |
257 | | _or($this->prefinput, 0, true), |
| 257 | $this->prefinput, |
258 | 258 | _or($this->next_record, '00:00:00' ), |
259 | 259 | _or($this->last_record, '00:00:00' ), |
260 | 260 | _or($this->last_delete, '00:00:00' ) |
diff --git a/mythplugins/mythweb/modules/tv/includes/schedule_utils.php b/mythplugins/mythweb/modules/tv/includes/schedule_utils.php
index dca9ea2..670eac1 100644
a
|
b
|
|
22 | 22 | // Gather the data |
23 | 23 | if (empty($inputs)) { |
24 | 24 | global $db; |
| 25 | $sh = $db->query('SELECT DISTINCT (-inputgroupid), |
| 26 | IF(LENGTH(IFNULL(inputgroupname,"")) > 0, |
| 27 | inputgroupname, |
| 28 | CONCAT("Group ", inputgroupid) |
| 29 | ) AS name |
| 30 | FROM inputgroup |
| 31 | ORDER BY inputgroupid'); |
| 32 | while (list($id, $name) = $sh->fetch_row()) { |
| 33 | $inputs[$id] = $name; |
| 34 | } |
25 | 35 | $sh = $db->query('SELECT cardinputid, |
26 | 36 | IF(LENGTH(IFNULL(displayname,"")) > 0, |
27 | 37 | displayname, |
diff --git a/mythtv/programs/mythbackend/scheduler.cpp b/mythtv/programs/mythbackend/scheduler.cpp
index 52cf68a..60e40e1 100644
a
|
b
|
void Scheduler::AddNewRecords(void) |
2974 | 2974 | |
2975 | 2975 | if (prefinputpri) |
2976 | 2976 | pwrpri += QString(" + " |
2977 | | "(cardinput.cardinputid = RECTABLE.prefinput) * %1").arg(prefinputpri); |
| 2977 | "(cardinput.cardinputid = RECTABLE.prefinput OR -inputgroup.inputgroupid = RECTABLE.prefinput) * %1").arg(prefinputpri); |
2978 | 2978 | |
2979 | 2979 | if (hdtvpriority) |
2980 | 2980 | pwrpri += QString(" + (program.hdtv > 0 OR " |
… |
… |
void Scheduler::AddNewRecords(void) |
3210 | 3210 | "oldrecstatus.recstatus, oldrecstatus.reactivate, " |
3211 | 3211 | "program.videoprop+0, program.subtitletypes+0, program.audioprop+0, " |
3212 | 3212 | "RECTABLE.storagegroup, capturecard.hostname, recordmatch.oldrecstatus, " |
3213 | | "RECTABLE.avg_delay, " + pwrpri + QString( |
| 3213 | "RECTABLE.avg_delay, " + pwrpri + ",inputgroup.inputgroupid+0 " + QString( |
3214 | 3214 | "FROM recordmatch " |
3215 | 3215 | " INNER JOIN RECTABLE ON (recordmatch.recordid = RECTABLE.recordid) " |
3216 | 3216 | " INNER JOIN program ON (recordmatch.chanid = program.chanid AND " |
… |
… |
void Scheduler::AddNewRecords(void) |
3218 | 3218 | " recordmatch.manualid = program.manualid) " |
3219 | 3219 | " INNER JOIN channel ON (channel.chanid = program.chanid) " |
3220 | 3220 | " INNER JOIN cardinput ON (channel.sourceid = cardinput.sourceid) " |
| 3221 | " LEFT JOIN inputgroup ON (-RECTABLE.prefinput = inputgroup.inputgroupid AND " |
| 3222 | " inputgroup.cardinputid = cardinput.cardinputid) " |
3221 | 3223 | " INNER JOIN capturecard ON (capturecard.cardid = cardinput.cardid) " |
3222 | 3224 | " LEFT JOIN oldrecorded as oldrecstatus ON " |
3223 | 3225 | " ( oldrecstatus.station = channel.callsign AND " |
diff --git a/mythtv/programs/mythfrontend/scheduleeditor.cpp b/mythtv/programs/mythfrontend/scheduleeditor.cpp
index 35a4822..339db4a 100644
a
|
b
|
void SchedOptEditor::Load() |
518 | 518 | new MythUIButtonListItem(m_inputList, tr("Use any available input"), |
519 | 519 | qVariantFromValue(0)); |
520 | 520 | |
| 521 | query.prepare("SELECT DISTINCT inputgroupid, inputgroupname FROM inputgroup ORDER BY inputgroupid"); |
| 522 | |
| 523 | if (query.exec()) |
| 524 | { |
| 525 | while (query.next()) |
| 526 | { |
| 527 | QString group_name = query.value(1).toString(); |
| 528 | if (group_name.isEmpty()) |
| 529 | group_name = QString("%1").arg(query.value(0).toInt()); |
| 530 | new MythUIButtonListItem(m_inputList, tr("Prefer group %1") |
| 531 | .arg(group_name), -query.value(0).toInt()); |
| 532 | } |
| 533 | } |
| 534 | |
| 535 | |
521 | 536 | query.prepare("SELECT cardinputid, cardid, inputname, displayname " |
522 | 537 | "FROM cardinput ORDER BY cardinputid"); |
523 | 538 | |