diff options
-rw-r--r-- | import.cpp | 56 | ||||
-rw-r--r-- | maps.cpp | 4 | ||||
-rw-r--r-- | maps.h | 1 | ||||
-rw-r--r-- | parse.cpp | 16 | ||||
-rw-r--r-- | po/de_DE.po | 6 | ||||
-rw-r--r-- | po/it_IT.po | 5 | ||||
-rw-r--r-- | setup.cpp | 2 |
7 files changed, 74 insertions, 16 deletions
@@ -258,7 +258,6 @@ char *cImport::Add2Description(char *description, const char *Name, int Value) char *cImport::AddEOT2Description(char *description, bool checkutf8) { const char nbspUTF8[]={0xc2,0xa0,0}; - const char nbsp[]={0xa0,0}; if (checkutf8) { @@ -274,6 +273,7 @@ char *cImport::AddEOT2Description(char *description, bool checkutf8) } else { + const char nbsp[]={0xa0,0}; description=strcatrealloc(description,nbsp); } } @@ -884,6 +884,19 @@ bool cImport::PutEvent(cEPGSource *Source, sqlite3 *Db, cSchedule* Schedule, if (!Event) return false; + if ((Flags & USE_TITLE)==USE_TITLE) + { + if (xEvent->Title() && (strlen(xEvent->Title())>0)) + { + const char *dp=conv->Convert(xEvent->Title()); + if (!Event->Title() || strcmp(Event->Title(),dp)) + { + Event->SetTitle(dp); + changed|=CHANGED_TITLE; // title really changed + } + } + } + if ((Flags & OPT_SEASON_STEXTITLE)==OPT_SEASON_STEXTITLE) { if (xEvent->AltTitle() && (strlen(xEvent->AltTitle())>0)) @@ -1431,10 +1444,45 @@ cXMLTVEvent *cImport::SearchXMLTVEvent(sqlite3 **Db,const char *ChannelID, const return NULL; } - xevent=PrepareAndReturn(Db,sql); - if (xevent) return xevent; } - return NULL; + else + { + char *sqltitle=strdup(Event->Title()); + if (!sqltitle) + { + esyslog("out of memory"); + return NULL; + } + + string st=sqltitle; + + int reps; + reps=pcrecpp::RE("'").GlobalReplace("''",&st); + if (reps) + { + char *tmp_sqltitle=(char *) realloc(sqltitle,st.size()+1); + if (tmp_sqltitle) + { + sqltitle=tmp_sqltitle; + strcpy(sqltitle,st.c_str()); + } + } + + if (asprintf(&sql,"select channelid,eventid,starttime,duration,title,origtitle,shorttext,description," \ + "country,year,credits,category,review,rating,starrating,video,audio,season,episode," \ + "episodeoverall,pics,src,eiteventid,eitdescription,abs(starttime-%li) as diff from epg where " \ + " (starttime>=%li and starttime<=%li) and title='%s' and channelid='%s' " \ + " order by diff,srcidx asc limit 1;",Event->StartTime(),Event->StartTime()-eventTimeDiff, + Event->StartTime()+eventTimeDiff,sqltitle,ChannelID)==-1) + { + free(sqltitle); + esyslog("out of memory"); + return NULL; + } + free(sqltitle); + } + + return PrepareAndReturn(Db,sql); } bool cImport::Begin(cEPGSource *Source, sqlite3 *Db) @@ -244,7 +244,7 @@ void cEPGMapping::AddChannel(int ChannelNumber) } if (!found) { - tChannelID *tmp_channelids=(tChannelID *) realloc(channelids,(numchannelids+1)*sizeof(struct tChannelID)); + tChannelID *tmp_channelids=static_cast<tChannelID *>(realloc(channelids,(numchannelids+1)*sizeof(struct tChannelID))); if (tmp_channelids) { channelids=tmp_channelids; @@ -267,7 +267,7 @@ void cEPGMapping::ReplaceChannels(int NumChannelIDs, tChannelID *ChannelIDs) for (int i=0; i<NumChannelIDs; i++) { - tChannelID *tmp_channelids=(tChannelID *) realloc(channelids,(numchannelids+1)*sizeof(tChannelID)); + tChannelID *tmp_channelids=static_cast<tChannelID *>(realloc(channelids,(numchannelids+1)*sizeof(tChannelID))); if (tmp_channelids) { channelids=tmp_channelids; @@ -31,6 +31,7 @@ #define USE_AUDIO 0x200 #define USE_SEASON 0x400 #define USE_STARRATING 0x800 +#define USE_TITLE 0x1000 #define CREDITS_ACTORS 0x100000 #define CREDITS_DIRECTORS 0x200000 @@ -236,9 +236,10 @@ bool cParse::FetchSeasonEpisode(iconv_t cEP2ASCII, iconv_t cUTF2ASCII, const cha if (dname[0]==0) strn0cpy(dname,dirent->d_name,sizeof(dname)-1); - if (EPTitle && strcasecmp(Title,dname)) *EPTitle=strdup(dname); - - if ((!ShortText) && (!Description)) { + if (EPTitle && strcasecmp(Title,dname)) *EPTitle=strdup(dname); + + if ((!ShortText) && (!Description)) + { fclose(f); free(epfile); return false; @@ -253,12 +254,13 @@ bool cParse::FetchSeasonEpisode(iconv_t cEP2ASCII, iconv_t cUTF2ASCII, const cha slen=strlen(Description); if (slen>40) slen=40; } - if (!slen) { + if (!slen) + { fclose(f); free(epfile); return false; } - + size_t dlen=4*slen; char *dshorttext=(char *) calloc(dlen,1); if (!dshorttext) @@ -292,9 +294,9 @@ bool cParse::FetchSeasonEpisode(iconv_t cEP2ASCII, iconv_t cUTF2ASCII, const cha { if (line[0]=='#') continue; char epshorttext[256]=""; - char depshorttext[1024]=""; if (sscanf(line,"%3d\t%3d\t%5d\t%255c",&Season,&Episode,&EpisodeOverall,epshorttext)==4) { + char depshorttext[1024]=""; char *lf=strchr(epshorttext,'\n'); if (lf) *lf=0; slen=strlen(epshorttext); @@ -701,7 +703,7 @@ bool cParse::FetchEvent(xmlNodePtr enode, bool useeptext) int season,episode,episodeoverall; char *epshorttext=NULL; char *eptitle=NULL; - + if (FetchSeasonEpisode(cep2ascii,cutf2ascii,g->EPDir(),xevent.Title(),xevent.ShortText(), xevent.Description(),season,episode,episodeoverall,&epshorttext, &eptitle)) diff --git a/po/de_DE.po b/po/de_DE.po index aa5c7e0..bdfbf42 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2012-07-14 17:02+0200\n" +"POT-Creation-Date: 2012-08-13 18:38+0200\n" "PO-Revision-Date: 2010-12-23 23:59+0100\n" "Last-Translator: Jochen Dolze <vdr@dolze.de>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -172,6 +172,9 @@ msgstr "mischen" msgid "create" msgstr "erstellen" +msgid "title" +msgstr "Titel" + msgid "short text" msgstr "Kurztext" @@ -282,4 +285,3 @@ msgstr "xmltv2vdr plugin ist noch aktiv" msgid "Imports xmltv epg into vdr" msgstr "Importiert xmltv epg in den VDR" - diff --git a/po/it_IT.po b/po/it_IT.po index 48eb687..01d8183 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2012-07-14 16:59+0200\n" +"POT-Creation-Date: 2012-08-13 18:38+0200\n" "PO-Revision-Date: 2011-03-05 15:45+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -175,6 +175,9 @@ msgstr "Unisci" msgid "create" msgstr "Creare" +msgid "title" +msgstr "" + msgid "short text" msgstr "Testo breve" @@ -1076,11 +1076,13 @@ void cMenuSetupXmltv2vdrChannelMap::output(void) c1=Current(); if ((flags & OPT_APPEND)!=OPT_APPEND) { + Add(new cMyMenuEditBitItem(tr("title"),&flags,USE_TITLE),true); Add(new cMyMenuEditBitItem(tr("short text"),&flags,USE_SHORTTEXT),true); Add(new cMyMenuEditBitItem(tr("long text"),&flags,USE_LONGTEXT),true); } else { + Add(option(tr("title"),true),true); Add(option(tr("short text"),true),true); Add(option(tr("long text"),true),true); } |