Skip to content
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...
1 parent f7b28e5 commit 4125a407a0775f159d0fa95001187457ee578684 @stuarta stuarta committed Dec 29, 2011
Showing with 11 additions and 2 deletions.
  1. +10 −2 mythtv/libs/libmythtv/eitfixup.cpp
  2. +1 −0 mythtv/libs/libmythtv/eitfixup.h
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;

0 comments on commit 4125a40

Please sign in to comment.
Something went wrong with that request. Please try again.