summaryrefslogtreecommitdiff
path: root/worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'worker.c')
-rw-r--r--worker.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/worker.c b/worker.c
index d2fa8e7..85bbfaa 100644
--- a/worker.c
+++ b/worker.c
@@ -180,9 +180,13 @@ void cTVScraperWorker::CheckRunningTimers(void) {
const cEvent *event = timer->Event();
scrapType type = GetScrapType(event);
if (type == scrapSeries) {
- db->SetRecordingSeries((int)event->EventID());
+ if (!db->SetRecordingSeries((int)event->EventID())) {
+ tvdbScraper->Scrap(event, (int)event->EventID());
+ }
} else if (type == scrapMovie) {
- db->SetRecordingMovie((int)event->EventID());
+ if (!db->SetRecordingMovie((int)event->EventID())) {
+ moviedbScraper->Scrap(event, (int)event->EventID());
+ }
}
}
}
@@ -216,7 +220,10 @@ void cTVScraperWorker::Action(void) {
DisconnectScrapers();
continue;
}
- CheckRunningTimers();
+ if (ConnectScrapers()) {
+ CheckRunningTimers();
+ DisconnectScrapers();
+ }
if (StartScrapping()) {
dsyslog("tvscraper: start scraping epg");
db->ClearOutdated(movieDir);