Ticket #12911: eitfixes-greek-2010-10-30.diff

File eitfixes-greek-2010-10-30.diff, 7.8 KB (added by yiannividalis@…, 10 years ago)
Line 
1diff --git a/mythtv/libs/libmythtv/eitfixup.cpp b/mythtv/libs/libmythtv/eitfixup.cpp
2index 5c4ce6c..3b14bba 100644
3--- a/mythtv/libs/libmythtv/eitfixup.cpp
4+++ b/mythtv/libs/libmythtv/eitfixup.cpp
5@@ -208,14 +208,17 @@ EITFixUp::EITFixUp()
6 m_grYear("(?:\\W?)(?:\\s?παραγωγ[ηή]ς|\\s?-|,)\\s*([1-2]{1}[0-9]{3})(?:-\\d{1,4})?",Qt::CaseInsensitive),
7 m_grCountry("(?:\\W|\\b)(?:(ελληΜ|του
8ρκ|αΌερικ[αά]Μ|γαλλ|αγγλ|βρεττ?αΜ|γερΌαΜ|ρωσσ?|ιταλ|ελβετ|σου
9ηΎ|ισπαΜ|πορτογαλ|ΌεΟικ[αά]Μ|κιΜ[εέ]ζικ|ιαπωΜ|καΜαΎ|βραζιλι[αά]Μ)(ικ[ηή][ςσ]))",Qt::CaseInsensitive),
10 m_grlongEp("\\b(?:Επ.|επεισ[οό]Ύιο:?)\\s*(\\d+)(?:\\W?)",Qt::CaseInsensitive),
11- m_grSeason("(?:-\\s)?\\b((\\D{1,2})(?:')?|(\\d{1,2})(?:ος|ου
12)?)(?:\\sκ[υ
13ύ]κλο(?:[σς]|υ
14)){1}\\s?",Qt::CaseInsensitive),
15- m_grRealTitleinDescription("(?:^\\()([\\w\\s\\d\\D-]+)(?:\\))(?:\\s*)"),
16+ m_grSeason("(?:\\W-?)*(?:\\(-\\s*)?\\b(([Α-Ω]{1,2})(?:'|΄)?|(\\d{1,2})(?:ος|ου
17)?)(?:\\s*κ[υ
18ύ]κλο(?:[σς]|υ
19)){1}\\s?",Qt::CaseInsensitive),
20+ m_grRealTitleinDescription("(?:^\\()([A-Za-z\\s\\d-]+)(?:\\))(?:\\s*)"),
21 // cap1 = real title
22 // cap0 = real title in parentheses.
23- m_grRealTitleinTitle("(?:\\()([\\w\\s\\d\\D-]+)(?:\\))(?:\\s*$)*"),
24+ m_grRealTitleinTitle("(?:\\()([A-Za-z\\s\\d-]+)(?:\\))(?:\\s*$)*"),
25 // cap1 = real title
26 // cap0 = real title in parentheses.
27- m_grNotPreviouslyShown("(?:\\b[Α1]['η]?\\s*(?:τηλεοπτικ[ηή]\\s*)?(?:Όετ[αά]Ύοση|προβολ[ηή]))(?:\\W?)"),
28+ m_grCommentsinTitle("(?:\\()([Α-Ωα-ω\\s\\d-]+)(?:\\))(?:\\s*$)*"),
29+ // cap1 = real title
30+ // cap0 = real title in parentheses.
31+ m_grNotPreviouslyShown("(?:\\W?)(?:-\\s*)*(?:\\b[Α1]['΄η]?\\s*(?:τηλεοπτικ[ηή]\\s*)?(?:Όετ[αά]Ύοση|προβολ[ηή]))(?:\\W?)",Qt::CaseInsensitive),
32 // Try to exctract Greek categories from keywords in description.
33 m_grEpisodeAsSubtitle("(?:^Επεισ[οό]Ύιο:\\s?)([\\w\\s-,']+)\\.(?:\\s)?"),
34 m_grCategFood("(?:\\W)?(?:εκποΌπ[ηή]\\W)?(ΓαστροΜοΌ[ιί]α[σς]?|Όαγειρικ[ηή][σς]?|chef|συ
35Μταγ[εέηή]|Ύιατροφ|wine|ÎŒ[αά]γειρα[σς]?)(?:\\W)?",Qt::CaseInsensitive),
36@@ -2554,6 +2557,8 @@ void EITFixUp::FixGreekSubtitle(DBEventEIT &event) const
37
38 void EITFixUp::FixGreekEIT(DBEventEIT &event) const
39 {
40+ int position1;
41+ int position2;
42 //Live show
43 int position;
44 QRegExp tmpRegEx;
45@@ -2569,7 +2574,7 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const
46 if (position != -1)
47 {
48 event.previouslyshown = false;
49- event.title = event.title.replace(m_grNotPreviouslyShown.cap(0), "");
50+ event.title = event.title.replace(m_grNotPreviouslyShown, "");
51 }
52
53 // Greek Replay (Ε)
54@@ -2641,37 +2646,6 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const
55 event.description.replace(tmpRegEx.cap(0), "");
56 }
57
58-/*
59-
60- tmpRegEx = m_grDirector;
61- position = event.description.indexOf(tmpRegEx);
62- if (position != -1)
63- {
64- // director is captured in cap(1).Due to sometimes miswritten data in
65- // eit, e.g no fullstop present(!)
66- QString tmpDirectorsString = tmpRegEx.cap(1);
67- // look for actors in director string (lack of fullstop, etc)
68- tmpRegEx = m_grActors;
69- int actposition = tmpDirectorsString.indexOf(tmpRegEx);
70- if (actposition != -1)
71- {
72- tmpDirectorsString = tmpDirectorsString.replace(tmpRegEx,"");
73- }
74- const QStringList directors =
75- tmpDirectorsString.split(m_grPeopleSeparator, QString::SkipEmptyParts);
76- QStringList::const_iterator it = directors.begin();
77- for (; it != directors.end(); ++it)
78- {
79- tmpDirectorsString = it->split(":").last().trimmed().
80- remove(QRegExp("\\.$"));
81- if (tmpDirectorsString != "")
82- event.AddPerson(DBPerson::kDirector, tmpDirectorsString);
83-
84- }
85- event.description.replace(tmpRegEx.cap(0), "");
86- // directorPresent = true;
87- }
88-*/
89 //Try to find presenter
90 tmpRegEx = m_grPres;
91 position = event.description.indexOf(tmpRegEx);
92@@ -2724,9 +2698,8 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const
93 QRegExp tmpSeries = m_grSeason;
94 // cap(2) is the season for ΑΒΓΔ
95 // cap(3) is the season for 1234
96- int position1 = tmpSeries.indexIn(event.title);
97- int position2 = tmpSeries.indexIn(event.description);
98- if ((position1 != -1) || (position2 != -1))
99+ if ((position1 = tmpSeries.indexIn(event.title)) != -1
100+ || (position2 = tmpSeries.indexIn(event.description)) != -1)
101 {
102 if (!tmpSeries.cap(2).isEmpty()) // we found a letter representing a number
103 {
104@@ -2776,6 +2749,17 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const
105 event.season = 1;
106 }
107 }
108+ // Sometimes, especially on greek national tv, they include comments in the
109+ // title, e.g "connection to ert1", "ert archives".
110+ // Because they obscure the real title, I'll isolate and remove them.
111+
112+ QRegExp tmpComment = m_grCommentsinTitle;
113+ tmpComment.setMinimal(true);
114+ position = event.title.indexOf(tmpComment);
115+ if (position != -1)
116+ {
117+ event.title.replace(tmpComment.cap(0),"");
118+ }
119
120 // Sometimes the real (mostly English) title of a movie or series is
121 // enclosed in parentheses in the event title, subtitle or description.
122diff --git a/mythtv/libs/libmythtv/eitfixup.h b/mythtv/libs/libmythtv/eitfixup.h
123index 67cbcd0..c759868 100644
124--- a/mythtv/libs/libmythtv/eitfixup.h
125+++ b/mythtv/libs/libmythtv/eitfixup.h
126@@ -276,6 +276,7 @@ class EITFixUp
127 const QRegExp m_grSeries;
128 const QRegExp m_grRealTitleinDescription; // The original title is often in the descr in parenthesis.
129 const QRegExp m_grRealTitleinTitle; // The original title is often in the title in parenthesis.
130+ const QRegExp m_grCommentsinTitle; // Sometimes esp. national stations include comments in the title eg "(ert arxeio)"
131 const QRegExp m_grNotPreviouslyShown; // Not previously shown on TV
132 const QRegExp m_grEpisodeAsSubtitle; // Description field: "^Episode: Lion in the cage. (Description follows)"
133 const QRegExp m_grCategFood; // Greek category food
134diff --git a/mythtv/libs/libmythtv/eithelper.cpp b/mythtv/libs/libmythtv/eithelper.cpp
135index 845a7b4..56d62b9 100644
136--- a/mythtv/libs/libmythtv/eithelper.cpp
137+++ b/mythtv/libs/libmythtv/eithelper.cpp
138@@ -1411,6 +1411,7 @@ static void init_fixup(FixupMap &fix)
139 fix[ 100LL << 32 | 8492LL << 16 ] = // Ant1,Alpha,Art,10E
140 fix[ 102LL << 32 | 8492LL << 16 ] = // Mega,Star,SKAI,M.tv
141 fix[ 320LL << 32 | 8492LL << 16 ] = // Astra,Thessalia,TRT,TV10,ZEYS
142+ EITFixUp::kEFixForceISO8859_7 |
143 EITFixUp::kFixGreekEIT |
144 EITFixUp::kFixGreekCategories;
145 fix[ 2LL << 32 | 8492LL << 16 ] = // N1,Nplus,NHD,Vouli
146@@ -1419,6 +1420,16 @@ static void init_fixup(FixupMap &fix)
147 EITFixUp::kFixGreekEIT | // cut in db. Will move to descr.
148 EITFixUp::kFixGreekCategories;
149
150+ //DVB-S & S2 Greek Nova Provider
151+ // Hotbird 11823H DVB-S
152+ fix[ 5500LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
153+ // Hotbird 11938H DVB-S
154+ fix[ 6100LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
155+ // Hotbird 12130H DVB-S2
156+ fix[ 7100LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
157+ // Hotbird 12169H DVB-S2
158+ fix[ 7300LL << 32 | 318LL << 16 ] = EITFixUp::kEFixForceISO8859_7;
159+
160 // DVB-S Star One C2 70W (Brazil)
161 // it has original_network_id = 1 like Astra on 19.2E, but transport_id does
162 // not collide at the moment