summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Auchterlonie <stuarta@squashedfrog.net>2011-12-29 09:18:41 (GMT)
committer Stuart Auchterlonie <stuarta@squashedfrog.net>2011-12-29 09:18:41 (GMT)
commit4125a407a0775f159d0fa95001187457ee578684 (patch)
tree48edae2833e679eed46fc3c47f1ccd1f5a38c371
parentf7b28e57a9c5805befdf6538fb175124e0260ec2 (diff)
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.
-rw-r--r--mythtv/libs/libmythtv/eitfixup.cpp12
-rw-r--r--mythtv/libs/libmythtv/eitfixup.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/mythtv/libs/libmythtv/eitfixup.cpp b/mythtv/libs/libmythtv/eitfixup.cpp
index 5a7af12..0377c9f 100644
--- a/mythtv/libs/libmythtv/eitfixup.cpp
+++ b/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)
diff --git a/mythtv/libs/libmythtv/eitfixup.h b/mythtv/libs/libmythtv/eitfixup.h
index 2ea8d6b..a724506 100644
--- a/mythtv/libs/libmythtv/eitfixup.h
+++ b/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;