Ticket #8483: nrk-eit-v2.diff
File nrk-eit-v2.diff, 6.9 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/eitfixup.cpp
8 8 9 9 #include "programinfo.h" // for subtitle types and audio and video properties 10 10 11 #define LOC QString("EITFixUp: ") 12 #define LOC_ERR QString("EITFixUp, Error: ") 13 11 14 /*------------------------------------------------------------------------ 12 15 * Event Fix Up Scripts - Turned on by entry in dtv_privatetype table 13 16 *------------------------------------------------------------------------*/ … … 102 105 m_nlCat("^(Amusement|Muziek|Informatief|Nieuws/actualiteiten|Jeugd|Animatie|Sport|Serie/soap|Kunst/Cultuur|Documentaire|Film|Natuur|Erotiek|Comedy|Misdaad|Religieus)\\.\\s"), 103 106 m_nlOmroep ("\\s\\(([A-Z]+/?)+\\)$"), 104 107 m_noRerun(" \\(R\\)"), 108 m_ColonSubtitle("^([^:]+): (.+)"), 109 m_NRKCategories("^(Supersommer|Superjul|Barne-tv|Fantorangen|Supermorgen|Julemorgen|Sommermorgen|Kuraffen-TV|Sport i dag|NRKs sportsl.rdag|NRKs sportss.ndag|Dagens dokumentar|NRK2s historiekveld|Detektimen|Nattkino|Filmklassiker|Film|Kortfilm|P.skemorgen|Radioteatret|Opera|P2-Akademiet|Nyhetsmorgen i P2 og Alltid Nyheter:): (.+)"), 110 m_noPremiere("\\s+-\\s+(Sesongpremiere|Premiere)!?$"), 105 111 m_Stereo("\\b\\(?[sS]tereo\\)?\\b") 106 112 107 113 { … … 157 163 if (kFixNO & event.fixup) 158 164 FixNO(event); 159 165 166 if (kFixNRK_DVBT & event.fixup){ // This should probably 167 FixNRK_DVBT(event); // be consolidated with 168 } // kFixNO. Testers welcome. 160 169 if (kFixCategory & event.fixup) 161 170 FixCategory(event); 162 171 … … 1513 1522 event.title = event.title.replace(m_noRerun, ""); 1514 1523 } 1515 1524 } 1525 1526 /** \fn EITFixUp::FixNRK_DVBT(DBEventEIT&) const 1527 * \brief Use this to clean DVB-T guide in Norway (NRK) 1528 */ 1529 void EITFixUp::FixNRK_DVBT(DBEventEIT &event) const 1530 { 1531 int position; 1532 QRegExp tmpExp1; 1533 tmpExp1 = m_NRKCategories; 1534 // Check for "title (R)" in the title 1535 position = event.title.indexOf(m_noRerun); 1536 if (position != -1) 1537 { 1538 event.previouslyshown = true; 1539 event.title = event.title.replace(m_noRerun, ""); 1540 } 1541 // Move colon separated category from program-titles into description 1542 // Have seen "NRK2s historiekveld: Film: bla-bla" 1543 while (((position = tmpExp1.indexIn(event.title)) != -1) && (tmpExp1.cap(2).length() > 1)){ 1544 event.title = tmpExp1.cap(2); 1545 event.description = "(" + tmpExp1.cap(1) + ") " + event.description; 1546 VERBOSE(VB_EIT, LOC + QString("Category ") + tmpExp1.cap(1) + QString(" moved") ); 1547 } 1548 // Remove season premiere markings 1549 tmpExp1 = m_noPremiere; 1550 if ((position = tmpExp1.indexIn(event.title)) >=3){ 1551 VERBOSE(VB_EIT, LOC + QString("Removing Premiere tag")); 1552 event.title.remove(m_noPremiere); 1553 } 1554 // Try to find colon-delimited subtitle in title, only tested for NRK channels 1555 tmpExp1 = m_ColonSubtitle; 1556 if (!event.title.startsWith("CSI:") && 1557 !event.title.startsWith("CD:") && 1558 !event.title.startsWith("Distriktsnyheter: fra")) 1559 { 1560 if ((position = tmpExp1.indexIn(event.title)) != -1) 1561 { 1562 1563 if (event.subtitle.length() <= 0) 1564 { 1565 event.title = tmpExp1.cap(1); 1566 event.subtitle = tmpExp1.cap(2); 1567 } else if (event.subtitle == tmpExp1.cap(2)) { 1568 event.title = tmpExp1.cap(1); 1569 } else { 1570 VERBOSE(VB_EIT, LOC + QString("Found colon, but it seems there already is a subtitle")); 1571 } 1572 } 1573 } 1574 } 1575 -
libs/libmythtv/eithelper.cpp
784 784 // DVB-S(2) Thor 0.8W Norwegian 785 785 fix[70U << 16] = EITFixUp::kFixNO; 786 786 787 // DVB-T NTV/NRK (Norway) 788 fix[910LL << 32 | 8770U << 16 | 0x006f] = EITFixUp::kFixNRK_DVBT; //NRK Folkemusikk 789 fix[910LL << 32 | 8770U << 16 | 0x0070] = EITFixUp::kFixNRK_DVBT; //NRK Stortinget 790 fix[910LL << 32 | 8770U << 16 | 0x0071] = EITFixUp::kFixNRK_DVBT; //NRK Super 791 fix[910LL << 32 | 8770U << 16 | 0x0072] = EITFixUp::kFixNRK_DVBT; //NRK Sport 792 fix[910LL << 32 | 8770U << 16 | 0x0073] = EITFixUp::kFixNRK_DVBT; //NRK Gull 793 fix[910LL << 32 | 8770U << 16 | 0x0074] = EITFixUp::kFixNRK_DVBT; //NRK Jazz 794 fix[910LL << 32 | 8770U << 16 | 0x0067] = EITFixUp::kFixNRK_DVBT; //NRK Super / NRK3 795 fix[910LL << 32 | 8770U << 16 | 0x0068] = EITFixUp::kFixNRK_DVBT; //NRK Tegnsprᅵ 796 fix[910LL << 32 | 8770U << 16 | 0x0069] = EITFixUp::kFixNRK_DVBT; //NRK P2 797 fix[910LL << 32 | 8770U << 16 | 0x006a] = EITFixUp::kFixNRK_DVBT; //NRK P3 798 fix[910LL << 32 | 8770U << 16 | 0x006b] = EITFixUp::kFixNRK_DVBT; //NRK Alltid Nyheter 799 fix[910LL << 32 | 8770U << 16 | 0x006c] = EITFixUp::kFixNRK_DVBT; //NRK mP3 800 fix[910LL << 32 | 8770U << 16 | 0x006d] = EITFixUp::kFixNRK_DVBT; //NRK Klassisk 801 fix[910LL << 32 | 8770U << 16 | 0x006e] = EITFixUp::kFixNRK_DVBT; //NRK Sᅵi Radio 802 fix[910LL << 32 | 8770U << 16 | 0x0066] = EITFixUp::kFixNRK_DVBT; //NRK2 803 fix[910LL << 32 | 8770U << 16 | 0x03f0] = EITFixUp::kFixNRK_DVBT; //NRK1 Mᅵe og Romsdal 804 fix[910LL << 32 | 8770U << 16 | 0x0455] = EITFixUp::kFixNRK_DVBT; //NRK P1 Trᅵdelag 805 fix[910LL << 32 | 8770U << 16 | 0x03f1] = EITFixUp::kFixNRK_DVBT; //NRK1 Midtnytt 806 //Missing service ids for NRK1 from other counties here. 807 //Should we allow all service ids ? 808 809 787 810 /////////////////////////////////////////////////////////////////////////// 788 811 // Special Early fixups for providers that break DVB EIT spec. 789 812 // transport_id<<32 | netword_id<<16 | service_id -
libs/libmythtv/eitfixup.h
49 49 kFixNL = 0x1000, 50 50 kFixCategory = 0x8000, 51 51 kFixNO = 0x10000, 52 52 kFixNRK_DVBT = 0x20000, 53 53 // Early fixups 54 54 kEFixForceISO8859_1 = 0x2000, 55 55 kEFixForceISO8859_15 = 0x4000, … … 87 87 void FixNL(DBEventEIT &event) const; // Netherlands DVB-C 88 88 void FixCategory(DBEventEIT &event) const; // Generic Category fixes 89 89 void FixNO(DBEventEIT &event) const; // Norwegian DVB-S 90 void FixNRK_DVBT(DBEventEIT &event) const; // NRK DVB-T 90 91 91 92 static QString AddDVBEITAuthority(uint chanid, const QString &id); 92 93 … … 175 176 const QRegExp m_nlCat; 176 177 const QRegExp m_nlOmroep; 177 178 const QRegExp m_noRerun; 179 const QRegExp m_ColonSubtitle; 180 const QRegExp m_NRKCategories; 181 const QRegExp m_noPremiere; 178 182 const QRegExp m_Stereo; 179 183 }; 180 184