Skip to content

Commit

Permalink
Remove support for recording rule type priorities.
Browse files Browse the repository at this point in the history
This change removes support for the arcane recording rule type
priorities that probably nobody or almost nobody actually uses.  This
is the feature where recording rules are given a priority boost based
on their type (e.g. SingleRecord, ChannelRecord, AllRecord, etc.) in
addition to the per-rule and other guide based priorities.  If anyone
actually uses this feature, it can be replicate by using the almost as
obscure custom priorities feature.

Note: this is the first in a series of changes over the coming days
and weeks to remove some scheduler related features and settings that
the developers no longer believe are needed or want to support.
  • Loading branch information
gigem committed Nov 28, 2012
1 parent 1ffb24e commit a76bd18
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 264 deletions.
29 changes: 0 additions & 29 deletions mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -1960,35 +1960,6 @@ bool ProgramInfo::LoadProgramFromRecorded(
return true;
}

/** \fn ProgramInfo::GetRecordingTypeRecPriority(RecordingType)
* \brief Returns recording priority change needed due to RecordingType.
*/
int ProgramInfo::GetRecordingTypeRecPriority(RecordingType type)
{
switch (type)
{
case kSingleRecord:
return gCoreContext->GetNumSetting("SingleRecordRecPriority", 1);
case kTimeslotRecord:
return gCoreContext->GetNumSetting("TimeslotRecordRecPriority", 0);
case kWeekslotRecord:
return gCoreContext->GetNumSetting("WeekslotRecordRecPriority", 0);
case kChannelRecord:
return gCoreContext->GetNumSetting("ChannelRecordRecPriority", 0);
case kAllRecord:
return gCoreContext->GetNumSetting("AllRecordRecPriority", 0);
case kFindOneRecord:
case kFindDailyRecord:
case kFindWeeklyRecord:
return gCoreContext->GetNumSetting("FindOneRecordRecPriority", -1);
case kOverrideRecord:
case kDontRecord:
return gCoreContext->GetNumSetting("OverrideRecordRecPriority", 0);
default:
return 0;
}
}

/** \fn ProgramInfo::IsSameProgramWeakCheck(const ProgramInfo&) const
* \brief Checks for duplicate using only title, chanid and startts.
* \param other ProgramInfo to compare this one with.
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmyth/programinfo.h
Expand Up @@ -291,7 +291,6 @@ class MPUBLIC ProgramInfo
bool IsSameProgram(const ProgramInfo &other) const;
bool IsSameTimeslot(const ProgramInfo &other) const;
bool IsSameProgramTimeslot(const ProgramInfo &other) const;//sched only
static int GetRecordingTypeRecPriority(RecordingType type);//sched only
static bool UsingProgramIDAuthority(void)
{
return usingProgIDAuth;
Expand Down
9 changes: 1 addition & 8 deletions mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -3852,7 +3852,6 @@ void Scheduler::AddNewRecords(void)

struct timeval dbstart, dbend;

QMap<RecordingType, int> recTypeRecPriorityMap;
RecList tmpList;

QMap<int, bool> cardMap;
Expand Down Expand Up @@ -4142,14 +4141,8 @@ void Scheduler::AddNewRecords(void)
p->SetRecordingStatus(p->oldrecstatus);
}

if (!recTypeRecPriorityMap.contains(p->GetRecordingRuleType()))
{
recTypeRecPriorityMap[p->GetRecordingRuleType()] =
p->GetRecordingTypeRecPriority(p->GetRecordingRuleType());
}

p->SetRecordingPriority(
p->GetRecordingPriority() + recTypeRecPriorityMap[p->GetRecordingRuleType()] +
p->GetRecordingPriority() +
result.value(51).toInt() +
((autopriority) ?
autopriority - (result.value(45).toInt() * autostrata / 200) : 0));
Expand Down
90 changes: 0 additions & 90 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Expand Up @@ -2400,84 +2400,6 @@ static GlobalSpinBox *GRAudioDescRecPriority()
return bs;
}

static GlobalSpinBox *GRSingleRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("Single recordings priority"));
bs->setHelpText(QObject::tr("Single recordings will receive this "
"additional recording priority value."));
bs->setValue(1);
return bs;
}

static GlobalSpinBox *GRWeekslotRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("Weekslot recordings priority"));
bs->setHelpText(QObject::tr("Weekslot recordings will receive this "
"additional recording priority value."));
bs->setValue(0);
return bs;
}

static GlobalSpinBox *GRTimeslotRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("Timeslot recordings priority"));
bs->setHelpText(QObject::tr("Timeslot recordings will receive this "
"additional recording priority value."));
bs->setValue(0);
return bs;
}

static GlobalSpinBox *GRChannelRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("Channel recordings priority"));
bs->setHelpText(QObject::tr("Channel recordings will receive this "
"additional recording priority value."));
bs->setValue(0);
return bs;
}

static GlobalSpinBox *GRAllRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("All recordings priority"));
bs->setHelpText(QObject::tr("The 'All' recording type will receive this "
"additional recording priority value."));
bs->setValue(0);
return bs;
}

static GlobalSpinBox *GRFindOneRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("Find one recordings priority"));
bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily "
"recording types will receive this "
"additional recording priority value."));
bs->setValue(-1);
return bs;
}

static GlobalSpinBox *GROverrideRecordRecPriority()
{
GlobalSpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",
-99, 99, 1);
bs->setLabel(QObject::tr("Override recordings priority"));
bs->setHelpText(QObject::tr("Override recordings will receive this "
"additional recording priority value."));
bs->setValue(0);
return bs;
}

static HostLineEdit *DefaultTVChannel()
{
HostLineEdit *ge = new HostLineEdit("DefaultTVChannel");
Expand Down Expand Up @@ -3557,18 +3479,6 @@ GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
access->addChild(GRHardHearRecPriority());
access->addChild(GRAudioDescRecPriority());
addChild(access);

VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);
rtype->setLabel(QObject::tr("Recording Type Priority Settings"));

rtype->addChild(GRSingleRecordRecPriority());
rtype->addChild(GROverrideRecordRecPriority());
rtype->addChild(GRFindOneRecordRecPriority());
rtype->addChild(GRWeekslotRecordRecPriority());
rtype->addChild(GRTimeslotRecordRecPriority());
rtype->addChild(GRChannelRecordRecPriority());
rtype->addChild(GRAllRecordRecPriority());
addChild(rtype);
}

AppearanceSettings::AppearanceSettings()
Expand Down

0 comments on commit a76bd18

Please sign in to comment.