Ticket #12436: eitfixup-greek.diff

File eitfixup-greek.diff, 33.2 KB (added by Yianni Vidalis <yiannividalis@…>, 9 years ago)
Line 
1diff --git a/mythtv/libs/libmythtv/eitfixup.cpp b/mythtv/libs/libmythtv/eitfixup.cpp
2index 66881c6..cb50bf6 100644
3--- a/mythtv/libs/libmythtv/eitfixup.cpp
4+++ b/mythtv/libs/libmythtv/eitfixup.cpp
5@@ -31,7 +31,7 @@ const QString longSeasEp = QString("\\(?(?:%1)?\\s*%2").arg(season, longEp);
6 // Matches long seas/ep with surrounding parenthesis & trailing period
7 // cap1 = season, cap2 = ep, cap3 = total
8 const QString longContext = QString("\\(*%1\\s*\\)?\\s*\\.?").arg(longSeasEp);
9-
10+   
11 // Matches 3/4, 3 of 4
12 // cap1 = ep, cap2 = total
13 const QString shortEp = "(\\d+)\\s*(?:/|of)\\s*(\\d+)";
14@@ -133,7 +133,7 @@ EITFixUp::EITFixUp()
15       m_RTLSubtitle4("^Thema.{0,5}:\\s([^\\.]+)\\.\\s*"),
16       m_RTLSubtitle5("^'(.+)'\\.\\s*"),
17       m_RTLEpisodeNo1("^(Folge\\s\\d{1,4})\\.*\\s*"),
18-      m_RTLEpisodeNo2("^(\\d{1,2}\\/[IVX]+)\\.*\\s*"),
19+      m_RTLEpisodeNo2("^(\\d{1,2grlongEp}\\/[IVX]+)\\.*\\s*"),
20       m_fiRerun("\\ ?Uusinta[a-zA-Z\\ ]*\\.?"),
21       m_fiRerun2("\\([Uu]\\)"),
22       m_dePremiereInfos("([^.]+)?\\s?([0-9]{4})\\.\\s[0-9]+\\sMin\\.(?:\\sVon"
23@@ -184,7 +184,47 @@ EITFixUp::EITFixUp()
24       m_AUFreeviewSY("(.*) \\((.+)\\) \\(([12][0-9][0-9][0-9])\\)$"),
25       m_AUFreeviewY("(.*) \\(([12][0-9][0-9][0-9])\\)$"),
26       m_AUFreeviewYC("(.*) \\(([12][0-9][0-9][0-9])\\) \\((.+)\\)$"),
27-      m_AUFreeviewSYC("(.*) \\((.+)\\) \\(([12][0-9][0-9][0-9])\\) \\((.+)\\)$")
28+      m_AUFreeviewSYC("(.*) \\((.+)\\) \\(([12][0-9][0-9][0-9])\\) \\((.+)\\)$"),
29+      m_grReplay("\\([ΕE]\\)"),
30+      m_grDescriptionFinale("\\s*΀ελευταίο\\sΕπεισόΎιο\\.\\s*"),
31+      m_grActors("(?:[Ππ]α[ιί]ζουΜ:|[ΜΌ]ε τους:|ΠρωταγωΜιστο[υύ]Îœ:|ΠρωταγωΜιστε[ιί]:?)(?:\\s+στο ρόλο(?: του| της)?\\s(?:\\w+\\s[οη]\\s))?([-\\w\\s]+(?:,[-\\w\\s]+)*)(?:\\W?)"),
32+      // cap(1) actors, just names
33+      m_grPeopleSeparator("(,\\s+)"),
34+      m_grDirector("(?:ΣκηΜοΞεσία: |ΣκηΜοΞέτης: )(\\w+\\s\\w+\\s?)(?:\\W?)"),
35+      m_grPres("(?:Παρουσ[ιί]αση:(?:\\b)*|Παρουσι[αά]ζ(?:ουΜ|ει)(?::|\\sο|\\sη)|Με τ(?:οΜ |ηΜ )(?:[\\s|:|ο|η])*(?:\\b)*)([-\\w\\s]+(?:,[-\\w\\s]+)*)(?:\\W?)"),
36+      m_grYear("(?:\\W?)(?:\\s?παραγωγ[ηή]ς|\\s?-|,)\\s*([1-2]{1}[0-9]{3})",Qt::CaseInsensitive),
37+      m_grlongEp("\\b(?:Επ.|επεισ[οό]Ύιο:?)\\s*(\\d+)(?:\\W?)",Qt::CaseInsensitive),
38+      m_grSeason("(?:-\\s)?\\b((\\D{1,2})(?:')?|(\\d{1,2})(?:ος|ου)?)(?:\\sκ[υύ]κλο(?:[σς]|υ)){1}\\s?",Qt::CaseInsensitive),
39+      m_grRealTitleinDescription("(?:^\\()([\\w\\s\\d\\D-]+)(?:\\))(?:\\s*)"),
40+      // cap1 = real title
41+      // cap0 = real title in parentheses.
42+      m_grRealTitleinTitle("(?:\\()([\\w\\s\\d\\D-]+)(?:\\))(?:\\s*$)*"),
43+      // cap1 = real title
44+      // cap0 = real title in parentheses.
45+      m_grNotPreviouslyShown("(?:\\b[Α1]['η]?\\s*(?:τηλεοπτικ[ηή]\\s*)?(?:Όετ[αά]Ύοση|προβολ[ηή]))(?:\\W?)"),
46+      // Try to exctract Greek categories from keywords in description.
47+      m_grCategFood("(?:\\W)?(?:εκποΌπ[ηή]\\W)?(ΓαστροΜοΌ[ιί]α[σς]?|Όαγειρικ[ηή][σς]?|chef|συΜταγ[εέηή]|Ύιατροφ|wine|ÎŒ[αά]γειρα[σς]?)(?:\\W)?",Qt::CaseInsensitive),
48+      m_grCategDrama("(?:\\W)?(κοιΜωΜικ[ηήό]|ΎραΌατικ[ηή]|Ύρ[αά]Όα)(?:\\W)(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?",Qt::CaseInsensitive),
49+      m_grCategComedy("(?:\\W)?(κωΌικ[ηήοό]|χιουΌοριστικ[ηήοό]|κωΌωΎ[ιί]α)(?:\\W)(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?",Qt::CaseInsensitive),
50+      m_grCategChildren("(?:\\W)?(παιΎικ[ηήοό]|κιΜο[υύ]ÎŒ[εέ]Îœ(ωΜ|α)\\sσχ[εέ]ÎŽ[ιί](ωΜ|α))(?:\\W)(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?",Qt::CaseInsensitive),
51+      m_grCategMystery("(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?(?:\\W)?(Όυστηρ[ιί]ου)(?:\\W)?",Qt::CaseInsensitive),
52+      m_grCategFantasy("(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?(?:\\W)?(φαΜτασ[ιί]ας)(?:\\W)?",Qt::CaseInsensitive),
53+      m_grCategHistory("(?:\\W)?(ιστορικ[ηήοό])(?:\\W)?(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?",Qt::CaseInsensitive),
54+      m_grCategTeleMag("(?:\\W)?(εΜηΌερωτικ[ηή]|ψυχαγωγικ[ηή]|τηλεπεριοΎικ[οό]|Όαγκαζ[ιί]Μο)(?:\\W)?(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?",Qt::CaseInsensitive),
55+      m_grCategTeleShop("(?:\\W)?(οΎηγ[οό][σς]?\\sαγορ[ωώ]Îœ|τηλεπ[ωώ]λ[ηή]σ|τηλεαγορ|τηλεΌ[αά]ρκετ|telemarket)(?:\\W)?(?:(?:εκποΌπ[ηή]|σειρ[αά]|ταιΜ[ιί]α)\\W)?",Qt::CaseInsensitive),
56+      m_grCategGameShow("(?:\\W)?(τηλεπαιχΜ[ιί]Ύι|quiz)(?:\\W)?",Qt::CaseInsensitive),
57+      m_grCategDocumentary("(?:\\W)?(Μτοκ[ιυ]ΌαΜτ[εέ]ρ)(?:\\W)?",Qt::CaseInsensitive),
58+      m_grCategBiography("(?:\\W)?(βιογραφ[ιί]α|βιογραφικ[οό][σς]?)(?:\\W)?",Qt::CaseInsensitive),
59+      m_grCategNews("(?:\\W)?(Ύελτ[ιί]ο\\W?|ειΎ[ηή]σε(ι[σς]|ωΜ))(?:\\W)?",Qt::CaseInsensitive),
60+      m_grCategSports("(?:\\W)?(champion|αΞλητικ[αάοόηή]|πρωτ[αά]ΞληΌα|ποΎ[οό]σφαιρο(ου)?|κολ[υύ]Όβηση|πατιΜ[αά]ζ|formula|Όπ[αά]σκετ|β[οό]λε[ιϊ])(?:\\W)?",Qt::CaseInsensitive),
61+      m_grCategMusic("(?:\\W)?(Όουσικ[οόηή]|eurovision|τραγο[υύ]Ύι)(?:\\W)?",Qt::CaseInsensitive),
62+      m_grCategReality("(?:\\W)?(ρι[αά]λιτι|reality)(?:\\W)?",Qt::CaseInsensitive),
63+      m_grCategReligion("(?:\\W)?(Ξρησκε[ιί]α|Ξρησκευτικ|Μα[οό][σς]?|Ξε[ιί]α λειτουργ[ιί]α)(?:\\W)?",Qt::CaseInsensitive),
64+      m_grCategCulture("(?:\\W)?(τ[εέ]χΜ(η|ε[σς])|πολιτισΌ)(?:\\W)?",Qt::CaseInsensitive),
65+      m_grCategNature("(?:\\W)?(φ[υύ]ση|περιβ[αά]λλο|κατασκευ|επιστ[ηή]ÎŒ(?!οΜικ[ηή]ς φαΜτασ[ιί]ας))(?:\\W)?",Qt::CaseInsensitive),
66+      m_grCategSciFi("(?:\\W)?(επιστ(.|ηΌοΜικ[ηή]ς)\\s?φαΜτασ[ιί]ας)(?:\\W)?",Qt::CaseInsensitive),
67+      m_grCategHealth("(?:\\W)?(υγε[ιί]α|υγειιΜ|ιατρικ|Ύιατροφ)(?:\\W)?",Qt::CaseInsensitive),
68+      m_grCategSpecial("(?:\\W)?(αφι[εέ]ρωΌα)(?:\\W)?",Qt::CaseInsensitive)
69 {
70 }
71 
72@@ -262,6 +302,15 @@ void EITFixUp::Fix(DBEventEIT &event) const
73     if (kFixCategory & event.fixup)
74         FixCategory(event);
75 
76+    if (kFixGreekSubtitle & event.fixup)
77+        FixGreekSubtitle(event);
78+
79+    if (kFixGreekEIT & event.fixup)
80+        FixGreekEIT(event);
81+
82+    if (kFixGreekCategories & event.fixup)
83+        FixGreekCategories(event);
84+
85     if (event.fixup)
86     {
87         if (!event.title.isEmpty())
88@@ -2099,6 +2148,7 @@ void EITFixUp::FixNRK_DVBT(DBEventEIT &event) const
89 /** \fn EITFixUp::FixDK(DBEventEIT&) const
90  *  \brief Use this to clean YouSee's DVB-C guide in Denmark.
91  */
92+
93 void EITFixUp::FixDK(DBEventEIT &event) const
94 {
95     // Source: YouSee Rules of Operation v1.16
96@@ -2290,3 +2340,369 @@ void EITFixUp::FixDK(DBEventEIT &event) const
97     event.title       = event.title.trimmed();
98     event.subtitle    = event.subtitle.trimmed();
99 }
100+
101+// Movies the subtitle field into the description since it's just used
102+// as more description field. All the sort-out will happen in the description
103+// field. Also, sometimes the description is just a repeat of the title. If so,
104+// we remove it.
105+void EITFixUp::FixGreekSubtitle(DBEventEIT &event) const
106+{
107+    if (event.title == event.description)
108+    {
109+        event.description = QString("");
110+    }
111+    if (!event.subtitle.isEmpty())
112+    {
113+        event.description = event.subtitle.trimmed() + QString(" ") + event.description;
114+        event.subtitle = QString("");
115+    }
116+}
117+
118+void EITFixUp::FixGreekEIT(DBEventEIT &event) const
119+{
120+    //Live show
121+    int position;
122+    QRegExp tmpRegEx;
123+    position = event.title.indexOf("(Ζ)");
124+    if (position != -1)
125+    {
126+        event.title = event.title.replace("(Ζ)", "");
127+        event.description.prepend("ΖωΜταΜή ΜετάΎοση. ");
128+    }
129+
130+    // Greek not previously Shown
131+    position = event.title.indexOf(m_grNotPreviouslyShown);
132+    if (position != -1)
133+    {
134+        event.previouslyshown = false;
135+        event.title = event.title.replace(m_grNotPreviouslyShown.cap(0), "");
136+    }
137+
138+    // Greek Replay (Ε)
139+    // it might look redundant compared to previous check but at least it helps
140+    // remove the (Ε) From the title.
141+    tmpRegEx = m_grReplay;
142+    if (event.title.indexOf(tmpRegEx) !=  -1)
143+    {
144+        event.previouslyshown = true;
145+        event.title = event.title.replace(tmpRegEx, "");
146+    }
147+
148+    // Find actors and director in description
149+    // I am looking for actors first and then for directors/presenters because
150+    // sometimes punctuation is missing and the "ΠαίζουΜ:" label is mistaken
151+    // for a director's/presenter's surname (directors/presenters are shown
152+    // before actors in the description field.). So removing the text after
153+    // adding the actors AND THEN looking for dir/pres helps to clear things up.
154+    tmpRegEx = m_grActors;
155+    position = event.description.indexOf(tmpRegEx);
156+    if (position != -1)
157+    {
158+        QString tmpActorsString = tmpRegEx.cap(1);
159+        const QStringList actors =
160+            tmpActorsString.split(m_grPeopleSeparator, QString::SkipEmptyParts);
161+        QStringList::const_iterator it = actors.begin();
162+        for (; it != actors.end(); ++it)
163+        {
164+            tmpActorsString = it->split(":").last().trimmed().
165+                    remove(QRegExp("\\.$"));
166+            if (tmpActorsString != "")
167+                event.AddPerson(DBPerson::kActor, tmpActorsString);
168+        }
169+        event.description.replace(tmpRegEx.cap(0), "");
170+    }
171+    // Director
172+    tmpRegEx = m_grDirector;
173+    position = event.description.indexOf(tmpRegEx);
174+    if (position != -1)
175+    {
176+        QString tmpDirectorsString = tmpRegEx.cap(1);
177+        const QStringList directors =
178+            tmpDirectorsString.split(m_grPeopleSeparator, QString::SkipEmptyParts);
179+        QStringList::const_iterator it = directors.begin();
180+        for (; it != directors.end(); ++it)
181+        {
182+            tmpDirectorsString = it->split(":").last().trimmed().
183+                    remove(QRegExp("\\.$"));
184+            if (tmpDirectorsString != "")
185+            {
186+                event.AddPerson(DBPerson::kDirector, tmpDirectorsString);
187+            }
188+        }
189+        event.description.replace(tmpRegEx.cap(0), "");
190+    }
191+
192+/*
193+
194+    tmpRegEx = m_grDirector;
195+    position = event.description.indexOf(tmpRegEx);
196+    if (position != -1)
197+    {
198+        // director is captured in cap(1).Due to sometimes miswritten data in
199+        // eit, e.g no fullstop present(!)
200+        QString tmpDirectorsString = tmpRegEx.cap(1);
201+        // look for actors in director string (lack of fullstop, etc)
202+        tmpRegEx = m_grActors;
203+        int actposition = tmpDirectorsString.indexOf(tmpRegEx);
204+        if (actposition != -1)
205+        {
206+            tmpDirectorsString = tmpDirectorsString.replace(tmpRegEx,"");
207+        }
208+        const QStringList directors =
209+            tmpDirectorsString.split(m_grPeopleSeparator, QString::SkipEmptyParts);
210+        QStringList::const_iterator it = directors.begin();
211+        for (; it != directors.end(); ++it)
212+        {
213+            tmpDirectorsString = it->split(":").last().trimmed().
214+                    remove(QRegExp("\\.$"));
215+            if (tmpDirectorsString != "")
216+                event.AddPerson(DBPerson::kDirector, tmpDirectorsString);
217+           
218+        }
219+        event.description.replace(tmpRegEx.cap(0), "");
220+       // directorPresent = true;
221+    }
222+*/
223+    //Try to find presenter
224+    tmpRegEx = m_grPres;
225+    position = event.description.indexOf(tmpRegEx);
226+    if (position != -1)
227+    {
228+        QString tmpPresentersString = tmpRegEx.cap(1);
229+        const QStringList presenters =
230+            tmpPresentersString.split(m_grPeopleSeparator, QString::SkipEmptyParts);
231+        QStringList::const_iterator it = presenters.begin();
232+        for (; it != presenters.end(); ++it)
233+        {
234+            tmpPresentersString = it->split(":").last().trimmed().
235+                    remove(QRegExp("\\.$"));
236+            if (tmpPresentersString != "")
237+            {
238+                event.AddPerson(DBPerson::kPresenter, tmpPresentersString);
239+            }
240+        }
241+        event.description.replace(tmpRegEx.cap(0), "");
242+    }   
243+
244+    //find year e.g Παραγωγής 1966 ή Ν΀ΟΚΙΜΑΝ΀ΕΡ - 1998 Κατάλληλο για όλους
245+    // Used in Private channels (not 'secret', jut not owned by Government!)
246+    tmpRegEx = m_grYear;
247+    position = event.description.indexOf(tmpRegEx);
248+    if (position != -1)
249+    {
250+        bool ok;
251+        uint y = tmpRegEx.cap(1).toUInt(&ok);
252+        if (ok)
253+            event.originalairdate = QDate(y, 1, 1);
254+            event.description.replace(tmpRegEx, "");
255+    }
256+    // Remove white spaces
257+    event.description = event.description.trimmed();
258+    event.title       = event.title.trimmed();
259+    event.subtitle    = event.subtitle.trimmed();
260+
261+    // Work out the season and episode numbers (if any)
262+    // Matching pattern "Επεισ[όο]Ύιο:?|Επ 3 από 14|3/14" etc
263+    bool    series  = false;
264+    int position1;
265+    int position2;
266+    QRegExp tmpSeries = m_grSeason;
267+    // cap(2) is the season for ΑΒΓΔ
268+    // cap(3) is the season for 1234
269+    if ((position1 = tmpSeries.indexIn(event.title)) != -1
270+            || (position2 = tmpSeries.indexIn(event.description)) != -1)
271+    {
272+        if (!tmpSeries.cap(2).isEmpty()) // we found a letter representing a number
273+        {
274+            //sometimes Nat. TV writes numbers as letters, i.e Α=1, Β=2, Γ=3, etc
275+            //must convert them to numbers.
276+            int tmpinteger = tmpSeries.cap(2).toUInt();
277+            if (tmpinteger < 1)
278+            {
279+                if (tmpSeries.cap(2) == "Σ΀") // 6, don't ask!
280+                    event.season = 6;
281+                else
282+                {
283+                    QString LettToNumber = "0ΑΒΓΔΕ6ΖΗΘΙΚΛΜΝ";
284+                    tmpinteger = LettToNumber.indexOf(tmpSeries.cap(2));
285+                    if (tmpinteger != -1)
286+                        event.season = tmpinteger;
287+                }
288+            }
289+        }
290+        else if (!tmpSeries.cap(3).isEmpty()) //number
291+        {
292+            event.season = tmpSeries.cap(3).toUInt();
293+        }
294+        series = true;
295+        if (position1 != -1)
296+            event.title.replace(tmpSeries.cap(0),"");
297+        if (position2 != -1)
298+            event.description.replace(tmpSeries.cap(0),"");
299+    }
300+
301+    QRegExp tmpEpisode = m_grlongEp;
302+    //tmpEpisode.setMinimal(true);
303+    // cap(1) is the Episode No.
304+    if ((position1 = tmpEpisode.indexIn(event.title)) != -1
305+            || (position2 = tmpEpisode.indexIn(event.description)) != -1)
306+    {
307+        if (!tmpEpisode.cap(1).isEmpty())
308+        {
309+            event.episode = tmpEpisode.cap(1).toUInt();
310+            series = true;
311+            if (position1 != -1)
312+                event.title.replace(tmpEpisode.cap(0),"");
313+            if (position2 != -1)
314+                event.description.replace(tmpEpisode.cap(0),"");
315+        }
316+    }
317+
318+    // Sometimes the real (mostly English) title of a movie or series is
319+    // enclosed in parentheses in the event title, subtitle or description.
320+    // Since the subtitle has been moved to the description field by
321+    // EITFixUp::FixGreekSubtitle, I will search for it only in the description.
322+    // It will replace the translated one to get better chances of metadata
323+    // retrieval. The old title will be moved in the description.
324+    QRegExp tmptitle = m_grRealTitleinDescription;
325+    tmptitle.setMinimal(true);
326+    position = event.description.indexOf(tmptitle);
327+    if (position != -1)
328+    {
329+        event.description = event.description.replace(tmptitle, "");
330+        if (QString(tmptitle.cap(0)) != event.title.trimmed())
331+        {
332+            event.description = "(" + event.title.trimmed() + "). " + event.description;
333+        }
334+        event.title = tmptitle.cap(1);
335+        // Remove the real title from the description
336+    }
337+    else // search in title
338+    {
339+        tmptitle = m_grRealTitleinTitle;
340+        position = event.title.indexOf(tmptitle);
341+        if (position != -1) // found in title instead
342+        {
343+            event.title.replace(tmptitle.cap(0),"");
344+            QString tmpTranslTitle = event.title;
345+            //QString tmpTranslTitle = event.title.replace(tmptitle.cap(0),"");
346+            event.title = tmptitle.cap(1);
347+            event.description = "(" + tmpTranslTitle.trimmed() + "). " + event.description;
348+        }
349+    }
350+   
351+    if (series)
352+        event.categoryType = ProgramInfo::kCategorySeries;
353+
354+    // just for luck, retrim fields.
355+    event.description = event.description.trimmed();
356+    event.title       = event.title.trimmed();
357+    event.subtitle    = event.subtitle.trimmed();
358+
359+// Μα σβήσω τα κοΌΌάτια που Ï€ÎµÏÎ¹ÏƒÏƒÎµÏÎ¿Ï…Îœ από τηΜ περιγραφή πχ παραγωγής χχχχ
360+}
361+
362+void EITFixUp::FixGreekCategories(DBEventEIT &event) const
363+{
364+    //bool    RemoveFromDescr  = false; // if true, we will remove the category
365+                                      // text from the description field.
366+    // if keyword is not in the first 20 letters, don't bother.
367+    if (event.description.indexOf(m_grCategComedy) != -1)
368+    {
369+        event.category = "ΚωΌωΎία";
370+    }
371+    else if (event.description.indexOf(m_grCategNature) != -1)
372+    {
373+        event.category = "ΕπιστήΌη/Ίύση";
374+    }
375+    else if (event.description.indexOf(m_grCategHealth) != -1)
376+    {
377+        event.category = "Υγεία";
378+    }
379+    else if (event.description.indexOf(m_grCategReality) != -1)
380+    {
381+        event.category = "Ριάλιτι";
382+    }
383+    else if (event.description.indexOf(m_grCategDrama) != -1)
384+    {
385+        event.category = "ΔραΌατικό";
386+    }
387+    else if (event.description.indexOf(m_grCategChildren) != -1)
388+    {
389+        event.category = "ΠαιΎικό";
390+    }
391+    else if (event.description.indexOf(m_grCategSciFi) != -1)
392+    {
393+        event.category = "Επιστ.ΊαΜτασίας";
394+    }
395+    else if ((event.description.indexOf(m_grCategFantasy) != -1)
396+             && (event.description.indexOf(m_grCategMystery) != -1))
397+    {
398+        event.category = "ΊαΜτασίας/Μυστηρίου";
399+    }                                 
400+    else if (event.description.indexOf(m_grCategMystery) != -1)
401+    {
402+        event.category = "Μυστηρίου";
403+    }
404+    else if (event.description.indexOf(m_grCategFantasy) != -1)
405+    {
406+        event.category = "ΊαΜτασίας";
407+    }
408+    else if (event.description.indexOf(m_grCategHistory) != -1)
409+    {
410+        event.category = "Ιστορικό";
411+    }                                 
412+    else if (event.description.indexOf(m_grCategTeleShop) != -1
413+            || event.title.indexOf(m_grCategTeleShop) != -1)
414+    {
415+        event.category = "΀ηλεπωλήσεις";
416+    }
417+    else if (event.description.indexOf(m_grCategTeleMag) != -1)
418+    {
419+        event.category = "΀ηλεπεριοΎικό";
420+    }         
421+    else if (event.description.indexOf(m_grCategFood) != -1)
422+    {
423+        event.category = "ΓαστροΜοΌία";
424+    }
425+    else if (event.description.indexOf(m_grCategGameShow) != -1
426+             || event.title.indexOf(m_grCategGameShow) != -1)
427+    {
428+        event.category = "΀ηλεπαιχΜίΎι";
429+    }         
430+    else if (event.description.indexOf(m_grCategBiography) != -1)
431+    {
432+        event.category = "Βιογραφία";
433+    }         
434+    else if (event.title.indexOf(m_grCategNews) != -1)
435+    {
436+        event.category = "ΕιΎήσεις";
437+    }         
438+    else if (event.description.indexOf(m_grCategSports) != -1)
439+    {
440+        event.category = "ΑΞλητικά";
441+    }         
442+    else if (event.description.indexOf(m_grCategMusic) != -1
443+            || event.title.indexOf(m_grCategMusic) != -1)
444+    {
445+        event.category = "Μουσική";
446+    }     
447+    else if (event.description.indexOf(m_grCategDocumentary) != -1)
448+    {
449+        event.category = "ΝτοκιΌαΜτέρ";
450+    }
451+    else if (event.description.indexOf(m_grCategReligion) != -1)
452+    {
453+        event.category = "Θρησκεία";
454+    }
455+    else if (event.description.indexOf(m_grCategCulture) != -1)
456+    {
457+        event.category = "΀έχΜες/ΠολιτισΌός";
458+    }
459+    else if (event.description.indexOf(m_grCategSpecial) != -1)
460+    {
461+        event.category = "ΑφιέρωΌα";
462+    }
463+
464+}
465+
466diff --git a/mythtv/libs/libmythtv/eitfixup.h b/mythtv/libs/libmythtv/eitfixup.h
467index 802df82..2b851d2 100644
468--- a/mythtv/libs/libmythtv/eitfixup.h
469+++ b/mythtv/libs/libmythtv/eitfixup.h
470@@ -62,6 +62,11 @@ class EITFixUp
471         kEFixForceISO8859_2  = 1 << 23,
472         kEFixForceISO8859_9  = 1 << 24,
473         kEFixForceISO8859_15 = 1 << 25,
474+        kEFixForceISO8859_7  = 1 << 26,
475+
476+        kFixGreekSubtitle    = 1 << 27,
477+        kFixGreekEIT         = 1 << 28,
478+        kFixGreekCategories  = 1 << 29,
479     };
480 
481     EITFixUp();
482@@ -102,6 +107,9 @@ class EITFixUp
483     void FixNO(DBEventEIT &event) const;            // Norwegian DVB-S
484     void FixNRK_DVBT(DBEventEIT &event) const;      // Norwegian NRK DVB-T
485     void FixDK(DBEventEIT &event) const;            // Danish YouSee DVB-C
486+    void FixGreekSubtitle(DBEventEIT &event) const; // Greek Nat TV fix
487+    void FixGreekEIT(DBEventEIT &event) const;
488+    void FixGreekCategories(DBEventEIT &event) const; // Greek categories from descr.
489 
490     static QString AddDVBEITAuthority(uint chanid, const QString &id);
491 
492@@ -233,6 +241,41 @@ class EITFixUp
493     const QRegExp m_AUFreeviewY;//year
494     const QRegExp m_AUFreeviewYC;//year, cast
495     const QRegExp m_AUFreeviewSYC;//subtitle, year, cast
496+    const QRegExp m_grReplay; //Greek rerun
497+    const QRegExp m_grDescriptionFinale; //Greek last m_grEpisode
498+    const QRegExp m_grActors; //Greek actors
499+    const QRegExp m_grPeopleSeparator; // The comma that separates the actors.
500+    const QRegExp m_grDirector;
501+    const QRegExp m_grPres; // Greek Presenters for shows
502+    const QRegExp m_grYear; // ("[Ππ]αραγωγής\\s(\\d{4})")
503+    const QRegExp m_grlongEp; // Greek Episode
504+    const QRegExp m_grSeason; // Greek Season
505+    const QRegExp m_grSeries;
506+    const QRegExp m_grRealTitleinDescription; // The original title is often in the descr in parenthesis.
507+    const QRegExp m_grRealTitleinTitle; // The original title is often in the title in parenthesis.
508+    const QRegExp m_grNotPreviouslyShown; // Not previously shown on TV
509+    const QRegExp m_grCategFood; // Greek category food
510+    const QRegExp m_grCategDrama; // Greek category social/drama
511+    const QRegExp m_grCategComedy; // Greek category comedy
512+    const QRegExp m_grCategChildren; // Greek category for children / cartoons
513+    const QRegExp m_grCategFantasy; // Greek category for fantasy
514+    const QRegExp m_grCategMystery; // Greek category for mystery
515+    const QRegExp m_grCategHistory; //Greek category for historical movie/series
516+    const QRegExp m_grCategTeleMag; //Greek category for Telemagazine show
517+    const QRegExp m_grCategTeleShop; //Greek category for teleshopping
518+    const QRegExp m_grCategGameShow; //Greek category for game show
519+    const QRegExp m_grCategDocumentary; // Greek category for Documentaries
520+    const QRegExp m_grCategBiography; // Greek category for biography
521+    const QRegExp m_grCategNews; // Greek category for News
522+    const QRegExp m_grCategSports; // Greek category for Sports
523+    const QRegExp m_grCategMusic; // Greek category for Music
524+    const QRegExp m_grCategReality; // Greek category for reality shows
525+    const QRegExp m_grCategReligion; //Greek category for religion
526+    const QRegExp m_grCategCulture; //Greek category for Arts/Culture
527+    const QRegExp m_grCategNature; //Greek category for Nature/Science
528+    const QRegExp m_grCategSciFi;  // Greek category for Science Fiction
529+    const QRegExp m_grCategHealth; //Greek category for Health
530+    const QRegExp m_grCategSpecial; //Greek category for specials.
531 };
532 
533 #endif // EITFIXUP_H
534diff --git a/mythtv/libs/libmythtv/eithelper.cpp b/mythtv/libs/libmythtv/eithelper.cpp
535index b48bf45..0cf155e 100644
536--- a/mythtv/libs/libmythtv/eithelper.cpp
537+++ b/mythtv/libs/libmythtv/eithelper.cpp
538@@ -225,6 +225,7 @@ static void parse_dvb_event_descriptors(desc_list_t list, uint fix,
539     // from EN 300 468, Appendix A.2 - Selection of character table
540     unsigned char enc_1[3]  = { 0x10, 0x00, 0x01 };
541     unsigned char enc_2[3]  = { 0x10, 0x00, 0x02 };
542+    unsigned char enc_7[3]  = { 0x10, 0x00, 0x07 }; // Latin/Greek Alphabet
543     unsigned char enc_9[3]  = { 0x10, 0x00, 0x09 }; // could use { 0x05 } instead
544     unsigned char enc_15[3] = { 0x10, 0x00, 0x0f }; // could use { 0x0B } instead
545     int enc_len = 0;
546@@ -255,13 +256,21 @@ static void parse_dvb_event_descriptors(desc_list_t list, uint fix,
547     }
548 
549     // Is this broken DVB provider in Western Europe?
550-    // Use an encoding override of ISO 8859-15 (Latin6)
551+    // Use an encoding override of ISO 8859-15 (Latin9)
552     if (fix & EITFixUp::kEFixForceISO8859_15)
553     {
554         enc = enc_15;
555         enc_len = sizeof(enc_15);
556     }
557 
558+    // Is this broken DVB provider in Greece?
559+    // Use an encoding override of ISO 8859-7 (Latin/Greek)
560+    if (fix & EITFixUp::kEFixForceISO8859_7)
561+    {
562+        enc = enc_7;
563+        enc_len = sizeof(enc_7);
564+    }
565+
566     if (bestShortEvent)
567     {
568         ShortEventDescriptor sed(bestShortEvent);
569@@ -548,6 +557,32 @@ void EITHelper::AddEIT(const DVBEventInformationTable *eit)
570                 }
571                 category_type = content.GetMythCategory(0);
572             }
573+            else if (EITFixUp::kFixGreekEIT & fix)//Greek
574+            {
575+                ContentDescriptor content(content_data);
576+                switch (content.Nibble2(0))
577+                {
578+                    case 0x01:
579+                        category = "΀αιΜία";       // confirmed
580+                        break;
581+                    case 0x02:
582+                        category = "ΕΜηΌερωτικό";  // confirmed
583+                        break;
584+                    case 0x04:
585+                        category = "ΑΞλητικό";     // confirmed
586+                        break;
587+                    case 0x05:
588+                        category = "ΠαιΎικό";      // confirmed
589+                        break;
590+                    case 0x09:
591+                        category = "ΝτοκιΌαΜτέρ";  // confirmed
592+                        break;
593+                    default:
594+                        category = "";
595+                        break;
596+                }
597+                category_type = content.GetMythCategory(2);
598+            }
599             else
600             {
601                 ContentDescriptor content(content_data);
602@@ -1286,6 +1321,20 @@ static void init_fixup(QMap<uint64_t,uint> &fix)
603     // DVB-C T-Kábel Hungary
604     // FIXME this should be more specific. Is the encoding really wrong for all services?
605     fix[  100 << 16] = EITFixUp::kEFixForceISO8859_2;
606+
607+    // Greece
608+    // Pelion Transmitter
609+    // transport_id<<32 | netword_id<<16 | service_id
610+    fix[  100LL << 32 |  8492LL << 16 ] = // Ant1,Alpha,Art,10E
611+    fix[  102LL << 32 |  8492LL << 16 ] = // Mega,Star,SKAI,M.tv
612+    fix[  320LL << 32 |  8492LL << 16 ] = // Astra,Thessalia,TRT,TV10,ZEYS
613+        EITFixUp::kFixGreekEIT |
614+        EITFixUp::kFixGreekCategories;
615+    fix[    2LL << 32 |  8492LL << 16 ] = // N1,Nplus,NHD,Vouli
616+        EITFixUp::kEFixForceISO8859_7 |   // it is encoded in cp-1253
617+        EITFixUp::kFixGreekSubtitle |     // Subtitle has too much info and is
618+        EITFixUp::kFixGreekEIT |              // cut in db. Will move to descr.           
619+        EITFixUp::kFixGreekCategories;
620 }
621 
622 /** \fn EITHelper::RescheduleRecordings(void)
623diff --git a/mythtv/themes/default/categories.xml b/mythtv/themes/default/categories.xml
624index f098171..3565cfe 100644
625--- a/mythtv/themes/default/categories.xml
626+++ b/mythtv/themes/default/categories.xml
627@@ -474,4 +474,69 @@
628   <catcolor category="Weather" color="DarkOrange3"></catcolor>
629   <catcolor category="Wrestling" color="DarkCyan"></catcolor>
630 
631-</categorycolors>
632+  <!-- Categories introduced by Greek DVB-T channels -->
633+  <catcolor category="ΕΜηΌερωτικό" color="DarkOrange3"></catcolor>
634+  <catcolor category="΀αιΜία" color="Blue"></catcolor>
635+  <catcolor category="ΑΞλητικά" color="DarkCyan"></catcolor>
636+  <catcolor category="ΠοΎόσφαιρο" color="DarkCyan"></catcolor>
637+  <catcolor category="ΠαιΎικό" color="MediumSlateBlue"></catcolor>
638+  <catcolor category="ΝτοκιΌαΜτέρ" color="goldenrod"></catcolor>
639+  <catcolor category="ΕκπαιΎευτικό" color="CornflowerBlue"></catcolor>
640+  <catcolor category="Για ΕΜήλικες" color="thistle3"></catcolor>
641+  <catcolor category="Μιούζικαλ" color="turquoise3"></catcolor>
642+  <catcolor category="΀ηλεπεριοΎικό" color="DarkOrange3"></catcolor>
643+  <catcolor category="Ριάλιτι" color="sienna"></catcolor>
644+  <catcolor category="ΓαστροΜοΌία" color="tan3"></catcolor>
645+  <catcolor category="Ιατρικό" color="goldenrod"></catcolor>
646+  <catcolor category="Μυστηρίου" color="SlateGrey"></catcolor>
647+  <catcolor category="ΑστυΜοΌικό/Μυστηρίου" color="SlateGrey"></catcolor>
648+  <catcolor category="Μουσική" color="DarkRed"></catcolor>
649+  <catcolor category="Μουσικό αφιέρωΌα" color="#aa0000"></catcolor>
650+  <catcolor category="ΔραΌατικό" color="rosybrown3"></catcolor>
651+  <catcolor category="ΚοιΜωΜικό" color="rosybrown3"></catcolor>
652+  <catcolor category="Κλασσικό" color="grey62"></catcolor>
653+  <catcolor category="ΑστυΜοΌικό" color="MediumVioletRed"></catcolor>
654+  <catcolor category="ΑστυΜοΌικό ΔράΌα" color="MediumVioletRed"></catcolor>
655+  <catcolor category="Συζήτηση" color="MediumTurquoise"></catcolor>
656+  <catcolor category="Ζωα" color="ForestGreen"></catcolor>
657+  <catcolor category="ΓουέστερΜ" color="#bbbb00"></catcolor>
658+  <catcolor category="ΠολεΌικό" color="#dddd00"></catcolor>
659+  <catcolor category="ΑφιέρωΌα" color="#ee0000"></catcolor>
660+  <catcolor category="ΚωΌωΎία" color="DarkOrchid"></catcolor>
661+  <catcolor category="ΚωΌωΎία-ΎράΌα" color="#880099"></catcolor>
662+  <catcolor category="ΑισΞηΌατική κοΌεΜτί" color="#bbaa00"></catcolor>
663+  <catcolor category="ΚωΌική σειρά" color="#880088"></catcolor>
664+  <catcolor category="Ζωα" color="#00ff44"></catcolor>
665+  <catcolor category="Ίύση" color="#33ff99"></catcolor>
666+  <catcolor category="ΕπιστήΌη/Ίύση" color="#33ff99"></catcolor>
667+  <catcolor category="Επιστ.ΊαΜτασίας" color="#DD00DD"></catcolor>
668+  <catcolor category="ΊαΜτασίας/Επιστ.ΊαΜτασίας" color="DarkBlue"></catcolor>
669+  <catcolor category="ΊαΜτασίας" color="#996666"></catcolor>
670+  <catcolor category="ΊαΜτασίας/Μυστηρίου" color="#996666"></catcolor>
671+  <catcolor category="΀ρόΌου" color="firebrick3"></catcolor>
672+  <catcolor category="ΑγωΜίας" color="firebrick3"></catcolor>
673+  <catcolor category="Περιπέτεια" color="maroon"></catcolor>
674+  <catcolor category="ΑισΞηΌατικό" color="#ff9999"></catcolor>
675+  <catcolor category="ΓαστροΜοΌία/΀αΟίΎια" color="#aa00aa"></catcolor>
676+  <catcolor category="΀ουρισΌός/΀αΟίΎια" color="#aa00aa"></catcolor>
677+  <catcolor category="Υγεία" color="#00ffaa"></catcolor>
678+  <catcolor category="Σπίτι/ΊτιάΟτο ΌόΜος σου" color="Red"></catcolor>
679+  <catcolor category="Σπιτικές Βελτιώσεις" color="#00cc00"></catcolor>
680+  <catcolor category="ΊτιάΟτο ΌόΜος σου" color="#00aa00"></catcolor>
681+  <catcolor category="Σπίτι/κηπουρική" color="#00ee00"></catcolor>
682+  <catcolor category="ΠαιχΜίΎι" color="orchid"></catcolor>
683+  <catcolor category="ΑΜΞολογία" color="DarkOrchid"></catcolor>
684+  <catcolor category="ΚιΜ.ΣχέΎια" color="#3333aa"></catcolor>
685+  <catcolor category="΀ηλεπαιχΜίΎι" color="orchid"></catcolor>
686+  <catcolor category="ΓυΌΜαστική" color="#00dd99"></catcolor>
687+  <catcolor category="ΕΌπόριο/ΟικοΜοΌία" color="DarkOrange3"></catcolor>
688+  <catcolor category="ΑυτοκίΜητο" color="#a8bde8"></catcolor>
689+  <catcolor category="Βιογραφία" color="#e9ecf3"></catcolor>
690+  <catcolor category="ΜόΎα" color="#a8cdea"></catcolor>
691+  <catcolor category="ΣαπουΜόπερα" color="DarkOrchid"></catcolor>
692+  <catcolor category="Ιστορικό" color="DarkOrange1"></catcolor>   
693+  <catcolor category="΀ηλεπωλήσεις" color="#222200"></catcolor>
694+  <catcolor category="ΕιΎήσεις" color="DarkOrange3"></catcolor>
695+  <catcolor category="Θρησκεία" color="goldenrod"></catcolor>
696+  <catcolor category="΀έχΜες/ΠολιτισΌός" color="goldenrod"></catcolor>
697+  </categorycolors>