diff options
author | louis <louis.braun@gmx.de> | 2013-09-04 16:56:31 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-09-04 16:56:31 +0200 |
commit | 225d6d6c45680b57707490bbc6b6a1d0bc21ff76 (patch) | |
tree | bcc7e9dc0e58c673b131c3caa4eca62ae4eab478 | |
parent | 85428922ca29e5874b5016dd995f41a391f53040 (diff) | |
download | vdr-plugin-tvscraper-225d6d6c45680b57707490bbc6b6a1d0bc21ff76.tar.gz vdr-plugin-tvscraper-225d6d6c45680b57707490bbc6b6a1d0bc21ff76.tar.bz2 |
added ignorePath in overrides
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | conf/override.conf | 4 | ||||
-rw-r--r-- | overrides.c | 25 | ||||
-rw-r--r-- | overrides.h | 2 | ||||
-rw-r--r-- | worker.c | 2 |
5 files changed, 38 insertions, 1 deletions
@@ -95,7 +95,8 @@ not reasonable to scrap, because they reoccur constantly but deliver wrong results everytime, or tvscraper searchs for a movie instead of a series (for instance german "Tatort"). In such cases it is possible to use <PLGCFGDIR>/override.conf to adjust the scraping behaviour. Each line in -this file has to start either with "ignore", "settype" or "substitute": +this file has to start either with "ignore", "settype", "substitute" or +"ignorePath": - Ignore specific EPG Events or recordings: just create a line in the format ignore;string @@ -107,6 +108,9 @@ this file has to start either with "ignore", "settype" or "substitute": - Substitute Search String: substitute;string;substitution "string" is replaced by "substitution" in every search. +- Ignore all recordings in a deditcatd directory: + ignorePath;string + "string" can be any substring of a recording path, e.g. "music/" Service Interface ----------------- diff --git a/conf/override.conf b/conf/override.conf index b9d523c..e8e9c5a 100644 --- a/conf/override.conf +++ b/conf/override.conf @@ -17,6 +17,10 @@ # ----------------------------------------------------------------- # substitute;string;substitution # ----------------------------------------------------------------- +# ignore a complete path while scanning video directory +# "string" can be any substring of a recording path, e.g. "music/" +# ----------------------------------------------------------------- +# ignorePath;string ignore;Galileo settype;Tatort;series diff --git a/overrides.c b/overrides.c index 2eb9e4e..651929a 100644 --- a/overrides.c +++ b/overrides.c @@ -53,6 +53,13 @@ void cOverRides::ReadConfigLine(string line) { if (flds.size() == 3) { substitutes.insert(pair<string, string>(flds[1], flds[2])); } + } else if (!flds[0].compare("ignorePath")) { + if (flds.size() == 2) { + if (flds[1].find("/", flds[1].length()-1) != std::string::npos) + ignorePath.push_back(flds[1]); + else + ignorePath.push_back(flds[1] + "/"); + } } } } @@ -89,6 +96,18 @@ scrapType cOverRides::Type(string title) { return scrapNone; } +bool cOverRides::IgnorePath(string path) { + vector<string>::iterator pos; + for ( pos = ignorePath.begin(); pos != ignorePath.end(); ++pos) { + if (path.find(pos->c_str()) != string::npos) { + if (config.enableDebug) + esyslog("tvscraper: ignoring path \"%s\" because of override.conf", path.c_str()); + return true; + } + } + return false; +} + void cOverRides::Dump(void) { esyslog("tvscraper: ignoring the following titles:"); vector<string>::iterator pos; @@ -107,4 +126,10 @@ void cOverRides::Dump(void) { for( pos3 = substitutes.begin(); pos3 != substitutes.end(); ++pos3) { esyslog("tvscraper: substitute \"%s\" with \"%s\"", ((string)pos3->first).c_str(), ((string)pos3->second).c_str()); } + + esyslog("tvscraper: ignoring the following paths:"); + vector<string>::iterator pos4; + for ( pos4 = ignorePath.begin(); pos4 != ignorePath.end(); ++pos4) { + esyslog("tvscraper: ignore path \"%s\"", pos4->c_str()); + } } diff --git a/overrides.h b/overrides.h index 23ea229..9c40659 100644 --- a/overrides.h +++ b/overrides.h @@ -10,6 +10,7 @@ private: vector<string> ignores; map<string,scrapType> searchTypes; map<string,string> substitutes; + vector<string> ignorePath; void ReadConfigLine(string line); public: cOverRides(void); @@ -18,6 +19,7 @@ public: bool Ignore(string title); string Substitute(string title); scrapType Type(string title); + bool IgnorePath(string path); void Dump(void); }; #endif //__TVSCRAPER_OVERRIDES_H
\ No newline at end of file @@ -155,6 +155,8 @@ void cTVScraperWorker::ScrapEPG(void) { void cTVScraperWorker::ScrapRecordings(void) { db->ClearRecordings(); for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) { + if (overrides->IgnorePath(rec->FileName())) + continue; const cRecordingInfo *recInfo = rec->Info(); const cEvent *recEvent = recInfo->GetEvent(); if (recEvent) { |