diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-14 11:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-02-14 11:00:00 +0100 |
commit | 6281a196f14b42c2a67077207e313c71bda2ad2a (patch) | |
tree | d79cfaf3902e28b5d23c0f6216e01be568b00728 | |
parent | 96055681fcbcfdd287541372b4b00218a4b697cb (diff) | |
download | vdr-6281a196f14b42c2a67077207e313c71bda2ad2a.tar.gz vdr-6281a196f14b42c2a67077207e313c71bda2ad2a.tar.bz2 |
Replacing control characters with blanks in EPG; deleting duplicate text in EPG's short text and description
-rw-r--r-- | epg.c | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * - * $Id: epg.c 1.4 2004/01/09 15:22:18 kls Exp $ + * $Id: epg.c 1.5 2004/02/14 11:00:00 kls Exp $ */ #include "epg.h" @@ -175,7 +175,7 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule) return false; } -#define MAXEPGBUGFIXSTATS 7 +#define MAXEPGBUGFIXSTATS 8 #define MAXEPGBUGFIXCHANS 100 struct tEpgBugFixStats { int hits; @@ -257,6 +257,13 @@ void cEvent::FixEpgBugs(void) strreplace(title, '\n', ' '); strreplace(shortText, '\n', ' '); strreplace(description, '\n', ' '); + // Same for control characters: + strreplace(title, '\x86', ' '); + strreplace(title, '\x87', ' '); + strreplace(shortText, '\x86', ' '); + strreplace(shortText, '\x87', ' '); + strreplace(description, '\x86', ' '); + strreplace(description, '\x87', ' '); if (Setup.EPGBugfixLevel == 0) return; @@ -397,6 +404,20 @@ void cEvent::FixEpgBugs(void) } } + // Some channels put the same information into ShortText and Description. + // In that case we delete one of them: + if (shortText && description && strcmp(shortText, description) == 0) { + if (strlen(shortText) > MAX_USEFUL_EPISODE_LENGTH) { + free(shortText); + shortText = NULL; + } + else { + free(description); + description = NULL; + } + EpgBugFixStat(7, ChannelID()); + } + // Some channels use the ` ("backtick") character, where a ' (single quote) // would be normally used. Actually, "backticks" in normal text don't make // much sense, so let's replace them: |