Skip to content

Commit

Permalink
Fix issue with daily and weekly, manual, recording rules.
Browse files Browse the repository at this point in the history
Commit 5f6697e removed the setting of subtitle to the recording time.
That broke duplicate checking in most cases.  This change fixes all
existing manual rules and forces all future rules to use no duplicate
checking.
  • Loading branch information
gigem committed Aug 16, 2020
1 parent bb3aba4 commit a281910
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mythtv/bindings/perl/MythTV.pm
Expand Up @@ -116,7 +116,7 @@ package MythTV;
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
our $SCHEMA_VERSION = "1364";
our $SCHEMA_VERSION = "1365";

# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
Expand Down
2 changes: 1 addition & 1 deletion mythtv/bindings/python/MythTV/static.py
Expand Up @@ -5,7 +5,7 @@
"""

OWN_VERSION = (32,0,-1,0)
SCHEMA_VERSION = 1364
SCHEMA_VERSION = 1365
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1024
PROTO_VERSION = '91'
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -74,7 +74,7 @@
* mythtv/bindings/php/MythBackend.php
*/

#define MYTH_DATABASE_VERSION "1364"
#define MYTH_DATABASE_VERSION "1365"

MBASE_PUBLIC const char *GetMythSourceVersion();
MBASE_PUBLIC const char *GetMythSourcePath();
Expand Down
11 changes: 11 additions & 0 deletions mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -3780,6 +3780,17 @@ static bool doUpgradeTVDatabaseSchema(void)
return false;
}

if (dbver == "1364")
{
// Set depmethod to none for all manual, recording rules.
DBUpdates updates {
"UPDATE record SET dupmethod = 1 WHERE search = 5"
};
if (!performActualUpdate("MythTV", "DBSchemaVer",
updates, "1365", dbver))
return false;
}

return true;
}

Expand Down
10 changes: 8 additions & 2 deletions mythtv/programs/mythbackend/services/dvr.cpp
Expand Up @@ -1160,7 +1160,10 @@ uint Dvr::AddRecordSchedule (

rule.m_type = recTypeFromString(sType);
rule.m_searchType = searchTypeFromString(sSearchType);
rule.m_dupMethod = dupMethodFromString(sDupMethod);
if (rule.m_searchType == kManualSearch)
rule.m_dupMethod = kDupCheckNone;
else
rule.m_dupMethod = dupMethodFromString(sDupMethod);
rule.m_dupIn = dupInFromString(sDupIn);

if (sRecProfile.isEmpty())
Expand Down Expand Up @@ -1303,7 +1306,10 @@ bool Dvr::UpdateRecordSchedule ( uint nRecordId,

pRule.m_type = recTypeFromString(sType);
pRule.m_searchType = searchTypeFromString(sSearchType);
pRule.m_dupMethod = dupMethodFromString(sDupMethod);
if (pRule.m_searchType == kManualSearch)
pRule.m_dupMethod = kDupCheckNone;
else
pRule.m_dupMethod = dupMethodFromString(sDupMethod);
pRule.m_dupIn = dupInFromString(sDupIn);

if (sRecProfile.isEmpty())
Expand Down
1 change: 1 addition & 0 deletions mythtv/programs/mythfrontend/manualschedule.cpp
Expand Up @@ -219,6 +219,7 @@ void ManualSchedule::recordClicked(void)
auto *record = new RecordingRule();
record->LoadByProgram(&p);
record->m_searchType = kManualSearch;
record->m_dupMethod = kDupCheckNone;

MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
auto *schededit = new ScheduleEditor(mainStack, record);
Expand Down
5 changes: 4 additions & 1 deletion mythtv/programs/mythfrontend/scheduleeditor.cpp
Expand Up @@ -2138,6 +2138,7 @@ void SchedOptMixin::RuleChanged(void)
m_rule->m_type != kDontRecord);
bool isSingle = (m_rule->m_type == kSingleRecord ||
m_rule->m_type == kOverrideRecord);
bool isManual = (m_rule->m_searchType == kManualSearch);

if (m_prioritySpin)
m_prioritySpin->SetEnabled(isScheduled);
Expand All @@ -2146,7 +2147,9 @@ void SchedOptMixin::RuleChanged(void)
if (m_endoffsetSpin)
m_endoffsetSpin->SetEnabled(isScheduled);
if (m_dupmethodList)
m_dupmethodList->SetEnabled(isScheduled && !isSingle);
m_dupmethodList->SetEnabled(
isScheduled && !isSingle &&
(!isManual || m_rule->m_dupMethod != kDupCheckNone));
if (m_dupscopeList)
m_dupscopeList->SetEnabled(isScheduled && !isSingle &&
m_rule->m_dupMethod != kDupCheckNone);
Expand Down

0 comments on commit a281910

Please sign in to comment.