From 7183c4be0f8752550f10747493fb7c9063aa0fdd Mon Sep 17 00:00:00 2001 From: Frank Neumann Date: Thu, 11 May 2017 01:03:03 +0200 Subject: Add compatibility for VDR API >= 2.3.1. --- setup.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'setup.c') diff --git a/setup.c b/setup.c index c304342..a7f11e1 100644 --- a/setup.c +++ b/setup.c @@ -6,7 +6,12 @@ using namespace std; cTVScraperSetup::cTVScraperSetup(cTVScraperWorker *workerThread) { worker = workerThread; +#if APIVERSNUM < 20301 int numChannels = Channels.Count(); +#else + LOCK_CHANNELS_READ; + int numChannels = Channels->Count(); +#endif for (int i=0; iGetByNumber(i+1); +#endif if (channel) { string channelID = *(channel->GetChannelID().ToString()); channelsToScrap << channelID << ";"; @@ -89,7 +99,12 @@ void cTVScraperChannelSetup ::Setup(void) { int currentItem = Current(); Clear(); int i=0; +#if APIVERSNUM < 20301 for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) { +#else + LOCK_CHANNELS_READ; + for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) { +#endif if (!channel->GroupSep()) { Add(new cMenuEditBoolItem(channel->Name(), &channelsScrap->at(i), tr("don't scrap"), tr("scrap"))); i++; @@ -108,4 +123,4 @@ eOSState cTVScraperChannelSetup ::ProcessKey(eKeys Key) { break; } return state; -} \ No newline at end of file +} -- cgit v1.2.3