fixed newest rec in folder

This commit is contained in:
louis 2014-10-19 15:40:02 +02:00
parent 4d0e2e731a
commit 49c6ef552c
3 changed files with 11 additions and 8 deletions

View File

@ -138,7 +138,6 @@ string &trim(string &s) {
return ltrim(rtrim(s)); return ltrim(rtrim(s));
} }
// split: receives a char delimiter; returns a vector of strings // split: receives a char delimiter; returns a vector of strings
// By default ignores repeated delimiters, unless argument rep == 1. // By default ignores repeated delimiters, unless argument rep == 1.
vector<string>& splitstring::split(char delim, int rep) { vector<string>& splitstring::split(char delim, int rep) {

View File

@ -66,16 +66,20 @@ void cRecordingsFolderInfo::Rebuild(void)
// re-get state with lock held // re-get state with lock held
_recordings.StateChanged(_recState); _recordings.StateChanged(_recState);
cFolderInfoIntern *info; cFolderInfoIntern *info;
cString folder;
for (cRecording *rec = _recordings.First(); rec; rec = _recordings.Next(rec)) { for (cRecording *rec = _recordings.First(); rec; rec = _recordings.Next(rec)) {
#if APIVERSNUM < 20102
//cRecording::Folder() first available since VDR 2.1.2 //cRecording::Folder() first available since VDR 2.1.2
cString folder(""); const char *recName = rec->Name();
char *folderName = strdup(rec->Name()); if (const char *s = strrchr(recName, FOLDERDELIMCHAR))
if (char *s = strrchr(folderName, FOLDERDELIMCHAR)) folder = cString(recName, s);
folder = cString(folderName, s); else
folder = "";
#else
folder = rec->Folder();
#endif
info = _root->Find(*folder, true); info = _root->Find(*folder, true);
//info = _root->Find(*rec->Folder(), true);
info->Add(rec); info->Add(rec);
free(folderName);
} }
} }