Skip to content

Commit 71064a3

Browse files
committed
Remove support for old recording rule filters in frontend and backend.
Any rules using the old filters for "Exclude Old Episodes", "Exclude unidentified episodes" and "Record new episode first showings" are automatically converted to the new style. Also add a new "This Episode" filter to make it easier to match a specific episode. Refs #9850.
1 parent 257e9e4 commit 71064a3

File tree

5 files changed

+25
-33
lines changed

5 files changed

+25
-33
lines changed

mythtv/libs/libmyth/recordingtypes.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ typedef enum RecordingDupInTypes
2929
kDupsInRecorded = 0x01,
3030
kDupsInOldRecorded = 0x02,
3131
kDupsInAll = 0x0F,
32-
kDupsNewEpi = 0x10,
33-
kDupsExRepeats = 0x20,
34-
kDupsExGeneric = 0x40,
35-
kDupsFirstNew = 0x80
32+
kDupsNewEpi = 0x10
3633
} RecordingDupInType; // note stored in uin8_t in ProgramInfo
3734

3835

mythtv/libs/libmythbase/mythversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* MythTV Python Bindings
5252
* mythtv/bindings/python/MythTV/static.py
5353
*/
54-
#define MYTH_DATABASE_VERSION "1283"
54+
#define MYTH_DATABASE_VERSION "1284"
5555

5656

5757
MBASE_PUBLIC const char *GetMythSourceVersion();

mythtv/libs/libmythtv/dbcheck.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5895,6 +5895,22 @@ NULL
58955895
return false;
58965896
}
58975897

5898+
if (dbver == "1283")
5899+
{
5900+
const char *updates[] = {
5901+
"UPDATE record SET filter = filter | 1 WHERE record.dupin & 0x20",
5902+
"UPDATE record SET filter = filter | 2 WHERE record.dupin & 0x40",
5903+
"UPDATE record SET filter = filter | 5 WHERE record.dupin & 0x80",
5904+
"UPDATE record SET dupin = dupin & ~0xe0",
5905+
"INSERT INTO recordfilter (filterid, description, clause, newruledefault) "
5906+
" VALUES (6, 'This Episode', '(program.programid <> '''' AND program.programid = RECTABLE.programid) OR (program.programid = '''' AND program.subtitle = RECTABLE.subtitle AND program.description = RECTABLE.description)', 0);",
5907+
NULL
5908+
};
5909+
5910+
if (!performActualUpdate(updates, "1284", dbver))
5911+
return false;
5912+
}
5913+
58985914
return true;
58995915
}
59005916

mythtv/programs/mythbackend/scheduler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,11 +3345,6 @@ void Scheduler::UpdateMatches(int recordid) {
33453345
"FROM (RECTABLE, program INNER JOIN channel "
33463346
" ON channel.chanid = program.chanid) ") + fromclauses[clause] + QString(
33473347
" WHERE ") + whereclauses[clause] +
3348-
QString(" AND (NOT ((RECTABLE.dupin & %1) AND program.previouslyshown)) "
3349-
" AND (NOT ((RECTABLE.dupin & %2) AND program.generic > 0)) "
3350-
" AND (NOT ((RECTABLE.dupin & %3) AND (program.previouslyshown "
3351-
" OR program.first = 0))) ")
3352-
.arg(kDupsExRepeats).arg(kDupsExGeneric).arg(kDupsFirstNew) +
33533348
QString(" AND channel.visible = 1 ") +
33543349
filterClause + QString(" AND "
33553350

mythtv/programs/mythfrontend/scheduleeditor.cpp

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ static QString fs2(QT_TRANSLATE_NOOP("SchedFilterEditor", "First showing"));
4949
static QString fs3(QT_TRANSLATE_NOOP("SchedFilterEditor", "Primetime"));
5050
static QString fs4(QT_TRANSLATE_NOOP("SchedFilterEditor", "Commercial free"));
5151
static QString fs5(QT_TRANSLATE_NOOP("SchedFilterEditor", "High definition"));
52+
static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This Episode"));
5253

5354
void *ScheduleEditor::RunScheduleEditor(ProgramInfo *proginfo, void *player)
5455
{
@@ -621,23 +622,11 @@ void SchedOptEditor::Load()
621622
"only"),
622623
ENUM_TO_QVARIANT(kDupsInOldRecorded));
623624

624-
if (!m_filtersButton)
625+
if (gCoreContext->GetNumSetting("HaveRepeats", 0))
625626
{
626627
new MythUIButtonListItem(m_dupscopeList,
627-
tr("Exclude unidentified episodes"),
628-
ENUM_TO_QVARIANT(kDupsExGeneric | kDupsInAll));
629-
if (gCoreContext->GetNumSetting("HaveRepeats", 0))
630-
{
631-
new MythUIButtonListItem(m_dupscopeList,
632-
tr("Exclude old episodes"),
633-
ENUM_TO_QVARIANT(kDupsExRepeats | kDupsInAll));
634-
new MythUIButtonListItem(m_dupscopeList,
635-
tr("Record new episodes only"),
636-
ENUM_TO_QVARIANT(kDupsNewEpi | kDupsInAll));
637-
new MythUIButtonListItem(m_dupscopeList,
638-
tr("Record new episode first showings"),
639-
ENUM_TO_QVARIANT(kDupsFirstNew | kDupsInAll));
640-
}
628+
tr("Record new episodes only"),
629+
ENUM_TO_QVARIANT(kDupsNewEpi | kDupsInAll));
641630
}
642631

643632
m_dupscopeList->SetValueByData(ENUM_TO_QVARIANT(m_recordingRule->m_dupIn));
@@ -781,14 +770,9 @@ void SchedFilterEditor::Load()
781770
button = new MythUIButtonListItem(m_filtersList, description,
782771
filterid);
783772
button->setCheckable(true);
784-
if (m_recordingRule->IsLoaded())
785-
button->setChecked(m_recordingRule->m_filter & (1 << filterid) ?
786-
MythUIButtonListItem::FullChecked :
787-
MythUIButtonListItem::NotChecked);
788-
else
789-
button->setChecked(filter_default ?
790-
MythUIButtonListItem::FullChecked :
791-
MythUIButtonListItem::NotChecked);
773+
button->setChecked(m_recordingRule->m_filter & (1 << filterid) ?
774+
MythUIButtonListItem::FullChecked :
775+
MythUIButtonListItem::NotChecked);
792776
}
793777
}
794778

0 commit comments

Comments
 (0)