some records not shown in menu

Message ID 4D691D73.9000709@tvdr.de
State New
Headers

Commit Message

Klaus Schmidinger Feb. 26, 2011, 3:34 p.m. UTC
  On 24.02.2011 22:20, zupermen@gmx.de wrote:
> Hallo,
> 
> there is a small bug in VDR 1.7.16 at the recording menu.
> In some situations VDR shows that a sub-folder (at recordings) holds 2
> recordings. If you open the folder only 1 recording is shown. After
> deleting this record the other one is shown.
> 
> To reproduce the behavior you can record the same show on e.g. ARD and
> ARD-HD or switch of an active timer and switch it on later.

I also have seen this on occasion, but wasn't sure how to reproduce it.
Now I was able to.

Please try the attached patch, it appears to fix this.

Klaus
  

Comments

zupermen@gmx.de Feb. 27, 2011, 12:46 p.m. UTC | #1
On Sat, 2011-02-26 at 16:34 +0100, Klaus Schmidinger wrote: 
> On 24.02.2011 22:20, zupermen@gmx.de wrote:
> > Hallo,
> > 
> > there is a small bug in VDR 1.7.16 at the recording menu.
> > In some situations VDR shows that a sub-folder (at recordings) holds 2
> > recordings. If you open the folder only 1 recording is shown. After
> > deleting this record the other one is shown.
> > 
> > To reproduce the behavior you can record the same show on e.g. ARD and
> > ARD-HD or switch of an active timer and switch it on later.
> 
> I also have seen this on occasion, but wasn't sure how to reproduce it.
> Now I was able to.
> 
> Please try the attached patch, it appears to fix this.
> 

Thanks a lot. The patch applied fine and the Problem is fixed.

> Klaus

Cheers
Marcus
  

Patch

--- menu.c	2011/02/25 14:24:32	2.26
+++ menu.c	2011/02/26 15:28:32
@@ -2276,7 +2276,7 @@ 
   for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
       if (!base || (strstr(recording->Name(), base) == recording->Name() && recording->Name()[strlen(base)] == FOLDERDELIMCHAR)) {
          cMenuRecordingItem *Item = new cMenuRecordingItem(recording, level);
-         if (*Item->Text() && (!LastItem || strcmp(Item->Text(), LastItemText) != 0)) {
+         if (*Item->Text() && (!Item->IsDirectory() || (!LastItem || !LastItem->IsDirectory() || strcmp(Item->Text(), LastItemText) != 0))) {
             Add(Item);
             LastItem = Item;
             free(LastItemText);