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

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