Hi Klaus,
I've found a minor bug in the new cMenuRecordings.
If the recordings menu is opened with OpenSubMenus=true and with cReplayControl::LastReplayed() pointing to a non-existing recording, VDR descends into the first recording sub menu, provide that the first recording menu item is a sub-menu, not a recording.
Steps to reproduce: -Make sure the first entry in recordings is a folder, eg. record something to AAA~BBB~CCC -Play some recording DDD~EEE and stop it -Externally delete/move the DDD~EEE recording (deleting inside VDR doesn't trigger this) -touch .update -Enter recordings menu with direct remote key
Actual result: Recording sub menu AAA~BBB is opened, CCC is selected.
Expected result: Recording main menu opened, AAA selected.
Cool enhanced result: Open the DDD sub menu if it still exists.
Background: I think, the idea was that Set() selects the proper item, or keeps Current()<0 otherwise, so the Open() in cMenuRecordings::cMenuRecordings() is never called. However, the Display() in Set() automatically selects First() as fallback. The 'if (Current() < 0)' test in the constructor will never be triggered because of that.
Cheers,
Udo
Udo Richter wrote:
Hi Klaus,
I've found a minor bug in the new cMenuRecordings.
If the recordings menu is opened with OpenSubMenus=true and with cReplayControl::LastReplayed() pointing to a non-existing recording, VDR descends into the first recording sub menu, provide that the first recording menu item is a sub-menu, not a recording. ...
The attached patch should fix this. It also avoids an unjustified "Error while accessing recording!" after deleting a recording from a subfolder.
Klaus
--- menu.c 2005/09/25 13:37:21 1.362 +++ menu.c 2005/10/01 10:12:32 @@ -1513,6 +1513,7 @@ SetCurrent(First()); else if (OpenSubMenus && cReplayControl::LastReplayed() && Open(true)) return; + Display(); SetHelpKeys(); }
@@ -1556,7 +1557,7 @@ if (Refresh) { cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current()); if (ri) { - cRecording *Recording = GetRecording(ri); + cRecording *Recording = Recordings.GetByName(ri->FileName()); if (Recording) CurrentRecording = Recording->FileName(); } @@ -1583,7 +1584,8 @@ } } free(LastItemText); - Display(); + if (Refresh) + Display(); }
cRecording *cMenuRecordings::GetRecording(cMenuRecordingItem *Item)