diff options
author | Jochen Dolze <vdr@dolze.de> | 2014-03-23 13:17:30 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2014-03-23 13:17:30 +0100 |
commit | 6ebfd7d88996c5c3483f045aaa5779d3ea250b18 (patch) | |
tree | 7e14f52da273bb6f450ad1302c4b728467ca7a27 | |
parent | 51bce0a6f0f23fb43e776184c2cac824df832553 (diff) | |
download | vdr-plugin-xmltv2vdr-6ebfd7d88996c5c3483f045aaa5779d3ea250b18.tar.gz vdr-plugin-xmltv2vdr-6ebfd7d88996c5c3483f045aaa5779d3ea250b18.tar.bz2 |
Ignore n.n. entries from eplists
-rw-r--r-- | import.cpp | 21 | ||||
-rw-r--r-- | parse.cpp | 35 |
2 files changed, 47 insertions, 9 deletions
@@ -1258,7 +1258,14 @@ bool cImport::AddShortTextFromEITDescription(cXMLTVEvent *xEvent, const char *EI if (epshorttext) { - xEvent->SetShortText(epshorttext); + if (strlen(epshorttext)>1) + { + xEvent->SetShortText(epshorttext); + } + else + { + xEvent->SetShortText(""); + } free(epshorttext); } xEvent->SetSeason(season); @@ -1311,7 +1318,17 @@ cXMLTVEvent *cImport::AddXMLTVEvent(cEPGSource *Source,sqlite3 *Db, const char * if (UseEPText) { if (eptitle) xevent->SetAltTitle(eptitle); - if (epshorttext) xevent->SetShortText(epshorttext); + if (epshorttext) + { + if (strlen(epshorttext)>1) + { + xevent->SetShortText(epshorttext); + } + else + { + xevent->SetShortText(""); + } + } } else { @@ -170,8 +170,6 @@ bool cParse::FetchSeasonEpisode(iconv_t cEP2ASCII, iconv_t cUTF2ASCII, const cha int &Season, int &Episode, int &EpisodeOverall, char **EPShortText, char **EPTitle) { - Season=0; - Episode=0; EpisodeOverall=0; // Title and ShortText are always UTF8 ! @@ -282,6 +280,8 @@ bool cParse::FetchSeasonEpisode(iconv_t cEP2ASCII, iconv_t cUTF2ASCII, const cha { slen=strlen(Description); if (slen>40) slen=40; + if (Season>0) f_season=Season; + if (Episode>0) f_episode=Episode; } if (!slen) { @@ -377,10 +377,21 @@ bool cParse::FetchSeasonEpisode(iconv_t cEP2ASCII, iconv_t cUTF2ASCII, const cha if ((f_season==Season) && (f_episode==Episode)) { - if (EPShortText) + if (!strcasecmp(epshorttext,"n.n.")) { - if (*EPShortText) free(*EPShortText); - *EPShortText=strdup(epshorttext); + if (EPShortText) + { + if (*EPShortText) free(*EPShortText); + *EPShortText=strdup(" "); + } + } + else + { + if (EPShortText) + { + if (*EPShortText) free(*EPShortText); + *EPShortText=strdup(epshorttext); + } } found=true; break; @@ -782,7 +793,7 @@ bool cParse::FetchEvent(xmlNodePtr enode, bool useeptext) node=node->next; } - int season,episode,episodeoverall; + int season=xevent.Season(),episode=xevent.Episode(),episodeoverall; char *epshorttext=NULL; char *eptitle=NULL; @@ -795,7 +806,17 @@ bool cParse::FetchEvent(xmlNodePtr enode, bool useeptext) xevent.SetEpisodeOverall(episodeoverall); if (epshorttext) { - if (useeptext) xevent.SetShortText(epshorttext); + if (useeptext) + { + if (strlen(epshorttext)>1) + { + xevent.SetShortText(epshorttext); + } + else + { + xevent.SetShortText(""); + } + } free(epshorttext); } } |