summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-04-18 17:41:30 +0200
committerlouis <louis.braun@gmx.de>2014-04-18 17:41:30 +0200
commit4f9aa5ca0187d5d7de763be7020f8c43a6851261 (patch)
tree9d7aab42d840581b09ef95f86c55990c5706d174
parent4f90ed5cc8d81ec7cccd39abfca2fb4ad27e6d6a (diff)
downloadvdr-plugin-scraper2vdr-4f9aa5ca0187d5d7de763be7020f8c43a6851261.tar.gz
vdr-plugin-scraper2vdr-4f9aa5ca0187d5d7de763be7020f8c43a6851261.tar.bz2
fixed recordings with path size longer that 200 chars
-rw-r--r--scrapmanager.c6
-rw-r--r--tools.c9
-rw-r--r--tools.h2
-rw-r--r--update.c4
4 files changed, 16 insertions, 5 deletions
diff --git a/scrapmanager.c b/scrapmanager.c
index b446c17..eda47e4 100644
--- a/scrapmanager.c
+++ b/scrapmanager.c
@@ -325,7 +325,7 @@ bool cScrapManager::GetEventType(ScraperGetEventType *call) {
} else if (call->recording) {
sRecordingsKey k;
k.recStart = call->recording->Start();
- k.recPath = call->recording->FileName();
+ k.recPath = getRecPath(call->recording);
map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
if (hit == recordings.end())
return false;
@@ -445,7 +445,7 @@ bool cScrapManager::GetPoster(ScraperGetPoster *call) {
} else if (call->recording) {
sRecordingsKey k;
k.recStart = call->recording->Start();
- k.recPath = call->recording->FileName();
+ k.recPath = getRecPath(call->recording);
map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
if (hit == recordings.end())
return false;
@@ -480,7 +480,7 @@ bool cScrapManager::GetPosterThumb(ScraperGetPosterThumb *call) {
} else if (call->recording) {
sRecordingsKey k;
k.recStart = call->recording->Start();
- k.recPath = call->recording->FileName();
+ k.recPath = getRecPath(call->recording);
map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
if (hit == recordings.end())
return false;
diff --git a/tools.c b/tools.c
index ea0e41e..c9e94f4 100644
--- a/tools.c
+++ b/tools.c
@@ -125,6 +125,15 @@ string replaceString(string content, string search, string repl) {
return content;
}
+string getRecPath(const cRecording *rec) {
+ if (!rec)
+ return "";
+ string recPath = rec->FileName();
+ if (recPath.size() > 200)
+ recPath = recPath.substr(0, 199);
+ return recPath;
+}
+
/****************************************************************************************
* SPLTSTRING
diff --git a/tools.h b/tools.h
index 64e8103..02af2b0 100644
--- a/tools.h
+++ b/tools.h
@@ -19,6 +19,8 @@ void toLower(string &s);
bool isNumber(const string& s);
string replaceString(string content, string search, string repl);
+string getRecPath(const cRecording *rec);
+
class splitstring : public string {
vector<string> flds;
public:
diff --git a/update.c b/update.c
index d3b0398..90a07f0 100644
--- a/update.c
+++ b/update.c
@@ -879,7 +879,7 @@ int cUpdate::ReadRecordings(void) {
int cUpdate::ScanVideoDir(void) {
int newRecs = 0;
for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
- string recPath = rec->FileName();
+ string recPath = getRecPath(rec);
int recStart = rec->Start();
if (!scrapManager->RecordingExists(recStart, recPath)) {
newRecs++;
@@ -931,7 +931,7 @@ int cUpdate::ScanVideoDirScrapInfo(void) {
int numUpdated = 0;
for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
int recStart = rec->Start();
- string recPath = rec->FileName();
+ string recPath = getRecPath(rec);
bool recExists = LoadRecording(recStart, recPath);
int scrapInfoMovieID = 0;
int scrapInfoSeriesID = 0;