All pastes #842868 Raw Edit

Untitled

public text v1 · immutable
#842868 ·published 2008-01-05 18:39 UTC
rendered paste body
Index: libs/libmythtv/eitfixup.cpp
===================================================================
--- libs/libmythtv/eitfixup.cpp (revision 15334)
+++ libs/libmythtv/eitfixup.cpp (working copy)
@@ -15,10 +15,9 @@
       m_bellPPVDescriptionAllDay("^\\(.*\\sEastern\\)"),
       m_bellPPVDescriptionAllDay2("^\\([0-9].*am-[0-9].*am\\sET\\)"),
       m_bellPPVDescriptionEventId("\\([0-9]{5}\\)"),
-      m_ukSubtitle("\\[.*S\\]"),
       m_ukThen("\\s*(Then|Followed by) 60 Seconds\\.", false),
       m_ukNew("\\s*(Brand New|New)\\s*(Series|Episode)\\s*[:\\.\\-]",false),
-      m_ukNew1("^New\\."),
+      m_ukNew1("New\\."),
       m_ukT4("^[tT]4:"),
       m_ukEQ("[:\\!\\?]"),
       m_ukEPQ("[:\\!\\.\\?]"),
@@ -41,6 +40,9 @@
       m_ukDoubleDotStart("^\\.\\.+"),
       m_ukDotSpaceStart("^\\. "),
       m_ukTime("\\d{1,2}[\\.:]\\d{1,2}\\s*(am|pm|)"),
+      m_ukBBC3("BBC THREE on BBC TWO\\.",false),
+      m_ukBBC4("BBC FOUR on BBC TWO\\.",false),
+      m_ukBBCSwitch("BBC Switch\\."),
       m_comHemCountry("^(\\(.+\\))?\\s?([^ ]+)\\s([^\\.0-9]+)"
                       "(?:\\sfrån\\s([0-9]{4}))(?:\\smed\\s([^\\.]+))?\\.?"),
       m_comHemDirector("[Rr]egi"),
@@ -344,13 +346,6 @@
     int position2;
     QString strFull;

-    position1 = event.description.find(m_ukSubtitle);
-    if (position1 != -1)
-    {
-        event.flags |= DBEvent::kSubtitled;
-        event.description.remove(m_ukSubtitle);
-    }
-
     // BBC three case (could add another record here ?)
     event.description = event.description.remove(m_ukThen);
     event.description = event.description.remove(m_ukNew);
@@ -362,6 +357,13 @@
     event.description = event.description.remove(m_ukCBBC);
     event.description = event.description.remove(m_ukCBeebies);

+    // Removal of BBC FOUR and BBC THREE
+    event.description = event.description.remove(m_ukBBC4);
+    event.description = event.description.remove(m_ukBBC3);
+
+    // Removal of BBC Switch
+    event.description = event.description.remove(m_ukBBCSwitch);
+
     // BBC 7 [Rpt of ...] case.
     event.description = event.description.remove(m_ukBBC7rpt);

@@ -369,7 +371,8 @@
     event.description = event.description.stripWhiteSpace();

     QRegExp tmp24ep = m_uk24ep;
-    if (!event.title.startsWith("CSI:") && !event.title.startsWith("CD:"))
+    if (!event.title.startsWith("CSI:") && !event.title.startsWith("CD:") &&
+        !event.title.startsWith("Non-Stop Q Music 24/7"))
     {
         if (((position1=event.title.find(m_ukDoubleDotEnd)) != -1) &&
             ((position2=event.description.find(m_ukDoubleDotStart)) != -1))
@@ -383,7 +386,6 @@
                      position1++;
                  event.title = strFull.left(position1);
                  event.description = strFull.mid(position1 + 1);
-                 event.description = event.description.remove(m_ukNew1);
                  SetUKSubtitle(event);
             }
             if ((position1 = strFull.find(m_ukYear)) != -1)
@@ -515,6 +517,9 @@
         {
             event.partnumber = tmpExp1.cap(1).toUInt();
             event.parttotal  = tmpExp1.cap(2).toUInt();
+            // Remove from the description
+            event.description = event.description.left(position1) +
+                event.description.mid(position1+tmpExp1.cap(0).length());
             series = true;
         }
     }
@@ -522,12 +527,18 @@
     {
         event.partnumber = tmpExp2.cap(2).toUInt();
         event.parttotal  = tmpExp2.cap(3).toUInt();
+        // Remove from the description
+        event.description = event.description.left(position1) +
+            event.description.mid(position1+tmpExp2.cap(0).length());
         series = true;
     }
     else if ((position1 = tmpExp3.search(event.description)) != -1)
     {
         event.partnumber = tmpExp3.cap(1).toUInt();
         event.parttotal  = tmpExp3.cap(2).toUInt();
+        // Remove from the description
+        event.description = event.description.left(position1) +
+            event.description.mid(position1+tmpExp3.cap(0).length());
         series = true;
     }
     if (series)
Index: libs/libmythtv/eitfixup.h
===================================================================
--- libs/libmythtv/eitfixup.h   (revision 15334)
+++ libs/libmythtv/eitfixup.h   (working copy)
@@ -79,7 +79,6 @@
     const QRegExp m_bellPPVDescriptionAllDay;
     const QRegExp m_bellPPVDescriptionAllDay2;
     const QRegExp m_bellPPVDescriptionEventId;
-    const QRegExp m_ukSubtitle;
     const QRegExp m_ukThen;
     const QRegExp m_ukNew;
     const QRegExp m_ukNew1;
@@ -104,6 +103,9 @@
     const QRegExp m_ukDoubleDotStart;
     const QRegExp m_ukDotSpaceStart;
     const QRegExp m_ukTime;
+    const QRegExp m_ukBBC3;
+    const QRegExp m_ukBBC4;
+    const QRegExp m_ukBBCSwitch;
     const QRegExp m_comHemCountry;
     const QRegExp m_comHemDirector;
     const QRegExp m_comHemActor;