summaryrefslogtreecommitdiff
path: root/import.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2012-08-09 22:47:54 +0200
committerJochen Dolze <vdr@dolze.de>2012-08-09 22:47:54 +0200
commitdab5ddc6d04a3f26ca3552aebb051f4d437a7434 (patch)
treefb8185ac5a98e790d77fb65c6480edbbb2041af3 /import.cpp
parent13ef0038c75ec2a0e81712ee0cb2fae65c272da8 (diff)
downloadvdr-plugin-xmltv2vdr-dab5ddc6d04a3f26ca3552aebb051f4d437a7434.tar.gz
vdr-plugin-xmltv2vdr-dab5ddc6d04a3f26ca3552aebb051f4d437a7434.tar.bz2
Added check for soundex function
Diffstat (limited to 'import.cpp')
-rw-r--r--import.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/import.cpp b/import.cpp
index de5d2a7..672e924 100644
--- a/import.cpp
+++ b/import.cpp
@@ -1411,27 +1411,29 @@ cXMLTVEvent *cImport::SearchXMLTVEvent(sqlite3 **Db,const char *ChannelID, const
xevent=PrepareAndReturn(Db,sql);
if (xevent) return xevent;
- char wstr[128];
- if (SoundEx((char *) &wstr,(char *) Event->Title(),0,1)==0)
+ if (g->SoundEx())
{
- esyslog("soundex of '%s' failed",Event->Title());
- return NULL;
- }
-
- 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,alttitle,abs(starttime-%li) as diff from epg where " \
- " (starttime>=%li and starttime<=%li) and soundex(title)='%s' and channelid='%s' " \
- " order by diff,srcidx asc limit 1;",Event->StartTime(),Event->StartTime()-eventTimeDiff,
- Event->StartTime()+eventTimeDiff,wstr,ChannelID)==-1)
- {
- esyslog("out of memory");
- return NULL;
- }
+ char wstr[128];
+ if (SoundEx((char *) &wstr,(char *) Event->Title(),0,1)==0)
+ {
+ esyslog("soundex of '%s' failed",Event->Title());
+ return NULL;
+ }
- xevent=PrepareAndReturn(Db,sql);
- if (xevent) return xevent;
+ 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,alttitle,abs(starttime-%li) as diff from epg where " \
+ " (starttime>=%li and starttime<=%li) and soundex(title)='%s' and channelid='%s' " \
+ " order by diff,srcidx asc limit 1;",Event->StartTime(),Event->StartTime()-eventTimeDiff,
+ Event->StartTime()+eventTimeDiff,wstr,ChannelID)==-1)
+ {
+ esyslog("out of memory");
+ return NULL;
+ }
+ xevent=PrepareAndReturn(Db,sql);
+ if (xevent) return xevent;
+ }
return NULL;
}