Ticket #2870: t

File t, 3.3 KB (added by anonymous, 13 years ago)

EIT text fixup

Line 
1diff -rc mythtv-trunk/mythtv/libs/libmythtv/eitfixup.cpp mythtv-trunk-EIT/mythtv/libs/libmythtv/eitfixup.cpp
2*** mythtv-trunk/mythtv/libs/libmythtv/eitfixup.cpp     Sun Dec 31 16:10:24 2006
3--- mythtv-trunk-EIT/mythtv/libs/libmythtv/eitfixup.cpp Thu Jan  4 13:13:50 2007
4***************
5*** 9,14 ****
6--- 9,20 ----
7  EITFixUp::EITFixUp()
8      : m_bellYear("[\\(]{1}[0-9]{4}[\\)]{1}"),
9        m_bellActors("\\set\\s|,"),
10+       m_bellPPVTitleAllDay("\\s*\\(All Day.*\\)\\s*$"),
11+       m_bellPPVTitleHD("^HD\\s?-\\s?"),
12+       m_bellPPVSubtitleAllDay("^All Day \\(.*\\sEastern\\)$"),
13+       m_bellPPVDescriptionAllDay("^\\(.*\\sEastern\\)"),
14+       m_bellPPVDescriptionAllDay2("^\\([0-9].*am-[0-9].*am\\sET\\)"),
15+       m_bellPPVDescriptionEventId("\\([0-9]{5}\\)"),
16        m_ukSubtitle("\\[.*S\\]"),
17        m_ukThen("\\s*(Then|Followed by) 60 Seconds\\.", false),
18        m_ukNew("\\s*(Brand New|New) Series\\s*[:\\.\\-]"),
19***************
20*** 198,203 ****
21--- 204,253 ----
22          event.flags |= DBEvent::kStereo;
23          event.description = event.description.replace("(Stereo)", "");
24      }
25+
26+     // Check for "title (All Day)" in the title
27+     position = event.title.find(m_bellPPVTitleAllDay);
28+     if (position != -1)
29+     {
30+         event.title = event.title.replace(m_bellPPVTitleAllDay, "");
31+     }
32+
33+     // Check for "HD - title" in the title
34+     position = event.title.find(m_bellPPVTitleHD);
35+     if (position != -1)
36+     {
37+         event.title = event.title.replace(m_bellPPVTitleHD, "");
38+         event.flags |= DBEvent::kHDTV;
39+     }
40+
41+     // Check for subtitle "All Day (... Eastern)" in the subtitle
42+     position = event.subtitle.find(m_bellPPVSubtitleAllDay);
43+     if (position != -1)
44+     {
45+         event.subtitle = event.subtitle.replace(m_bellPPVSubtitleAllDay, "");
46+     }
47+
48+     // Check for description "(... Eastern)" in the description
49+     position = event.description.find(m_bellPPVDescriptionAllDay);
50+     if (position != -1)
51+     {
52+         event.description = event.description.replace(m_bellPPVDescriptionAllDay, "");
53+     }
54+
55+     // Check for description "(... ET)" in the description
56+     position = event.description.find(m_bellPPVDescriptionAllDay2);
57+     if (position != -1)
58+     {
59+         event.description = event.description.replace(m_bellPPVDescriptionAllDay2, "");
60+     }
61+
62+     // Check for description "(nnnnn)" in the description
63+     position = event.description.find(m_bellPPVDescriptionEventId);
64+     if (position != -1)
65+     {
66+         event.description = event.description.replace(m_bellPPVDescriptionEventId, "");
67+     }
68+
69  }
70 
71  /** \fn EITFixUp::FixUK(DBEvent&) const
72diff -rc mythtv-trunk/mythtv/libs/libmythtv/eitfixup.h mythtv-trunk-EIT/mythtv/libs/libmythtv/eitfixup.h
73*** mythtv-trunk/mythtv/libs/libmythtv/eitfixup.h       Sun Dec 31 16:10:25 2006
74--- mythtv-trunk-EIT/mythtv/libs/libmythtv/eitfixup.h   Thu Jan  4 13:13:50 2007
75***************
76*** 61,66 ****
77--- 61,72 ----
78 
79      const QRegExp m_bellYear;
80      const QRegExp m_bellActors;
81+     const QRegExp m_bellPPVTitleAllDay;
82+     const QRegExp m_bellPPVTitleHD;
83+     const QRegExp m_bellPPVSubtitleAllDay;
84+     const QRegExp m_bellPPVDescriptionAllDay;
85+     const QRegExp m_bellPPVDescriptionAllDay2;
86+     const QRegExp m_bellPPVDescriptionEventId;
87      const QRegExp m_ukSubtitle;
88      const QRegExp m_ukThen;
89      const QRegExp m_ukNew;