1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Replacing control characters with blanks in EPG; deleting duplicate text in EPG's short text and description

This commit is contained in:
Klaus Schmidinger 2004-02-14 11:00:00 +01:00
parent 96055681fc
commit 6281a196f1

25
epg.c
View File

@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by * Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>. * 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" #include "epg.h"
@ -175,7 +175,7 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
return false; return false;
} }
#define MAXEPGBUGFIXSTATS 7 #define MAXEPGBUGFIXSTATS 8
#define MAXEPGBUGFIXCHANS 100 #define MAXEPGBUGFIXCHANS 100
struct tEpgBugFixStats { struct tEpgBugFixStats {
int hits; int hits;
@ -257,6 +257,13 @@ void cEvent::FixEpgBugs(void)
strreplace(title, '\n', ' '); strreplace(title, '\n', ' ');
strreplace(shortText, '\n', ' '); strreplace(shortText, '\n', ' ');
strreplace(description, '\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) if (Setup.EPGBugfixLevel == 0)
return; 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) // Some channels use the ` ("backtick") character, where a ' (single quote)
// would be normally used. Actually, "backticks" in normal text don't make // would be normally used. Actually, "backticks" in normal text don't make
// much sense, so let's replace them: // much sense, so let's replace them: