Index: libs/libmythtv/eitfixup.cpp =================================================================== --- libs/libmythtv/eitfixup.cpp (Revision 11815) +++ libs/libmythtv/eitfixup.cpp (Arbeitskopie) @@ -24,16 +24,16 @@ m_ukYear("[\\[\\(]([\\d]{4})[\\)\\]]"), m_uk24ep("^\\d{1,2}:00[ap]m to \\d{1,2}:00[ap]m: "), m_comHemCountry("^(\\(.+\\))?\\s?([^ ]+)\\s([^\\.0-9]+)" - "(?:\\sfr�\\s([0-9]{4}))(?:\\smed\\s([^\\.]+))?\\.?"), + "(?:\\sfr�\\s([0-9]{4}))(?:\\smed\\s([^\\.]+))?\\.?"), m_comHemDirector("[Rr]egi"), - m_comHemActor("[Ss]k�espelare|[Ii] rollerna"), + m_comHemActor("[Ss]k�espelare|[Ii] rollerna"), m_comHemHost("[Pp]rogramledare"), m_comHemSub("[.\\?\\!] "), - m_comHemRerun1("[Rr]epris\\sfr�\\s([^\\.]+)(?:\\.|$)"), + m_comHemRerun1("[Rr]epris\\sfr�\\s([^\\.]+)(?:\\.|$)"), m_comHemRerun2("([0-9]+)/([0-9]+)(?:\\s-\\s([0-9]{4}))?"), m_comHemTT("[Tt]ext-[Tt][Vv]"), m_comHemPersSeparator("(, |\\soch\\s)"), - m_comHemPersons("\\s?([Rr]egi|[Ss]k�espelare|[Pp]rogramledare|" + m_comHemPersons("\\s?([Rr]egi|[Ss]k�espelare|[Pp]rogramledare|" "[Ii] rollerna):\\s([^\\.]+)\\."), m_comHemSubEnd("\\s?\\.\\s?$"), m_comHemSeries1("\\s?(?:[dD]el|[eE]pisode)\\s([0-9]+)" @@ -83,6 +83,9 @@ if (kFixMCA & event.fixup) FixMCA(event); + if (kFixDVBS & event.fixup) + FixDVBS(event); + if (event.fixup) { if (!event.title.isEmpty()) @@ -727,3 +730,46 @@ event.category_type = kCategoryMovie; } } +/** \fn EITFixUp::FixMCA(DBEvent&) const + * \brief Use this to standardise the DVB-S guide in Germany. + */ +void EITFixUp::FixDVBS(DBEvent &event) const +{ + const uint SUBTITLE_PCT = 35; //% of description to allow subtitle up to + const uint SUBTITLE_MAX_LEN = 128; // max length of subtitle field in db. + // int position; + QRegExp tmpExp1; + + // debugging ausgabe... aber wie event voll ausgeben + // ??? + // No need to continue without a description. + if (event.description.length() <= 0) + return; + + // Try to find subtitle in description, the same regex as in mca network + tmpExp1 = m_mcaSubtitle; + if ((position = tmpExp1.search(event.description)) != -1) + { + if ((tmpExp1.cap(1).length() < SUBTITLE_MAX_LEN) && + ((tmpExp1.cap(1).length()*100)/event.description.length() < + SUBTITLE_PCT)) + { + event.subtitle = tmpExp1.cap(1); + event.description = tmpExp1.cap(2); + } + } + + // Try to find episode numbers in subtitle + // tmpExp1 = m_DVBSSeries; + //if ((position = tmpExp1.search(event.subtitle)) != -1) + //{ + // uint season = tmpExp1.cap(1).toUInt(); + //uint episode = tmpExp1.cap(2).toUInt(); + //event.subtitle = tmpExp1.cap(3).stripWhiteSpace(); + //event.syndicatedepisodenumber = + // QString("E%1S%2").arg(episode).arg(season); + //event.category_type = kCategorySeries; + //} + + +} Index: libs/libmythtv/eithelper.cpp =================================================================== --- libs/libmythtv/eithelper.cpp (Revision 11815) +++ libs/libmythtv/eithelper.cpp (Arbeitskopie) @@ -626,6 +626,8 @@ // Premiere and Pro7/Sat.1 fix[133 << 16] = EITFixUp::kEFixForceISO8859_15; + // Sat.1 and Pro7 Subtitle fixes + fix[133 << 16] = EITFixUp::kEFixForceISO8859_15; }