#! /bin/sh /usr/share/dpatch/dpatch-run ## opt-39_noepg.dpatch by Torsten Kunkel ## http://sjur.de/php/downloadcounter.php?mod=vdr&file=noepg_0.3-1.3.19.diff.gz ## ## Thomas Günther : ## - solved conflict with other patches ## - adapted to VDR-1.3.38 (removed handling of keys 2/5/8) ## - adapted to VDR-1.3.39 ## ## 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@ --- vdr-1.3.39/channels.c +++ vdr-1.3.39/channels.c @@ -7,6 +7,7 @@ * $Id: channels.c 1.48 2006/01/14 15:51:02 kls Exp $ */ +#include "config.h" #include "channels.h" #include #include @@ -1030,6 +1031,17 @@ return NULL; } +//TK +bool cChannels::keinEPGScan(tChannelID kanalID) +{ + bool rc=false; + + if (strstr(::Setup.noEPG,kanalID.ToString())!=NULL){ + rc=true; + } + return rc; +} + cString ChannelString(const cChannel *Channel, int Number) { char buffer[256]; --- vdr-1.3.39/channels.h +++ vdr-1.3.39/channels.h @@ -248,6 +248,7 @@ ///< modification has been made, and 2 if the user has made a modification. ///< Calling this function resets the 'modified' flag to 0. cChannel *NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid = 0); + bool keinEPGScan(tChannelID kanalID);//TK }; extern cChannels Channels; --- vdr-1.3.39/config.c +++ vdr-1.3.39/config.c @@ -238,6 +238,7 @@ EPGScanTimeout = 5; EPGBugfixLevel = 3; EPGLinger = 0; + strcpy(noEPG, ""); SVDRPTimeout = 300; ZapTimeout = 3; SortTimers = 1; @@ -398,6 +399,7 @@ else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value); else if (!strcasecmp(Name, "EPGBugfixLevel")) EPGBugfixLevel = atoi(Value); else if (!strcasecmp(Name, "EPGLinger")) EPGLinger = atoi(Value); + else if (!strcasecmp(Name, "noEPG")) strn0cpy(noEPG, Value, 999); else if (!strcasecmp(Name, "SVDRPTimeout")) SVDRPTimeout = atoi(Value); else if (!strcasecmp(Name, "ZapTimeout")) ZapTimeout = atoi(Value); else if (!strcasecmp(Name, "SortTimers")) SortTimers = atoi(Value); @@ -465,6 +467,7 @@ Store("EPGScanTimeout", EPGScanTimeout); Store("EPGBugfixLevel", EPGBugfixLevel); Store("EPGLinger", EPGLinger); + Store("noEPG", noEPG); Store("SVDRPTimeout", SVDRPTimeout); Store("ZapTimeout", ZapTimeout); Store("SortTimers", SortTimers); --- vdr-1.3.39/config.h +++ vdr-1.3.39/config.h @@ -210,6 +210,7 @@ int EPGScanTimeout; int EPGBugfixLevel; int EPGLinger; + char noEPG[999]; int SVDRPTimeout; int ZapTimeout; int SortTimers; --- vdr-1.3.39/eit.c +++ vdr-1.3.39/eit.c @@ -35,6 +35,14 @@ if (!channel) return; // only collect data for known channels + //TK + tChannelID kanalID; + kanalID=channel->GetChannelID(); + if (Channels.keinEPGScan(kanalID)){ + return; + } + + cSchedule *pSchedule = (cSchedule *)Schedules->GetSchedule(channel, true); bool Empty = true; --- vdr-1.3.39/menu.c +++ vdr-1.3.39/menu.c @@ -383,6 +383,9 @@ eOSState Edit(void); eOSState New(void); eOSState Delete(void); + eOSState noEPGAdd(void); + eOSState noEPGDel(void); + eOSState noEPGStatus(void); virtual void Move(int From, int To); public: cMenuChannels(void); @@ -514,6 +517,79 @@ return osContinue; } +eOSState cMenuChannels::noEPGStatus(void) +{ + if (!HasSubMenu() && Count() > 0) { + cChannel *channel = GetChannel(Current()); + tChannelID kanalID; + kanalID=channel->GetChannelID(); + + if (strstr(::Setup.noEPG,kanalID.ToString())!=NULL){ + Skins.Message(mtStatus, tr("Kanal in Kein-EPG-Liste!")); + }else{ + Skins.Message(mtStatus, tr("Kanal nicht in Kein-EPG-Liste!")); + } + } + return osContinue; +} + +//TK +eOSState cMenuChannels::noEPGAdd(void) +{ + if (!HasSubMenu() && Count() > 0) { + cChannel *channel = GetChannel(Current()); + tChannelID kanalID; + kanalID=channel->GetChannelID(); + + if (strstr(::Setup.noEPG,kanalID.ToString())==NULL){ + sprintf(::Setup.noEPG,"%s %s",::Setup.noEPG,*kanalID.ToString()); + ::Setup.Save(); + Skins.Message(mtStatus, tr("Kanal in Kein-EPG-Liste aufgenommen!")); + }else{ + Skins.Message(mtError, tr("Kanal bereits in Kein-EPG-Liste enthalten!")); + } + } + return osContinue; +} + +//TK +eOSState cMenuChannels::noEPGDel(void) +{ + char neu[999]; + char tmp[999]; + char *sep = " "; + char *word, *brkt; + + if (!HasSubMenu() && Count() > 0) { + cChannel *channel = GetChannel(Current()); + tChannelID kanalID; + kanalID=channel->GetChannelID(); + + if (strstr(::Setup.noEPG,kanalID.ToString())!=NULL){ + + strcpy(tmp,::Setup.noEPG); + + for (word = strtok_r(tmp, sep, &brkt); + word; + word = strtok_r(NULL, sep, &brkt)) + { + if(strcmp(word,kanalID.ToString())!=0){ + strcat(neu," "); + strcat(neu,word); + } + } + + strcpy(::Setup.noEPG,neu); + ::Setup.Save(); + Skins.Message(mtStatus, tr("Kanal aus Kein-EPG-Liste gelöscht!")); + }else{ + Skins.Message(mtError, tr("Kanal nicht in Kein-EPG-Liste vorhanden!")); + } + } + return osContinue; +} + + void cMenuChannels::Move(int From, int To) { int CurrentChannelNr = cDevice::CurrentChannel();