1 | diff --git a/mythtv/libs/libmythtv/eitfixup.cpp b/mythtv/libs/libmythtv/eitfixup.cpp |
---|
2 | index 5d7a668a00..f88d728cb1 100644 |
---|
3 | --- a/mythtv/libs/libmythtv/eitfixup.cpp |
---|
4 | +++ b/mythtv/libs/libmythtv/eitfixup.cpp |
---|
5 | @@ -198,6 +198,7 @@ EITFixUp::EITFixUp() |
---|
6 | m_auFreeviewYC(R"((.*) \(([12][0-9][0-9][0-9])\) \((.+)\)$)"), |
---|
7 | m_auFreeviewSYC(R"((.*) \((.+)\) \(([12][0-9][0-9][0-9])\) \((.+)\)$)"), |
---|
8 | m_html("</?EM>", Qt::CaseInsensitive), |
---|
9 | + m_grRating("(?:(\\[[KÎ](?:(|8|12|16|18)\\]\\s*)))", Qt::CaseInsensitive), |
---|
10 | m_grReplay("\\([ÎE]\\)"), |
---|
11 | m_grDescriptionFinale("\\s*΀ελεÏ
Ïαίο\\sÎÏειÏÏΎιο\\.\\s*"), |
---|
12 | m_grActors("(?:[Î Ï]α[ιί]ζοÏ
Îœ:|[ÎMÎŒ]ε ÏοÏ
Ï:|Î ÏÏÏαγÏΜιÏÏο[Ï
Ï]Îœ:|Î ÏÏÏαγÏΜιÏÏε[ιί]:?)(?:\\s+ÏÏο ÏÏλο(?: ÏοÏ
| ÏηÏ)?\\s(?:\\w+\\s[οη]\\s))?([-\\w\\s']+(?:,[-\\w\\s']+)*)(?:κ\\.[αά])?(?:\\W?)"), |
---|
13 | @@ -211,7 +212,7 @@ EITFixUp::EITFixUp() |
---|
14 | m_grCountry("(?:\\W|\\b)(?:(ελληΜ|ÏοÏ
Ïκ|αΌεÏικ[αά]Îœ|γαλλ|αγγλ|βÏεÏÏ?αΜ|γεÏΌαΜ|ÏÏÏÏ?|ιÏαλ|ελβεÏ|ÏοÏ
ηΎ|ιÏÏαΜ|ÏοÏÏογαλ|ΌεΟικ[αά]Îœ|κιΜ[εÎ]ζικ|ιαÏÏÎœ|καΜαΎ|βÏαζιλι[αά]Îœ)(ικ[ηή][ÏÏ]))",Qt::CaseInsensitive), |
---|
15 | m_grlongEp("\\b(?:ÎÏ.|εÏειÏ[οÏ]Ύιο:?)\\s*(\\d+)(?:\\W?)",Qt::CaseInsensitive), |
---|
16 | m_grSeasonAsRomanNumerals(",\\s*([MDCLXVIÎΧ]+)$",Qt::CaseInsensitive), |
---|
17 | - m_grSeason("(?:\\W-?)*(?:\\(-\\s*)?\\b(([Î-Ω]{1,2})(?:'|Î)?|(\\d{1,2})(?:οÏ|οÏ
|oÏ|os)?)(?:\\s*κ[Ï
Ï]κλο(?:[ÏÏ]|Ï
)){1}\\s?",Qt::CaseInsensitive), |
---|
18 | + m_grSeason("(?:\\W-?)*(?:\\(-\\s*)?\\b(([Î-Ω|A|B|E|Z|H|I|K|M|N]{1,2})(?:'|Î)?|(\\d{1,2})(?:οÏ|οÏ
|oÏ|os)?)(?:\\s*[ÎκKk][Ï
Ï]κλο(?:[ÏÏ]|Ï
)){1}\\s?",Qt::CaseInsensitive), |
---|
19 | m_grRealTitleinDescription(R"((?:^\()([A-Za-z\s\d-]+)(?:\))(?:\s*))"), |
---|
20 | // cap1 = real title |
---|
21 | // cap0 = real title in parentheses. |
---|
22 | @@ -2601,9 +2602,23 @@ void EITFixUp::FixGreekSubtitle(DBEventEIT &event) |
---|
23 | |
---|
24 | void EITFixUp::FixGreekEIT(DBEventEIT &event) const |
---|
25 | { |
---|
26 | - //Live show |
---|
27 | + |
---|
28 | + int position; |
---|
29 | QRegExp tmpRegEx; |
---|
30 | - int position = event.m_title.indexOf("(Î)"); |
---|
31 | + |
---|
32 | + // Program ratings |
---|
33 | + tmpRegEx = m_grRating; |
---|
34 | + position = event.m_title.indexOf(tmpRegEx); |
---|
35 | + if (position != -1) |
---|
36 | + { |
---|
37 | + EventRating prograting; |
---|
38 | + prograting.m_system="GR"; prograting.m_rating = tmpRegEx.cap(1); |
---|
39 | + event.m_ratings.push_back(prograting); |
---|
40 | + event.m_title = event.m_title.replace(tmpRegEx.cap(1), "").trimmed(); |
---|
41 | + } |
---|
42 | + |
---|
43 | + //Live show |
---|
44 | + position = event.m_title.indexOf("(Î)"); |
---|
45 | if (position != -1) |
---|
46 | { |
---|
47 | event.m_title = event.m_title.replace("(Î)", ""); |
---|
48 | @@ -2773,8 +2788,49 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const |
---|
49 | // cap(2) is the season for ÎÎÎÎ |
---|
50 | // cap(3) is the season for 1234 |
---|
51 | int position1 = tmpSeries.indexIn(event.m_title); |
---|
52 | + if (position1 != -1) |
---|
53 | + { |
---|
54 | + if (!tmpSeries.cap(2).isEmpty()) // we found a letter representing a number |
---|
55 | + { |
---|
56 | + //sometimes Nat. TV writes numbers as letters, i.e Î=1, Î=2, Î=3, etc |
---|
57 | + //must convert them to numbers. |
---|
58 | + int tmpinteger = tmpSeries.cap(2).toUInt(); |
---|
59 | + if (tmpinteger < 1) |
---|
60 | + { |
---|
61 | + if (tmpSeries.cap(2) == "Σ΀") // 6, don't ask! |
---|
62 | + event.m_season = 6; |
---|
63 | + else |
---|
64 | + { |
---|
65 | + QString LettToNumber = "0ÎÎÎÎÎ6ÎÎÎÎÎÎÎÎ"; |
---|
66 | + tmpinteger = LettToNumber.indexOf(tmpSeries.cap(2)); |
---|
67 | + if (tmpinteger != -1) |
---|
68 | + event.m_season = tmpinteger; |
---|
69 | + else |
---|
70 | + //sometimes they use english letters instead of greek. Compensating: |
---|
71 | + { |
---|
72 | + LettToNumber = "0ABÎÎE6ZHÎIKÎMN"; |
---|
73 | + tmpinteger = LettToNumber.indexOf(tmpSeries.cap(2)); |
---|
74 | + if (tmpinteger != -1) |
---|
75 | + event.m_season = tmpinteger; |
---|
76 | + } |
---|
77 | + } |
---|
78 | + } |
---|
79 | + } |
---|
80 | + else if (!tmpSeries.cap(3).isEmpty()) //number |
---|
81 | + { |
---|
82 | + event.m_season = tmpSeries.cap(3).toUInt(); |
---|
83 | + } |
---|
84 | + series = true; |
---|
85 | + event.m_title.replace(tmpSeries.cap(0),""); |
---|
86 | + } |
---|
87 | + |
---|
88 | + // I have to search separately for season in title and description because it wouldn't work when in both. |
---|
89 | + series = false; |
---|
90 | + tmpSeries = m_grSeason; |
---|
91 | + // cap(2) is the season for ÎÎÎÎ |
---|
92 | + // cap(3) is the season for 1234 |
---|
93 | int position2 = tmpSeries.indexIn(event.m_description); |
---|
94 | - if ((position1 != -1) || (position2 != -1)) |
---|
95 | + if (position2 != -1) |
---|
96 | { |
---|
97 | if (!tmpSeries.cap(2).isEmpty()) // we found a letter representing a number |
---|
98 | { |
---|
99 | @@ -2799,11 +2855,10 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const |
---|
100 | event.m_season = tmpSeries.cap(3).toUInt(); |
---|
101 | } |
---|
102 | series = true; |
---|
103 | - if (position1 != -1) |
---|
104 | - event.m_title.replace(tmpSeries.cap(0),""); |
---|
105 | - if (position2 != -1) |
---|
106 | - event.m_description.replace(tmpSeries.cap(0),""); |
---|
107 | + event.m_description.replace(tmpSeries.cap(0),""); |
---|
108 | } |
---|
109 | + |
---|
110 | + |
---|
111 | // If Season is in Roman Numerals (I,II,etc) |
---|
112 | tmpSeries = m_grSeasonAsRomanNumerals; |
---|
113 | if ((position1 = tmpSeries.indexIn(event.m_title)) != -1 |
---|
114 | @@ -2954,6 +3009,8 @@ void EITFixUp::FixGreekEIT(DBEventEIT &event) const |
---|
115 | { |
---|
116 | event.m_categoryType = ProgramInfo::kCategorySeries; |
---|
117 | } |
---|
118 | + // clear double commas. |
---|
119 | + event.m_description.replace(",,", ","); |
---|
120 | // just for luck, retrim fields. |
---|
121 | event.m_description = event.m_description.trimmed(); |
---|
122 | event.m_title = event.m_title.trimmed(); |
---|
123 | diff --git a/mythtv/libs/libmythtv/eitfixup.h b/mythtv/libs/libmythtv/eitfixup.h |
---|
124 | index 6dbc10784a..6cc7068172 100644 |
---|
125 | --- a/mythtv/libs/libmythtv/eitfixup.h |
---|
126 | +++ b/mythtv/libs/libmythtv/eitfixup.h |
---|
127 | @@ -263,6 +263,7 @@ class MTV_PUBLIC EITFixUp |
---|
128 | const QRegExp m_auFreeviewYC;//year, cast |
---|
129 | const QRegExp m_auFreeviewSYC;//subtitle, year, cast |
---|
130 | const QRegExp m_html; |
---|
131 | + const QRegExp m_grRating; // Greek new parental rating system |
---|
132 | const QRegExp m_grReplay; //Greek rerun |
---|
133 | const QRegExp m_grDescriptionFinale; //Greek last m_grEpisode |
---|
134 | const QRegExp m_grActors; //Greek actors |
---|