Wer möchte, kann das mal an einem gepatchten VDR testen:
Diff
pi@raspberrypi:~/Entwicklung $ diff -ruN vdr-2.3.9++/menu.c vdr-2.3.9/menu.c
--- vdr-2.3.9++/menu.c 2018-03-26 20:16:28.134379878 +0200
+++ vdr-2.3.9/menu.c 2018-04-08 13:03:20.346681250 +0200
@@ -3009,7 +3009,8 @@
CurrentRecording = *fileName ? *fileName : cReplayControl::LastReplayed();
int current = Current();
Clear();
- GetRecordingsSortMode(DirectoryName(Recordings));
+// GetRecordingsSortMode(DirectoryName(Recordings));
+ GetRecordingsSortMode(DirectoryName());
Recordings->Sort();
cMenuRecordingItem *CurrentItem = NULL;
cMenuRecordingItem *LastItem = NULL;
@@ -3066,11 +3067,13 @@
fileName = FileName;
}
-cString cMenuRecordings::DirectoryName(const cRecordings *Recordings)
+//cString cMenuRecordings::DirectoryName(const cRecordings *Recordings)
+cString cMenuRecordings::DirectoryName()
{
cString d(cVideoDirectory::Name());
if (base) {
if (cVideoDirectory::HideFirstRecordingLevel()) {
+ LOCK_RECORDINGS_READ;
cRecordings::cFolderInfos::cFolderInfo* info = Recordings->GetFolderInfo(base);
if (info) {
if (info->FirstFolderNames.Size() > 0)
@@ -3263,8 +3266,9 @@
return osContinue;
if (const cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current()))
SetRecording(ri->Recording()->FileName()); // makes sure the Recordings menu will reposition to the current recording
- cRecordings *Recordings = cRecordings::GetRecordingsWrite(recordingsStateKey); // write access is necessary for sorting!
- IncRecordingsSortMode(DirectoryName(Recordings));
+// cRecordings *Recordings = cRecordings::GetRecordingsWrite(recordingsStateKey); // write access is necessary for sorting!
+// IncRecordingsSortMode(DirectoryName(Recordings));
+ IncRecordingsSortMode(DirectoryName());
recordingsStateKey.Reset();
Set(true);
return osContinue;
pi@raspberrypi:~/Entwicklung $ diff -ruN vdr-2.3.9++/menu.h vdr-2.3.9/menu.h
--- vdr-2.3.9++/menu.h 2018-03-26 17:20:13.376544110 +0200
+++ vdr-2.3.9/menu.h 2018-04-08 12:34:13.683106263 +0200
@@ -224,7 +224,8 @@
eOSState Sort(void);
eOSState Commands(eKeys Key = kNone);
protected:
- cString DirectoryName(const cRecordings *Recordings);
+// cString DirectoryName(const cRecordings *Recordings);
+ cString DirectoryName(void);
public:
cMenuRecordings(const char *Base = NULL, int Level = 0, bool OpenSubMenus = false, const cRecordingFilter *Filter = NULL);
~cMenuRecordings();
Display More
Oder im Patch den Teil für menu.c etwa so anpassen und den Teil für menu.h ganz raus nehmen:
Diff
--- a/menu.c
+++ b/menu.c
@@ -823,7 +823,7 @@
else {
cStringList Dirs;
for (const cRecording *Recording = Recordings->First(); Recording; Recording = Recordings->Next(Recording)) {
- cString Folder = Recording->Folder();
+ cString Folder = Recording->FileFolder();
strreplace((char *)*Folder, FOLDERDELIMCHAR, FOLDERDELIMCHARSUBST); // makes sure parent folders come before subfolders
if (Dirs.Find(Folder) < 0)
Dirs.Append(strdup(Folder));
@@ -2582,7 +2582,7 @@
SetMenuCategory(mcRecordingEdit);
recording = Recording;
originalFileName = recording->FileName();
- strn0cpy(folder, recording->Folder(), sizeof(folder));
+ strn0cpy(folder, recording->FileFolder(), sizeof(folder));
strn0cpy(name, recording->BaseName(), sizeof(name));
priority = recording->Priority();
lifetime = recording->Lifetime();
@@ -2667,7 +2667,7 @@
eOSState cMenuRecordingEdit::Folder(void)
{
- return AddSubMenu(new cMenuFolder(tr("Select folder"), &Folders, recording->Name()));
+ return AddSubMenu(new cMenuFolder(tr("Select folder"), &Folders, *recording->FullName()));
}
eOSState cMenuRecordingEdit::Action(void)
@@ -2748,7 +2748,7 @@
cString OldFolder = Recording->Folder();
cString NewName = *folder ? cString::sprintf("%s%c%s", folder, FOLDERDELIMCHAR, name) : name;
NewName.CompactChars(FOLDERDELIMCHAR);
- if (strcmp(NewName, Recording->Name())) {
+ if (strcmp(NewName, *Recording->FullName())) {
if (!Recording->ChangeName(NewName)) {
StateKey.Remove(Modified);
Skins.Message(mtError, tr("Error while changing folder/name!"));
@@ -3068,6 +3068,16 @@
{
cString d(cVideoDirectory::Name());
if (base) {
+ if (cVideoDirectory::HideFirstRecordingLevel()) {
+ LOCK_RECORDINGS_READ;
+ cRecordings::cFolderInfos::cFolderInfo* info = Recordings->GetFolderInfo(base);
+ if (info) {
+ if (info->FirstFolderNames.Size() > 0)
+ d = AddDirectory(d, info->FirstFolderNames.At(0));
+ delete info;
+ }
+ }
+
char *s = ExchangeChars(strdup(base), true);
d = AddDirectory(d, s);
free(s);
Display More