#! /bin/sh /usr/share/dpatch/dpatch-run ## opt-39_noepg.dpatch by Torsten/WarEagle at vdrportal.de ## http://vdrportal.de/board/thread.php?postid=658080#post658080 ## ## Thomas Günther <tom@toms-cafe.de>: ## - solved conflicts with other patches ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: The patch allows to disable normal epg update for specified channels. ## DP: This is useful if you get epg data of the channels from external sources. @DPATCH@ diff -u -x '*~' -x runvdr -x Makefile vdr-1.5.9-org/config.c vdr-1.5.9+noEPG/config.c --- vdr-1.5.9-org/config.c 2007-08-12 14:09:37.000000000 +0200 +++ vdr-1.5.9+noEPG/config.c 2007-10-12 16:25:28.000000000 +0200 @@ -286,1 +286,3 @@ - InitialVolume = -1; + InitialVolume = -1; + noEPGMode = 0; + noEPGList=strdup(""); @@ -450,1 +452,6 @@ - else if (!strcasecmp(Name, "ShowReplayMode")) ShowReplayMode = atoi(Value); + else if (!strcasecmp(Name, "ShowReplayMode")) ShowReplayMode = atoi(Value); + else if (!strcasecmp(Name, "noEPGMode")) noEPGMode = atoi(Value); + else if (!strcasecmp(Name, "noEPGList")){ + free(noEPGList); + noEPGList=strdup(Value); + } @@ -533,1 +540,3 @@ - Store("InitialVolume", InitialVolume); + Store("InitialVolume", InitialVolume); + Store("noEPGMode", noEPGMode); + Store("noEPGList", noEPGList); diff -u -x '*~' -x runvdr -x Makefile vdr-1.5.9-org/config.h vdr-1.5.9+noEPG/config.h --- vdr-1.5.9+jumpplay/config.h 2007-09-10 15:26:17.000000000 +0200 +++ vdr-1.5.9+jumpplay+noepg/config.h 2007-10-13 18:18:37.000000000 +0200 @@ -264,1 +264,3 @@ - int InitialVolume; + int InitialVolume; + char *noEPGList; + int noEPGMode; diff -u -x '*~' -x runvdr -x Makefile vdr-1.5.9-org/eit.c vdr-1.5.9+noEPG/eit.c --- vdr-1.5.9-org/eit.c 2007-07-28 15:16:43.000000000 +0200 +++ vdr-1.5.9+noEPG/eit.c 2007-10-12 16:25:28.000000000 +0200 @@ -22,8 +22,28 @@ class cEIT : public SI::EIT { public: cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bool OnlyRunningStatus = false); +private: + bool allowedEPG(tChannelID kanalID); }; +bool cEIT::allowedEPG(tChannelID kanalID){ + bool rc; + + if (Setup.noEPGMode == 1){ + rc=false; + if (strstr(::Setup.noEPGList,kanalID.ToString())!=NULL){ + rc=true; + } + }else{ + rc=true; + if (strstr(::Setup.noEPGList,kanalID.ToString())!=NULL){ + rc=false; + } + } + + return rc; +} + cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bool OnlyRunningStatus) :SI::EIT(Data, false) { @@ -35,6 +55,15 @@ if (!channel) return; // only collect data for known channels + // noepg >>> + //only use epg from channels not blocked by noEPG-patch + tChannelID kanalID; + kanalID=channel->GetChannelID(); + if (!allowedEPG(kanalID)){ + return; + } + // noepg <<< + cSchedule *pSchedule = (cSchedule *)Schedules->GetSchedule(channel, true); bool Empty = true; diff -u -x '*~' -x runvdr -x Makefile vdr-1.5.9-org/po/de_DE.po vdr-1.5.9+noEPG/po/de_DE.po --- vdr-1.5.9-org/po/de_DE.po 2007-08-19 13:53:29.000000000 +0200 +++ vdr-1.5.9+noEPG/po/de_DE.po 2007-10-12 16:26:36.000000000 +0200 @@ -1268,1 +1284,4 @@ +msgid "Setup.EPG$Mode of noEPG-Patch" +msgstr "Art des noEPG-Patches" + +msgid "VDR will shut down in %s minutes" -msgid "VDR will shut down in %s minutes" diff -u -x '*~' -x runvdr -x Makefile vdr-1.5.9-org/po/de_DE.po vdr-1.5.9+noEPG/po/de_DE.po --- vdr-1.5.9+jumpplay/menu.c 2007-09-10 15:26:17.000000000 +0200 +++ vdr-1.5.9+jumpplay+noepg/menu.c 2007-10-13 18:30:33.000000000 +0200 @@ -2307,6 +2307,7 @@ class cMenuSetupEPG : public cMenuSetupBase { private: + const char *noEPGModes[2]; int originalNumLanguages; int numLanguages; void Setup(void); @@ -2329,6 +2330,9 @@ { int current = Current(); + noEPGModes[0]=tr("Blacklist"); + noEPGModes[1]=tr("Whitelist"); + Clear(); Add(new cMenuEditIntItem( tr("Setup.EPG$EPG scan timeout (h)"), &data.EPGScanTimeout)); @@ -2344,1 +2348,2 @@ - Add(new cMenuEditStraItem(tr("Setup.EPG$Preferred language"), &data.EPGLanguages[i], I18nLanguages()->Size(), &I18nLanguages()->At(0))); + Add(new cMenuEditStraItem(tr("Setup.EPG$Preferred language"), &data.EPGLanguages[i], I18nLanguages()->Size(), &I18nLanguages()->At(0))); + Add(new cMenuEditStraItem(tr("Setup.EPG$Mode noEPG-Patch"), &data.noEPGMode, 2, noEPGModes));