Skip to content

Commit

Permalink
Use Recording Type in GuessLookupType
Browse files Browse the repository at this point in the history
To improve the accuracy of GuessLookupType(), the
Recording Type is now factored in. If the recording
type is Daily, or Weekly, then it's probably a
television show.

Refs #656
  • Loading branch information
SteveErl authored and rcrdnalor committed Jul 23, 2023
1 parent 66bf374 commit 9076f82
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mythtv/libs/libmythmetadata/metadatafactory.cpp
Expand Up @@ -675,11 +675,19 @@ LookupType GuessLookupType(ProgramInfo *pginfo)
// weird combination of both, we've got to try everything.
auto *rule = new RecordingRule();
rule->m_recordID = pginfo->GetRecordingRuleID();
// Load rule information from the database
rule->Load();
int ruleepisode = rule->m_episode;
RecordingType rulerectype = rule->m_type;
delete rule;

if (ruleepisode == 0 && pginfo->GetEpisode() == 0 &&
// If recording rule is periodic, it's probably a TV show.
if ((rulerectype == kDailyRecord) ||
(rulerectype == kWeeklyRecord))
{
ret = kProbableTelevision;
}
else if (ruleepisode == 0 && pginfo->GetEpisode() == 0 &&
pginfo->GetSubtitle().isEmpty())
ret = kProbableMovie;
else if (ruleepisode > 0 && pginfo->GetSubtitle().isEmpty())
Expand Down Expand Up @@ -731,6 +739,8 @@ LookupType GuessLookupType(RecordingRule *recrule)
return ret;

if (recrule->m_season > 0 || recrule->m_episode > 0 ||
(recrule->m_type == kDailyRecord) ||
(recrule->m_type == kWeeklyRecord) ||
!recrule->m_subtitle.isEmpty())
ret = kProbableTelevision;
else
Expand Down

0 comments on commit 9076f82

Please sign in to comment.