[mythtv] Got some patches -- will these be OK ?

Håkon Alstadheim hakon at alstadheim.priv.no
Thu Oct 11 22:47:50 UTC 2012


I have some small patches that I use for mythtv 0.25. Seeing as the 
version is about to change, I should submit my patches /now/ i guess :-).

First Q: Will I need to patch against current head, or will 0.26-fixes 
be OK?

Second Q: The patch below touches several files and two/three itches of 
mine -- will I need to split the patch below ?
-- the files are: mythtv/libs/libmythtv/eitfixup.cpp, 
mythtv/libs/libmythtv/eitfixup.h, mythtv/libs/libmythtv/eithelper.cpp 
and themes/default/categories.xml
-- the itches are:
-- colour coding the schedule
-- getting repeat info into program data
-- getting episode info into program data
-- expanding Norwegian dvb-t fixups to more channels
-- slight consolidation with Norwegian dvb-s eit-fixups
-- introduce some verbose logging of Norwegian eit-fixup code.

Third Q: Can I leave my logging statements in (see patch pelow)

----------------------------------
diff --git a/mythtv/libs/libmythtv/eitfixup.cpp 
b/mythtv/libs/libmythtv/eitfixup.cpp
index 8148018..c6c4b32 100644
--- a/mythtv/libs/libmythtv/eitfixup.cpp
+++ b/mythtv/libs/libmythtv/eitfixup.cpp
@@ -8,6 +8,9 @@

#include "programinfo.h" // for subtitle types and audio and video 
properties
#include "dishdescriptors.h" // for dish_theme_type_to_string
+#include "mythlogging.h"
+
+#define LOC QString("EITFixup: ")

/*------------------------------------------------------------------------
* Event Fix Up Scripts - Turned on by entry in dtv_privatetype table
@@ -116,11 +119,16 @@ EITFixUp::EITFixUp()
m_nlOmroep ("\\s\\(([A-Z]+/?)+\\)$"),
m_noRerun("\\(R\\)"),
m_noColonSubtitle("^([^:]+): (.+)"),
- 
m_noNRKCategories("^(Superstrek[ea]r|Supersomm[ea]r|Superjul|Barne-tv|Fantorangen|Kuraffen|Supermorg[eo]n|Julemorg[eo]n|Sommermorg[eo]n|"
- "Kuraffen-TV|Sport i dag|NRKs sportsl.rdag|NRKs sportss.ndag|Dagens 
dokumentar|"
- "NRK2s 
historiekveld|Detektimen|Nattkino|Filmklassiker|Film|Kortfilm|P.skemorg[eo]n|"
+ 
m_noNRKCategories("^(P.askestrek[ea]r|Supert?strek[ea]r|Supert?somm[ea]r|Supert?jul"
+ "|Barne-tv|Fantorangen|Kuraffen|Supert?morg[eo]n|Julemorg[eo]n"
+ "|Somm[ea]rmorg[eo]n|P.skemorg[eo]n|Kuraffen-TV|Sport i dag"
+ "|NRKs sportsl.rdag|NRKs sportss.ndag|Dagens dokumentar"
+ "|Westernsomm[ea]r|Dokusomm[ea]r|St. *opp!?|NRK2s historiekveld"
+ "|Detektimen|Nattkino|Filmklassiker|Film|Kortfilm|Filmsomm[ea]r|"
"Radioteatret|Opera|P2-Akademiet|Nyhetsmorg[eo]n i P2 og Alltid 
Nyheter:): (.+)"),
- m_noPremiere("\\s+-\\s+(Sesongpremiere|Premiere|premiere)!?$"),
+ m_noEpisode("\\((\\d{1,3})\\/s(\\d{1,2})\\)", Qt::CaseInsensitive),
+ m_noSerie("\\((\\d{1,3}):(\\d{1,3})\\)"),
+ m_noPremiere("\\s+-\\s+(sesongpremiere|premiere)!?$", 
Qt::CaseInsensitive),
m_Stereo("\\b\\(?[sS]tereo\\)?\\b")

{
@@ -182,6 +190,9 @@ void EITFixUp::Fix(DBEventEIT &event) const
if (kFixNRK_DVBT & event.fixup)
FixNRK_DVBT(event);

+ if (kFixNO_Episode & event.fixup)
+ FixNO_Episode(event);
+
if (kFixCategory & event.fixup)
FixCategory(event);

@@ -1695,7 +1706,7 @@ void EITFixUp::FixCategory(DBEventEIT &event) const
}

/** \fn EITFixUp::FixNO(DBEventEIT&) const
- * \brief Use this to clean DVB-S guide in Norway.
+ * \brief Use this to clean DVB-S and DVB-T guide in Norway.
*/
void EITFixUp::FixNO(DBEventEIT &event) const
{
@@ -1706,6 +1717,13 @@ void EITFixUp::FixNO(DBEventEIT &event) const
event.previouslyshown = true;
event.title = event.title.replace(m_noRerun, "");
}
+ // Check for "(R)" in the description
+ position = event.description.indexOf(m_noRerun);
+ if (position != -1)
+ {
+ event.previouslyshown = true;
+ event.description = event.description.replace(m_noRerun, "");
+ }
}

/** \fn EITFixUp::FixNRK_DVBT(DBEventEIT&) const
@@ -1715,19 +1733,6 @@ void EITFixUp::FixNRK_DVBT(DBEventEIT &event) const
{
int position;
QRegExp tmpExp1;
- // Check for "title (R)" in the title
- position = event.title.indexOf(m_noRerun);
- if (position != -1)
- {
- event.previouslyshown = true;
- event.title = event.title.replace(m_noRerun, "");
- }
- // Check for "(R)" in the description
- position = event.description.indexOf(m_noRerun);
- if (position != -1)
- {
- event.previouslyshown = true;
- }
// Move colon separated category from program-titles into description
// Have seen "NRK2s historiekveld: Film: bla-bla"
tmpExp1 = m_noNRKCategories;
@@ -1765,3 +1770,45 @@ void EITFixUp::FixNRK_DVBT(DBEventEIT &event) const
}
}

+/** \fn EITFixUp::FixNO_Episode(DBEventEIT&) const
+ * \brief Parse episode like (10/s1) or (10:12)
+ */
+void EITFixUp::FixNO_Episode(DBEventEIT &event) const
+{
+ int position;
+ QRegExp tmpExp1;
+ QRegExp tmpExp2;
+
+ // No need to continue without a description.
+ if (event.description.length() <= 0)
+ return;
+
+ tmpExp1 = m_noEpisode;
+ if ((position = tmpExp1.indexIn(event.description)) != -1)
+ {
+ // Try to find episode numbers in description -- eg (10/s1)
+ uint episode = tmpExp1.cap(1).toUInt();
+ uint season = tmpExp1.cap(2).toUInt();
+ event.syndicatedepisodenumber =
+ QString("E%1S%2").arg(episode).arg(season);
+ event.categoryType = kCategorySeries;
+ LOG(VB_EIT, LOG_INFO, LOC +
+ "Fixing " + event.description + ". Inserted SxEy");
+
+ } else {
+ tmpExp2 = m_noSerie;
+ if ((position = tmpExp2.indexIn(event.description)) != -1)
+ {
+ // Try to find episode numbers in description -- eg (2:8)
+ LOG(VB_EIT, LOG_INFO, LOC +
+ "matched m_noSerie " + event.description);
+ if ((tmpExp2.cap(1).toUInt() <= tmpExp2.cap(2).toUInt())
+ && tmpExp2.cap(2).toUInt()<=50)
+ {
+ event.partnumber = tmpExp2.cap(1).toUInt();
+ event.parttotal = tmpExp2.cap(2).toUInt();
+ event.categoryType = kCategorySeries;
+ }
+ }
+ }
+}
diff --git a/mythtv/libs/libmythtv/eitfixup.h 
b/mythtv/libs/libmythtv/eitfixup.h
index a724506..102f85d 100644
--- a/mythtv/libs/libmythtv/eitfixup.h
+++ b/mythtv/libs/libmythtv/eitfixup.h
@@ -50,7 +50,8 @@ class EITFixUp
kFixCategory = 0x8000,
kFixNO = 0x10000,
kFixNRK_DVBT = 0x20000,
- kFixDish = 0x40000,
+ kFixNO_Episode = 0x40000,
+ kFixDish = 0x80000,

// Early fixups
kEFixForceISO8859_1 = 0x2000,
@@ -90,7 +91,7 @@ class EITFixUp
void FixCategory(DBEventEIT &event) const; // Generic Category fixes
void FixNO(DBEventEIT &event) const; // Norwegian DVB-S
void FixNRK_DVBT(DBEventEIT &event) const; // Norwegian NRK DVB-T
-
+ void FixNO_Episode(DBEventEIT &event) const; //Norwegian episode markers
static QString AddDVBEITAuthority(uint chanid, const QString &id);

const QRegExp m_bellYear;
@@ -192,6 +193,8 @@ class EITFixUp
const QRegExp m_noRerun;
const QRegExp m_noColonSubtitle;
const QRegExp m_noNRKCategories;
+ const QRegExp m_noEpisode;
+ const QRegExp m_noSerie;
const QRegExp m_noPremiere;
const QRegExp m_Stereo;
};
diff --git a/mythtv/libs/libmythtv/eithelper.cpp 
b/mythtv/libs/libmythtv/eithelper.cpp
index 9ee2cc8..46fe38c 100644
--- a/mythtv/libs/libmythtv/eithelper.cpp
+++ b/mythtv/libs/libmythtv/eithelper.cpp
@@ -857,25 +857,33 @@ static void init_fixup(QMap<uint64_t,uint> &fix)
fix[70U << 16] = EITFixUp::kFixNO;

// DVB-T NTV/NRK (Norway)
- fix[910LL << 32 | 8770U << 16 | 0x006f] = EITFixUp::kFixNRK_DVBT; 
//NRK Folkemusikk
- fix[910LL << 32 | 8770U << 16 | 0x0070] = EITFixUp::kFixNRK_DVBT; 
//NRK Stortinget
- fix[910LL << 32 | 8770U << 16 | 0x0071] = EITFixUp::kFixNRK_DVBT; 
//NRK Super
- fix[910LL << 32 | 8770U << 16 | 0x0072] = EITFixUp::kFixNRK_DVBT; 
//NRK Sport
- fix[910LL << 32 | 8770U << 16 | 0x0073] = EITFixUp::kFixNRK_DVBT; 
//NRK Gull
- fix[910LL << 32 | 8770U << 16 | 0x0074] = EITFixUp::kFixNRK_DVBT; 
//NRK Jazz
- fix[910LL << 32 | 8770U << 16 | 0x0067] = EITFixUp::kFixNRK_DVBT; 
//NRK Super / NRK3
- fix[910LL << 32 | 8770U << 16 | 0x0068] = EITFixUp::kFixNRK_DVBT; 
//NRK Tegnspr�
- fix[910LL << 32 | 8770U << 16 | 0x0069] = EITFixUp::kFixNRK_DVBT; //NRK P2
- fix[910LL << 32 | 8770U << 16 | 0x006a] = EITFixUp::kFixNRK_DVBT; //NRK P3
- fix[910LL << 32 | 8770U << 16 | 0x006b] = EITFixUp::kFixNRK_DVBT; 
//NRK Alltid Nyheter
- fix[910LL << 32 | 8770U << 16 | 0x006c] = EITFixUp::kFixNRK_DVBT; 
//NRK mP3
- fix[910LL << 32 | 8770U << 16 | 0x006d] = EITFixUp::kFixNRK_DVBT; 
//NRK Klassisk
- fix[910LL << 32 | 8770U << 16 | 0x006e] = EITFixUp::kFixNRK_DVBT; 
//NRK S�i Radio
- fix[910LL << 32 | 8770U << 16 | 0x0066] = EITFixUp::kFixNRK_DVBT; //NRK2
- fix[910LL << 32 | 8770U << 16 | 0x03f0] = EITFixUp::kFixNRK_DVBT; 
//NRK1 M�e og Romsdal
- fix[910LL << 32 | 8770U << 16 | 0x0455] = EITFixUp::kFixNRK_DVBT; 
//NRK P1 Tr�delag
- fix[910LL << 32 | 8770U << 16 | 0x03f1] = EITFixUp::kFixNRK_DVBT; 
//NRK1 Midtnytt
-
+ fix[910LL << 32 | 8770U << 16 | 0x0066] = //NRK2
+ fix[910LL << 32 | 8770U << 16 | 0x0067] = //NRK Super / NRK3
+ fix[910LL << 32 | 8770U << 16 | 0x0068] = //NRK Tegnspråk
+ fix[910LL << 32 | 8770U << 16 | 0x0069] = //NRK P2
+ fix[910LL << 32 | 8770U << 16 | 0x006a] = //NRK P3
+ fix[910LL << 32 | 8770U << 16 | 0x006b] = //NRK Alltid Nyheter
+ fix[910LL << 32 | 8770U << 16 | 0x006c] = //NRK mP3
+ fix[910LL << 32 | 8770U << 16 | 0x006d] = //NRK Klassisk
+ fix[910LL << 32 | 8770U << 16 | 0x006e] = //NRK Sami Radio
+ fix[910LL << 32 | 8770U << 16 | 0x006f] = //NRK Folkemusikk
+ fix[910LL << 32 | 8770U << 16 | 0x0070] = //NRK Stortinget
+ fix[910LL << 32 | 8770U << 16 | 0x0071] = //NRK Super
+ fix[910LL << 32 | 8770U << 16 | 0x0073] = //NRK Gull
+ fix[910LL << 32 | 8770U << 16 | 0x0074] = //NRK Jazz
+ fix[910LL << 32 | 8770U << 16 | 0x03f0] = //NRK1 Møre og Romsdal
+ fix[910LL << 32 | 8770U << 16 | 0x03f1] = //NRK1 Midtnytt
+ fix[910LL << 32 | 8770U << 16 | 0x0455] = //NRK P1 Trøndelag
+ EITFixUp::kFixNRK_DVBT|EITFixUp::kFixNO|EITFixUp::kFixNO_Episode;
+ // DVB-T NTV/TV 2 (Norway)
+ fix[920LL << 32 | 8770U << 16 | 0x00c9] = //TV 2 HD
+ fix[920LL << 32 | 8770U << 16 | 0x00ca] = //TV 2 Zebra
+ // DVB-T NTV/ -- some other commercial channels
+ fix[932LL << 32 | 8770U << 16 | 0x0133] = //TVNorge HD
+ fix[940LL << 32 | 8770U << 16 | 0x0075] = //TV3
+ fix[940LL << 32 | 8770U << 16 | 0x0076] = //Viasat 4
+ // fix[940LL << 32 | 8770U << 16 | 0x0077] = 
EITFixUp::kFixNoDisney_DVBT; //Disney Channel
+ EITFixUp::kFixNO|EITFixUp::kFixNO_Episode;
///////////////////////////////////////////////////////////////////////////
// Special Early fixups for providers that break DVB EIT spec.
// transport_id<<32 | network_id<<16 | service_id
diff --git a/mythtv/themes/default/categories.xml 
b/mythtv/themes/default/categories.xml
index f098171..37ddfc0 100644
--- a/mythtv/themes/default/categories.xml
+++ b/mythtv/themes/default/categories.xml
@@ -474,4 +474,63 @@
<catcolor category="Weather" color="DarkOrange3"></catcolor>
<catcolor category="Wrestling" color="DarkCyan"></catcolor>

+ <!-- Categories introduced by Norwegian dvb-t EIT -->
+ <!-- select distinct category from program order by category; -->
+ <catcolor category="Barn" color="MediumSlateBlue"></catcolor>
+ <catcolor category="Barneprogram (førskole)" 
color="MediumSlateBlue"></catcolor>
+ <catcolor category="Diverse lagidretter" color="DarkCyan"></catcolor>
+ <catcolor category="Drama" color="rosybrown3"></catcolor>
+ <catcolor category="Film" color="Blue"></catcolor>
+ <catcolor category="Film - Eventyrfilm/Western/Krig" 
color="maroon"></catcolor>
+ <catcolor category="Film - Komedie" color="DarkOrchid"></catcolor>
+ <catcolor category="Film - Krim/Spenning" color="maroon"></catcolor>
+ <catcolor category="Film - Science Fiction/Fantasi/Grøsser" 
color="DarkBlue"></catcolor>
+ <catcolor category="Film - Dramaserie" color="rosybrown3"></catcolor>
+ <catcolor category="Film - Seriøst/Klassisk/Religiøst/Historisk 
film/Drama" color="goldenrod"></catcolor>
+ <catcolor category="Film/Kino" color="Blue"></catcolor>
+ <catcolor category="Folkemusikk" color="goldenrod"></catcolor>
+ <catcolor category="Fotball" color="DarkCyan"></catcolor>
+ <catcolor category="Hagearbeid" color="#00ee00"></catcolor>
+ <catcolor category="Helse &amp; velvære" color="#00ffaa"></catcolor>
+ <catcolor category="Hestesport" color="DarkCyan"></catcolor>
+ <catcolor category="Hobby" color="red"></catcolor>
+ <catcolor category="Jazz" color="DarkRed"></catcolor>
+ <catcolor category="Kampsport" color="DarkCyan"></catcolor>
+ <catcolor category="Klassisk musikk" color="goldenrod"></catcolor>
+ <catcolor category="Kringkasting/Presse" color="DarkOrange3"></catcolor>
+ <catcolor category="Kunst" color="goldenrod"></catcolor>
+ <catcolor category="Kunst/Kultur" color="goldenrod"></catcolor>
+ <catcolor category="Litteratur" color="goldenrod"></catcolor>
+ <catcolor category="Matlaging" color="tan3"></catcolor>
+ <catcolor category="Medisin/Psykologi" color="CornflowerBlue"></catcolor>
+ <catcolor category="Mote" color="#a8cdea"></catcolor>
+ <catcolor category="Motorsport" color="DarkCyan"></catcolor>
+ <catcolor category="Musikal/Opera" color="turquoise3"></catcolor>
+ <catcolor category="Musikk/Ballett/Dans" color="DarkRed"></catcolor>
+ <catcolor category="Natur/Dyr/Miljø" color="#33ff99"></catcolor>
+ <catcolor category="Nyheter" color="DarkOrange3"></catcolor>
+ <catcolor category="Nyheter/Værmelding" color="DarkOrange3"></catcolor>
+ <catcolor category="Nyhetsmagasin" color="DarkOrange3"></catcolor>
+ <catcolor category="Nyhetsmagasiner" color="DarkOrange3"></catcolor>
+ <catcolor category="Reise" color="#aa00aa"></catcolor>
+ <catcolor category="Religion" color="goldenrod"></catcolor>
+ <catcolor category="Rock/Pop" color="DarkRed"></catcolor>
+ <catcolor category="Samfunn/Politikk/Økonomi" 
color="DarkOrange3"></catcolor>
+ <catcolor category="Sosiale vitenskaper" color="DarkOrange3"></catcolor>
+ <catcolor category="Sport" color="DarkCyan"></catcolor>
+ <catcolor category="Sportsmagasiner" color="DarkCyan"></catcolor>
+ <catcolor category="Språk" color="CornflowerBlue"></catcolor>
+ <catcolor category="Talk show" color="MediumTurquoise"></catcolor>
+ <catcolor category="Tegnefilm/Dukkefilm" color="#3333aa"></catcolor>
+ <catcolor category="Teknologi/Naturvitenskap" color="#33ff99"></catcolor>
+ <catcolor category="Underholdning" color="DarkOrchid"></catcolor>
+ <catcolor category="Underholdningsprogram fra 10 til 16 år" 
color="SlateBlue"></catcolor>
+ <catcolor category="Utdanning/Vitenskap/Fakta" color="#33ff99"></catcolor>
+ <catcolor category="Utland/Ekspedisjoners" color="#aa00aa"></catcolor>
+ <catcolor category="Vinteridrett" color="DarkCyan"></catcolor>
+ <catcolor category="Økonomi" color="DarkOrange3"></catcolor>
+ <catcolor category="Samfunn/Politikk/Økonomi" 
color="DarkOrange3"></catcolor>
+ <catcolor category="Kunst/Kultur" color="goldenrod"></catcolor>
+ <catcolor category="Musikk/Ballett/Dans" color="DarkRed"></catcolor>
+
</categorycolors>
-------------------------------
<EOT>



More information about the mythtv-dev mailing list