mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-scraper2vdr.git
				synced 2023-10-19 15:58:31 +00:00 
			
		
		
		
	fixed recordings with path size longer that 200 chars
This commit is contained in:
		@@ -325,7 +325,7 @@ bool cScrapManager::GetEventType(ScraperGetEventType *call) {
 | 
				
			|||||||
	} else if (call->recording) {
 | 
						} else if (call->recording) {
 | 
				
			||||||
		sRecordingsKey k;
 | 
							sRecordingsKey k;
 | 
				
			||||||
		k.recStart = call->recording->Start();
 | 
							k.recStart = call->recording->Start();
 | 
				
			||||||
        k.recPath = call->recording->FileName();
 | 
					        k.recPath = getRecPath(call->recording);
 | 
				
			||||||
		map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
 | 
							map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
 | 
				
			||||||
		if (hit == recordings.end())
 | 
							if (hit == recordings.end())
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
@@ -445,7 +445,7 @@ bool cScrapManager::GetPoster(ScraperGetPoster *call) {
 | 
				
			|||||||
    } else if (call->recording) {
 | 
					    } else if (call->recording) {
 | 
				
			||||||
		sRecordingsKey k;
 | 
							sRecordingsKey k;
 | 
				
			||||||
		k.recStart = call->recording->Start();
 | 
							k.recStart = call->recording->Start();
 | 
				
			||||||
        k.recPath = call->recording->FileName();
 | 
					        k.recPath = getRecPath(call->recording);
 | 
				
			||||||
		map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
 | 
							map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
 | 
				
			||||||
        if (hit == recordings.end())
 | 
					        if (hit == recordings.end())
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
@@ -480,7 +480,7 @@ bool cScrapManager::GetPosterThumb(ScraperGetPosterThumb *call) {
 | 
				
			|||||||
    } else if (call->recording) {
 | 
					    } else if (call->recording) {
 | 
				
			||||||
		sRecordingsKey k;
 | 
							sRecordingsKey k;
 | 
				
			||||||
		k.recStart = call->recording->Start();
 | 
							k.recStart = call->recording->Start();
 | 
				
			||||||
        k.recPath = call->recording->FileName();
 | 
					        k.recPath = getRecPath(call->recording);
 | 
				
			||||||
		map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
 | 
							map<sRecordingsKey, sEventsValue>::iterator hit = recordings.find(k);
 | 
				
			||||||
        if (hit == recordings.end())
 | 
					        if (hit == recordings.end())
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										9
									
								
								tools.c
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								tools.c
									
									
									
									
									
								
							@@ -125,6 +125,15 @@ string replaceString(string content, string search, string repl) {
 | 
				
			|||||||
    return content;
 | 
					    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
 | 
					*            SPLTSTRING
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								tools.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								tools.h
									
									
									
									
									
								
							@@ -19,6 +19,8 @@ void toLower(string &s);
 | 
				
			|||||||
bool isNumber(const string& s);
 | 
					bool isNumber(const string& s);
 | 
				
			||||||
string replaceString(string content, string search, string repl);
 | 
					string replaceString(string content, string search, string repl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					string getRecPath(const cRecording *rec);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class splitstring : public string {
 | 
					class splitstring : public string {
 | 
				
			||||||
    vector<string> flds;
 | 
					    vector<string> flds;
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								update.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								update.c
									
									
									
									
									
								
							@@ -879,7 +879,7 @@ int cUpdate::ReadRecordings(void) {
 | 
				
			|||||||
int cUpdate::ScanVideoDir(void) {
 | 
					int cUpdate::ScanVideoDir(void) {
 | 
				
			||||||
    int newRecs = 0;
 | 
					    int newRecs = 0;
 | 
				
			||||||
    for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
 | 
					    for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
 | 
				
			||||||
        string recPath = rec->FileName();
 | 
					        string recPath = getRecPath(rec);
 | 
				
			||||||
        int recStart = rec->Start();
 | 
					        int recStart = rec->Start();
 | 
				
			||||||
        if (!scrapManager->RecordingExists(recStart, recPath)) {
 | 
					        if (!scrapManager->RecordingExists(recStart, recPath)) {
 | 
				
			||||||
            newRecs++;
 | 
					            newRecs++;
 | 
				
			||||||
@@ -931,7 +931,7 @@ int cUpdate::ScanVideoDirScrapInfo(void) {
 | 
				
			|||||||
    int numUpdated = 0;
 | 
					    int numUpdated = 0;
 | 
				
			||||||
    for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
 | 
					    for (cRecording *rec = Recordings.First(); rec; rec = Recordings.Next(rec)) {
 | 
				
			||||||
        int recStart = rec->Start();
 | 
					        int recStart = rec->Start();
 | 
				
			||||||
        string recPath = rec->FileName();
 | 
					        string recPath = getRecPath(rec);
 | 
				
			||||||
        bool recExists = LoadRecording(recStart, recPath);
 | 
					        bool recExists = LoadRecording(recStart, recPath);
 | 
				
			||||||
        int scrapInfoMovieID = 0;
 | 
					        int scrapInfoMovieID = 0;
 | 
				
			||||||
        int scrapInfoSeriesID = 0;        
 | 
					        int scrapInfoSeriesID = 0;        
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user