From 6a61946d2e8513d6b37f6777f9739fb8350a9231 Mon Sep 17 00:00:00 2001 From: Jochen Dolze Date: Sun, 2 Sep 2012 22:32:13 +0200 Subject: Added handling of content descriptor Added tvm2xmltv .xsl and channellist .dist files --- dist/epgdata2xmltv/epgdata2xmltv.xsl | 454 +++++++++++++++++- dist/tvm2xmltv/tvm2xmltv.dist | 135 ++++++ dist/tvm2xmltv/tvm2xmltv.xsl | 881 +++++++++++++++++++++++++++++++++++ event.cpp | 1 - event.h | 1 - import.cpp | 69 ++- maps.h | 2 +- parse.cpp | 18 +- po/de_DE.po | 5 +- po/it_IT.po | 5 +- setup.cpp | 3 + 11 files changed, 1551 insertions(+), 23 deletions(-) create mode 100644 dist/tvm2xmltv/tvm2xmltv.dist create mode 100644 dist/tvm2xmltv/tvm2xmltv.xsl diff --git a/dist/epgdata2xmltv/epgdata2xmltv.xsl b/dist/epgdata2xmltv/epgdata2xmltv.xsl index b84ac9e..4482f7d 100644 --- a/dist/epgdata2xmltv/epgdata2xmltv.xsl +++ b/dist/epgdata2xmltv/epgdata2xmltv.xsl @@ -28,8 +28,442 @@ + + +G 10 +G 12 +G 10 +G 23 +G 10 +G 18 +G 13 +G 15 +G 14 +G 11 +G 76 +G 10 +G 10,60 +G 13 +G 16 +G 13 +G 11 +G 12 +G 10,55 +G 15 +G 15,12 +G 15 +G 15 +G 15,18 +G 15 +G 15,13 +G 15,14 +G 15 +G 15,11 +G 15,50 +G 15,13 +G 15,90 +G 15,13 +G 15,15 +G 15,11 +G 15,12 +G 15,55 +G 40 +G 4B +G 45 +G 43 +G 41 +G 40 +G 46 +G 45 +G 47 +G 40 +G 44 +G 48 +G 49 +G 45 +G 46 +G 45 +G 40 +G 40,23 +G 30 +G 30 +G 30 +G 30 +G 30 +G 31 +G 33 +G 30 +G A6 +G A5 +G A2 +G 90 +G 96 +G 81 +G A4 +G A3 +G 21 +G 91 +G 80 +G 82 +G A1 +G 80 +G 90 +G 81 +G 60 +G 64 +G 62 +G 65 +G 61 +G 63 +G 61 +G 61 +G 61 +G 60,30 +G 60,83 +G 60,71 +G 60,76 +G 60,70 +G 50 +G 50,10 +G 50,21 +G 50 +G 50,30 +G 55 +G 55 + + + -G + + + + +Spielfilm / Verschiedenes + + +Spielfilm / Abenteuer + + +Spielfilm / Action + + +Spielfilm / Dokumentarfilm + + +Spielfilm / Drama + + +Spielfilm / Erotik + + +Spielfilm / Fantasy + + +Spielfilm / Heimat + + +Spielfilm / Humor + + +Spielfilm / Krimi + + +Spielfilm / Kultur + + +Spielfilm / Kurzfilm + + +Spielfilm / Musik + + +Spielfilm / Mystery+Horror + + +Spielfilm / Romantik/Liebe + + +Spielfilm / Science Fiction + + +Spielfilm / Thriller + + +Spielfilm / Western + + +Spielfilm / Zeichentrick + + + + + + +Serie / Verschiedenes + + +Serie / Abenteuer + + +Serie / Action + + +Serie / Drama + + +Serie / Erotik + + +Serie / Familie + + +Serie / Fantasy + + +Serie / Humor + + +Serie / Krankenhaus + + +Serie / Krimi + + +Serie / Jugend + + +Serie / Mystery+Horror + + +Serie / Reality + + +Serie / Science Fiction + + +Serie / Soap + + +Serie / Thriller + + +Serie / Western + + +Serie / Zeichentrick + + + + + + +Sport / Verschiedenes + + +Sport / Boxen + + +Sport / Eishockey + + +Sport / Fussball + + +Sport / Olympia + + +Sport / Golf + + +Sport / Gymnastik + + +Sport / Handball + + +Sport / Motorsport + + +Sport / Radsport + + +Sport / Tennis + + +Sport / Wassersport + + +Sport / Wintersport + + +Sport / US-Sport + + +Sport / Leichtathletik + + +Sport / Volleyball + + +Sport / Extremsport + + +Sport / Reportagen + + + + + + +Show / Verschiedenes + + +Show / Erotik + + +Show / Reality + + +Show / Comedy + + +Show / Familien-Show + + +Show / Spielshows + + +Show / Talkshows + + +Show / Gerichtsshow + + +Show / Homeshopping + + +Show / Kochshow + + +Show / Heimwerken + + + + + + +Information / Verschiedenes + + +Information / Geschichte + + +Information / Magazin + + +Information / Gesundheit + + +Information / Motor+Verkehr + + +Information / Nachrichten + + +Information / Natur + + +Information / Politik + + +Information / Ratgeber + + +Information / Reise + + +Information / Wirtschaft + + +Information / Wissen + + +Information / Dokumentation + + + + + + +Kultur + Musik / Verschiedenes + + +Kultur + Musik / Jazz + + +Kultur + Musik / Klassik + + +Kultur + Musik / Musical + + +Kultur + Musik / Rock + + +Kultur + Musik / Volksmusik + + +Kultur + Musik / Alternative + + +Kultur + Musik / Pop + + +Kultur + Musik / Clips + + +Kultur + Musik / Show + + +Kultur + Musik / Interview + + +Kultur + Musik / Theater + + +Kultur + Musik / Kino + + +Kultur + Musik / Kultur + + + + + + +Kinder / Verschiedenes + + +Kinder / Filme + + +Kinder / Nachrichten + + +Kinder / Serien + + +Kinder / Shows + + +Kinder / Zeichentrick + + +Kinder / Anime + + + + @@ -206,6 +640,9 @@ G + + content = + @@ -269,12 +706,11 @@ G - - - - - - + + + + + @@ -287,8 +723,8 @@ G - - + + diff --git a/dist/tvm2xmltv/tvm2xmltv.dist b/dist/tvm2xmltv/tvm2xmltv.dist new file mode 100644 index 0000000..8659dd7 --- /dev/null +++ b/dist/tvm2xmltv/tvm2xmltv.dist @@ -0,0 +1,135 @@ +pipe;00:00;0;1 +1;15 +13th-street.de;501 +3sat.de;118 +animal-planet.de;568 +animax.de;629 +anixe.de;666 +ard.de;001 +arte.de;010 +atvplus.at;031 +austria9.at; +automotorsportchannel.de; +axntv.de;576 +bayern3.de;018 +beate-uhse-tv.de;544 +bibeltv.de;579 +blue-movie-1.de; +blue-movie-2.de; +blue-movie-3.de; +boomerang-tv.de;612 +br-alpha.de;057 +cartoon-network.de;627 +classica.de;508 +cnn.de;126 +das-vierte.de;067 +discovery-channel.de;510 +discovery-geschichte.de;572 +discovery-hd.de;614 +disney-channel.de;511 +dk1.dk;091 +dk2.dk;092 +dmax.de;554 +einsextra.de;551 +einsfestival.de;512 +einsplus.de;513 +espn-classic-sport.com;584 +euronews.de;013 +eurosport.de;107 +eurosport-2.de;630 +fashiontv.fr;607 +focus-gesundheit.de;573 +goldstar-tv.de;516 +gotv.at;703 +gute-laune-tv.de;601 +heimatkanal.de;517 +hessen3.de;026 +hh1.de;054 +history-channel.de;589 +hse24.de;189 +imusic1.de;716 +junior.de;518 +kabel1.de;008 +kabel-eins-classics.de;610 +kanal-7-int.tr;634 +kika.de;063 +kinowelt-tv.de;577 +k-tv.at;590 +mdr.de;032 +mezzotv.fr;633 +mgm.de;565 +motors-tv.fr;598 +mtv.de;109 +mtv-base.de;632 +mtv-dance.uk;592 +mtv-hits.uk;588 +muenchen-2.de;620 +n24.de;065 +national-geographic.de;593 +ndr.de;019 +nickcomedy.de;190:625 +nicktoons.de;662 +nl1.nl;088 +nl2.nl;089 +nl3.nl;090 +ntv.de;007 +orf1.at;014 +orf2.at;015 +phoenix.de;206 +planet.de;521 +playboy.de;582 +playhouse-disney.de;583 +prosieben.de;006 +rbb.de;027 +rtl.de;004 +rtl2.de;009 +rtl-crime.de;621 +rtl-living.de;622 +rtl-passion.de;623 +rtlshop.de;574 +rtlnitro.de;763 +sailing-channel.it;600 +sat1.de;005 +sat1-comedy.de;611 +sci-fi.de;541 +servustv.at;719 +sf1.ch;024 +sf2.ch;039 +silverline-tv.de;578 +sixx.de;696 +sky-action.de;402 +sky-cinema-1.de; +sky-cinema-24.de; +sky-cinema-hits.de;401 +sky-cinema.de;667 +sky-comedy.de; +sky-emotion.de; +sky-fussball-bundesliga.de; +sky-krimi.de; +sky-nostalgie.de; +sky-sport-1.de; +sky-sport-2.de; +sky-sport-austria.at; +sonnenklartv.de; +spiegel-geschichte.de; +spiegel-tv.de; +sport1.de;012 +sportdigitaltv.de; +spiegel-tv.de;605 +superrtl.de;179 +swr.de;029 +tele5.de;105 +tracetv.fr;602 +turner-classic-movies.de;628 +tv5.de;133 +tv-berlin.de;038 +tv-gusto-premium.de;597 +tv-muenchen.de;044 +viva.de;121 +vox.de;011 +wdr.de;028 +wetter-fernsehen.de;595 +zdf.de;002 +zdfinfo.de;570 +zdfkultur.de;725 +zdfneo.de;553 diff --git a/dist/tvm2xmltv/tvm2xmltv.xsl b/dist/tvm2xmltv/tvm2xmltv.xsl new file mode 100644 index 0000000..47ecced --- /dev/null +++ b/dist/tvm2xmltv/tvm2xmltv.xsl @@ -0,0 +1,881 @@ + + + + + + + + + + + + + + + + + + + file:///var/lib/epgsources/tvm2xmltv-img/ + + + + + + + + + [ + + ] + + + + + + + + + + + + /3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dolby + + + dolby digital + + + stereo + + + surround + + + bilingual + + + + + + + no + + + + 16:9 + + + + HDTV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +G 81 +G 81 + + + + + +G 12,15 + + + + +G 10,15 + + + + +G 10 +G 10 + + + + +G 81,23 +G 54 +G 81 +G 83 +G 81 +G 82 +G 92 + + + + +G 14 +G 14,10 +G 14 + + + + +G 23,81 + + + + +G 81,A5 +G 15,A5 + + + + +G 15,11 +G 15 +G 15,10 +G 15,10 +G 15 +G 15 +G 15 + + + + +G 12 +G 10 +G 14 +G 10 +G 14 +G 18 +G 14 +G 13 +G 15 +G 53 +G 10 +G 10 +G 14 +G 11 +G 16 +G 16 +G 16,14 +G 75,10 +G 50 +G 10 +G 10 +G 10 +G 16,14 +G 13 +G 13 +G 13 +G 53,14 +G 10 +G 10 +G 55 + + + + +G 90,23 +G 90 +G 92 + + + + +G 23 + + + + +G 30 +G 30 +G 30,14 +G 30,A5 +G 30,60 +G 30,60 +G 30 +G 31 + + + + +G 15 + + + + +G 53,15 +G 52,15 +G 50,15 + + + + +G 14 + + + + +G 10,15 +G 10,15 +G 10,15 +G 10,15 + + + + +G 77 +G 70,23,7A +G 70,33 +G 70,50 +G 76 +G 7A +G 77 +G 7A +G 7A +G 70,83 + + + + +G 55,83 +G 55,23 +G 55,10 +G 55,53 +G 55,53,10 +G 55,14 +G 55,65 +G 55,60 + + + + +G 75 +G 75,33 +G 75,83 + + + + +G 30 + + + + +G A0,23 +G A0,15 +G A0 +G A0 + + + + +G 60,23 +G 60 +G 60 +G 60 +G A6,60 + + + + +G 20,54 +G 21 +G 22 +G 20,41 +G 21 + + + + +G A0,23 +G A0 +G A0,23 + + + + +G 81 +G 80,33 +G 81 +G 80,33 +G 81 +G 81 +G 81 +G 81 + + + + +G A6 + + + + +G 31 +G 31 + + + + +G 30 + + + + +G 80,23 +G 80,15 +G 80,11 +G 81 + + + + +G A1 +G A1,15 +G A1 +G A1,23 +G A1 +G A1 + + + + +G 73 +G 73,23 +G 73,33 +G 73 +G 73 + + + + +G 13 +G 13 +G 13 +G 13 + + + + +G A6 + + + + +G 81 +G 81 +G 81 +G 81 +G 81 +G 80,15 +G 81 +G 80,33 +G 80 +G 81,50 +G 81,7A +G 81 +G 81 +G 81,22 +G 83 +G 82 +G 81 +G 81 +G 81 + + + + +G 12 +G 12,14 +G 12 +G 10 +G 10 +G 13 +G 14 +G 11 +G 10 +G 14,11 +G 11 +G 55 +G 16,14 +G 17 +G 55 +G 10 +G 13 +G 13 +G 11 +G 11 +G 17 +G 12 +G 10 +G 13 +G 13 +G 13,14 +G 13 +G 17,53 +G 10 +G 10 +G 50 +G 50 +G 14 +G 12 +G 11 +G 11 +G 11,14 +G 16 +G 16,14 +G 17 +G 13 +G 10 +G 14 +G 10 +G 14,12 +G 65 +G 10 +G 12 +G 10 +G 10 +G 10 +G 16,14 +G 14 +G 13 +G 13 +G 13,14 +G 13 +G 10 +G 60 +G 14,53 +G 10 +G 14 +G 14,55 +G 12 +G 12 +G 12,14 +G 55 +G 55,14 + + + + +G 40 +G 4B +G 41 +G 47 +G 43 +G 46 +G 47 +G 42 +G 42 +G 42,41 + + + + +G 33 + + + + +G A3 +G 92 +G 92 + + + + +G A0,91 +G A0,15,91 +G A0,91 +G A0,91 +G A0,91 + + + + +G 91 +G 91 +G 91 + + + + +G 15 +G 15,22 +G 15 +G 54 +G 15 +G 15 +G A6 +G 15 + + + + +G A3 +G A1,A3 +G A3,15 +G A3 +G A3 +G A3 + + + + +G 81 +G 15 +G 81 +G 81 + + + + + +G 55 +G 55 +G 55 +G 55 +G 55 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pid = + +<xsl:value-of select="Titel"/> + +<xsl:value-of select="$ORIGTITLE"/> + + + + + + + + + + + + + + + + + + content = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -PT2H + -PT1H + + + -PT1H + + + + + + + + diff --git a/event.cpp b/event.cpp index cb048cc..ae33002 100644 --- a/event.cpp +++ b/event.cpp @@ -631,7 +631,6 @@ void cXMLTVEvent::Clear() episodeoverall=0; parentalRating=0; weakid=false; - memset(&contents,0,sizeof(contents)); } cXMLTVEvent::cXMLTVEvent() diff --git a/event.h b/event.h index da51e85..01c6fc9 100644 --- a/event.h +++ b/event.h @@ -61,7 +61,6 @@ private: cXMLTVStringList starrating; cXMLTVStringList pics; int parentalRating; - uchar contents[MaxEventContents]; char *removechar(char *s, char what); public: cXMLTVEvent(); diff --git a/import.cpp b/import.cpp index 7294d97..4813a77 100644 --- a/import.cpp +++ b/import.cpp @@ -529,12 +529,16 @@ char *cImport::Add2Description(char *description, cXMLTVEvent *xEvent, int Flags if (text) { cXMLTVStringList *categories=xEvent->Category(); - description=Add2Description(description,text->Value(),(*categories)[0]); + // prevent duplicates + if ((*categories)[0][0]!='G' && (*categories)[0][1]!=' ') + description=Add2Description(description,text->Value(),(*categories)[0]); for (int i=1; iSize(); i++) { - // prevent duplicates if (strcasecmp((*categories)[i],(*categories)[i-1])) - description=Add2Description(description,text->Value(),(*categories)[i]); + { + if ((*categories)[i][0]!='G' && (*categories)[i][1]!=' ') + description=Add2Description(description,text->Value(),(*categories)[i]); + } } } } @@ -995,6 +999,63 @@ bool cImport::PutEvent(cEPGSource *Source, sqlite3 *Db, cSchedule* Schedule, } #endif +#if VDRVERSNUM >= 10712 || EPGHANDLER + if ((Flags & USE_CONTENT)==USE_CONTENT) + { + uchar contents[MaxEventContents]; + for (int i=0; iContents(i); + } + cXMLTVStringList *categories=xEvent->Category(); + for (int i=0; iSize(); i++) + { + char *tok,*sp; + char delim[]=","; + if ((*categories)[i][0]=='G' && (*categories)[i][1]==' ') + { + char *val=strdup(&(*categories)[i][2]); + if (val) + { + tok=strtok_r(val,delim,&sp); + while (tok) + { + unsigned int hval; + if (sscanf(tok,"%2x",&hval)==1) + { + uchar uval=(uchar) hval; + bool found=false; + for (int i=0; iSetContents(contents); + } + } + } +#endif + #if VDRVERSNUM < 10726 && (!EPGHANDLER) Event->SetTableID(0); // prevent EIT EPG to update this event #endif @@ -1002,7 +1063,7 @@ bool cImport::PutEvent(cEPGSource *Source, sqlite3 *Db, cSchedule* Schedule, if (!added && changed) { - if (((changed & CHANGED_SHORTTEXT)==CHANGED_SHORTTEXT) && (WasChanged(Event)==false)) + if (((changed & CHANGED_DESCRIPTION)==CHANGED_DESCRIPTION) && (WasChanged(Event)==false)) { if (Event->Description()) description=strdup(Event->Description()); if (description) diff --git a/maps.h b/maps.h index 519b142..2659ff0 100644 --- a/maps.h +++ b/maps.h @@ -32,6 +32,7 @@ #define USE_SEASON 0x400 #define USE_STARRATING 0x800 #define USE_TITLE 0x1000 +#define USE_CONTENT 0x2000 #define CREDITS_ACTORS 0x100000 #define CREDITS_DIRECTORS 0x200000 @@ -39,7 +40,6 @@ #define CREDITS_LIST 0x800000 #define OPT_RATING_TEXT 0x1000000 -#define OPT_CATEGORIES_TEXT 0x2000000 #define OPT_SEASON_STEXTITLE 0x4000000 #define OPT_APPEND 0x40000000 diff --git a/parse.cpp b/parse.cpp index 011714b..a41a5d4 100644 --- a/parse.cpp +++ b/parse.cpp @@ -161,11 +161,11 @@ 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 ! + Season=0; + Episode=0; + EpisodeOverall=0; + + // Title and ShortText are always UTF8 ! if (!EPDir) return false; if (!Title) return false; if (cEP2ASCII==(iconv_t) -1) return false; @@ -360,6 +360,14 @@ bool cParse::FetchEvent(xmlNodePtr enode, bool useeptext) xevent.SetEventID((tEventID) atol(eq+1)); } } + if (const xmlChar *content=xmlStrstr(node->content,(const xmlChar *) "content")) + { + char *eq=strchr((char *) content,'='); + if (eq) + { + xevent.AddCategory(eq+1); + } + } } if (node->type==XML_ELEMENT_NODE) { diff --git a/po/de_DE.po b/po/de_DE.po index bdfbf42..002a951 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: \n" -"POT-Creation-Date: 2012-08-13 18:38+0200\n" +"POT-Creation-Date: 2012-09-01 13:18+0200\n" "PO-Revision-Date: 2010-12-23 23:59+0100\n" "Last-Translator: Jochen Dolze \n" "Language-Team: \n" @@ -178,6 +178,9 @@ msgstr "Titel" msgid "short text" msgstr "Kurztext" +msgid "dvb content id" +msgstr "DVB Inhalts-ID" + msgid " actors" msgstr " Darsteller" diff --git a/po/it_IT.po b/po/it_IT.po index 01d8183..d5321ab 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: \n" -"POT-Creation-Date: 2012-08-13 18:38+0200\n" +"POT-Creation-Date: 2012-09-01 13:18+0200\n" "PO-Revision-Date: 2011-03-05 15:45+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: \n" @@ -181,6 +181,9 @@ msgstr "" msgid "short text" msgstr "Testo breve" +msgid "dvb content id" +msgstr "" + msgid " actors" msgstr " Attore" diff --git a/setup.cpp b/setup.cpp index 24c4a79..cfc713b 100644 --- a/setup.cpp +++ b/setup.cpp @@ -1089,6 +1089,9 @@ void cMenuSetupXmltv2vdrChannelMap::output(void) Add(new cMyMenuEditBitItem(tr("country and date"),&flags,USE_COUNTRYDATE),true); Add(new cMyMenuEditBitItem(tr("original title"),&flags,USE_ORIGTITLE),true); Add(new cMyMenuEditBitItem(tr("category"),&flags,USE_CATEGORIES),true); +#if VDRVERSNUM >= 10712 || EPGHANDLER + Add(new cMyMenuEditBitItem(tr("dvb content id"),&flags,USE_CONTENT),true); +#endif Add(new cMyMenuEditBitItem(tr("credits"),&flags,USE_CREDITS),true); c2=Current(); if ((flags & USE_CREDITS)==USE_CREDITS) -- cgit v1.2.3