Permalink
Browse files

Remove the use of obsolete settings in RecordingRule.

Move the use of settings from the RecordingRule constructor to the
schema update that creates the default, recording rule template.
The settings are removed from the database in a later schema update.
  • Loading branch information...
1 parent 11e65df commit 4df54066517241f7a4dbba3685017b6b2a18c9d5 @gigem gigem committed Feb 26, 2014
Showing with 43 additions and 15 deletions.
  1. +30 −0 mythtv/libs/libmythtv/dbcheck.cpp
  2. +13 −15 mythtv/libs/libmythtv/recordingrule.cpp
View
30 mythtv/libs/libmythtv/dbcheck.cpp
@@ -16,6 +16,7 @@ using namespace std;
#include "videodbcheck.h" // for 1267
#include "compat.h"
#include "recordingrule.h"
+#include "recordingprofile.h"
// TODO convert all dates to UTC
@@ -2025,6 +2026,35 @@ NULL
RecordingRule record;
record.MakeTemplate("Default");
record.m_type = kTemplateRecord;
+ // Take some defaults from now obsoleted settings.
+ record.m_startOffset =
+ gCoreContext->GetNumSetting("DefaultStartOffset", 0);
+ record.m_endOffset =
+ gCoreContext->GetNumSetting("DefaultEndOffset", 0);
+ record.m_dupMethod =
+ static_cast<RecordingDupMethodType>(
+ gCoreContext->GetNumSetting(
+ "prefDupMethod", kDupCheckSubDesc));
+ record.m_filter = RecordingRule::GetDefaultFilter();
+ record.m_autoExpire =
+ gCoreContext->GetNumSetting("AutoExpireDefault", 0);
+ record.m_autoCommFlag =
+ gCoreContext->GetNumSetting("AutoCommercialFlag", 1);
+ record.m_autoTranscode =
+ gCoreContext->GetNumSetting("AutoTranscode", 0);
+ record.m_transcoder =
+ gCoreContext->GetNumSetting(
+ "DefaultTranscoder", RecordingProfile::TranscoderAutodetect);
+ record.m_autoUserJob1 =
+ gCoreContext->GetNumSetting("AutoRunUserJob1", 0);
+ record.m_autoUserJob2 =
+ gCoreContext->GetNumSetting("AutoRunUserJob2", 0);
+ record.m_autoUserJob3 =
+ gCoreContext->GetNumSetting("AutoRunUserJob3", 0);
+ record.m_autoUserJob4 =
+ gCoreContext->GetNumSetting("AutoRunUserJob4", 0);
+ record.m_autoMetadataLookup =
+ gCoreContext->GetNumSetting("AutoMetadataLookup", 1);
record.Save(false);
if (!UpdateDBVersionNumber("1302", dbver))
View
28 mythtv/libs/libmythtv/recordingrule.cpp
@@ -42,28 +42,26 @@ RecordingRule::RecordingRule()
m_searchType(kNoSearch),
m_recPriority(0),
m_prefInput(0),
- m_startOffset(gCoreContext->GetNumSetting("DefaultStartOffset", 0)),
- m_endOffset(gCoreContext->GetNumSetting("DefaultEndOffset", 0)),
- m_dupMethod(static_cast<RecordingDupMethodType>(
- gCoreContext->GetNumSetting("prefDupMethod", kDupCheckSubDesc))),
+ m_startOffset(0),
+ m_endOffset(0),
+ m_dupMethod(kDupCheckSubDesc),
m_dupIn(kDupsInAll),
- m_filter(GetDefaultFilter()),
+ m_filter(0),
m_recProfile(tr("Default")),
m_recGroupID(RecordingInfo::kDefaultRecGroup),
m_storageGroup("Default"),
m_playGroup("Default"),
- m_autoExpire(gCoreContext->GetNumSetting("AutoExpireDefault", 0)),
+ m_autoExpire(0),
m_maxEpisodes(0),
m_maxNewest(false),
- m_autoCommFlag(gCoreContext->GetNumSetting("AutoCommercialFlag", 1)),
- m_autoTranscode(gCoreContext->GetNumSetting("AutoTranscode", 0)),
- m_transcoder(gCoreContext->GetNumSetting("DefaultTranscoder",
- RecordingProfile::TranscoderAutodetect)),
- m_autoUserJob1(gCoreContext->GetNumSetting("AutoRunUserJob1", 0)),
- m_autoUserJob2(gCoreContext->GetNumSetting("AutoRunUserJob2", 0)),
- m_autoUserJob3(gCoreContext->GetNumSetting("AutoRunUserJob3", 0)),
- m_autoUserJob4(gCoreContext->GetNumSetting("AutoRunUserJob4", 0)),
- m_autoMetadataLookup(gCoreContext->GetNumSetting("AutoMetadataLookup", 1)),
+ m_autoCommFlag(1),
+ m_autoTranscode(0),
+ m_transcoder(RecordingProfile::TranscoderAutodetect),
+ m_autoUserJob1(0),
+ m_autoUserJob2(0),
+ m_autoUserJob3(0),
+ m_autoUserJob4(0),
+ m_autoMetadataLookup(1),
m_nextRecording(MythDate::fromString("0000-00-00T00:00:00")),
m_lastRecorded(MythDate::fromString("0000-00-00T00:00:00")),
m_lastDeleted(MythDate::fromString("0000-00-00T00:00:00")),

0 comments on commit 4df5406

Please sign in to comment.