summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c5
-rw-r--r--setup.c17
-rw-r--r--worker.c20
3 files changed, 41 insertions, 1 deletions
diff --git a/config.c b/config.c
index 4110bd3..4807e32 100644
--- a/config.c
+++ b/config.c
@@ -18,7 +18,12 @@ void cTVScraperConfig::AddChannel(string channelID) {
}
bool cTVScraperConfig::ChannelActive(int channelNum) {
+#if APIVERSNUM < 20301
cChannel *channel = Channels.GetByNumber(channelNum);
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByNumber(channelNum);
+#endif
if (channel) {
string channelID = "";
channelID = *(channel->GetChannelID().ToString());
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; i<numChannels; i++) {
int akt = 0;
if (config.ChannelActive(i+1))
@@ -60,7 +65,12 @@ void cTVScraperSetup::Store(void) {
int numChannels = channelsScrap.size();
for (int i=0; i<numChannels; i++) {
if (channelsScrap[i] == 1) {
+#if APIVERSNUM < 20301
cChannel *channel = Channels.GetByNumber(i+1);
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByNumber(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
+}
diff --git a/worker.c b/worker.c
index 87203fa..41f9638 100644
--- a/worker.c
+++ b/worker.c
@@ -130,13 +130,23 @@ void cTVScraperWorker::ScrapEPG(void) {
int numChannels = channels.size();
for (int i=0; i<numChannels; i++) {
string channelID = channels[i];
+#if APIVERSNUM < 20301
const cChannel *channel = Channels.GetByChannelID(tChannelID::FromString(channelID.c_str()));
+#else
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID(tChannelID::FromString(channelID.c_str()));
+#endif
if (!channel)
continue;
dsyslog("tvscraper: scraping Channel %s %s", channel->Name(), channelID.c_str());
+#if APIVERSNUM < 20301
cSchedulesLock schedulesLock;
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
const cSchedule *Schedule = schedules->GetSchedule(channel);
+#else
+ LOCK_SCHEDULES_READ;
+ const cSchedule *Schedule = Schedules->GetSchedule(channel);
+#endif
if (Schedule) {
const cEvent *event = NULL;
for (event = Schedule->Events()->First(); event; event = Schedule->Events()->Next(event)) {
@@ -160,7 +170,12 @@ void cTVScraperWorker::ScrapEPG(void) {
void cTVScraperWorker::ScrapRecordings(void) {
db->ClearRecordings();
+#if APIVERSNUM < 20301
for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
+#else
+ LOCK_RECORDINGS_READ;
+ for (const cRecording *rec = Recordings->First(); rec; rec = Recordings->Next(rec)) {
+#endif
if (overrides->IgnorePath(rec->FileName()))
continue;
const cRecordingInfo *recInfo = rec->Info();
@@ -188,7 +203,12 @@ void cTVScraperWorker::ScrapRecordings(void) {
}
void cTVScraperWorker::CheckRunningTimers(void) {
+#if APIVERSNUM < 20301
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
+#else
+ LOCK_TIMERS_READ;
+ for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) {
+#endif
if (timer->Recording()) {
const cEvent *event = timer->Event();
if (!event)