Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Enhance UK EIT fixup to support "QuotedSubtitles".

Some of the channels (specifically 4Music) are helpfully
putting the subtitle in the description as follows
'<subtitle>.' <description>

This adds support for this case.
  • Loading branch information...
commit 4125a407a0775f159d0fa95001187457ee578684 1 parent f7b28e5
@stuarta stuarta authored
View
12 mythtv/libs/libmythtv/eitfixup.cpp
@@ -56,6 +56,7 @@ EITFixUp::EITFixUp()
m_ukExclusionFromSubtitle("(starring|stars\\s|drama|series|sitcom)",Qt::CaseInsensitive),
m_ukCompleteDots("^\\.\\.+$"),
m_ukAllNew("All New To 4Music!\\s?"),
+ m_ukQuotedSubtitle("(?:^')([\\w\\s\\-,]+)(?:\\.' )"),
m_comHemCountry("^(\\(.+\\))?\\s?([^ ]+)\\s([^\\.0-9]+)"
"(?:\\sfrån\\s([0-9]{4}))(?:\\smed\\s([^\\.]+))?\\.?"),
m_comHemDirector("[Rr]egi"),
@@ -543,7 +544,7 @@ void EITFixUp::SetUKSubtitle(DBEventEIT &event) const
QStringList strListColon = event.description.split(":");
QStringList strListEnd;
- bool fColon = false;
+ bool fColon = false, fQuotedSubtitle = false;
int nPosition1;
QString strEnd;
if (strListColon.count()>1)
@@ -605,10 +606,17 @@ void EITFixUp::SetUKSubtitle(DBEventEIT &event) const
fColon = true;
}
}
+ QRegExp tmpQuotedSubtitle = m_ukQuotedSubtitle;
+ if (tmpQuotedSubtitle.indexIn(event.description) != -1)
+ {
+ event.subtitle = tmpQuotedSubtitle.cap(1);
+ event.description.remove(m_ukQuotedSubtitle);
+ fQuotedSubtitle = true;
+ }
QStringList strListPeriod;
QStringList strListQuestion;
QStringList strListExcl;
- if (!fColon)
+ if (!(fColon || fQuotedSubtitle))
{
strListPeriod = event.description.split(".");
if (strListPeriod.count() >1)
View
1  mythtv/libs/libmythtv/eitfixup.h
@@ -134,6 +134,7 @@ class EITFixUp
const QRegExp m_ukYearColon;
const QRegExp m_ukExclusionFromSubtitle;
const QRegExp m_ukCompleteDots;
+ const QRegExp m_ukQuotedSubtitle;
const QRegExp m_ukAllNew;
const QRegExp m_comHemCountry;
const QRegExp m_comHemDirector;
Please sign in to comment.
Something went wrong with that request. Please try again.