mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Avoiding double entries when externally renaming a recording
This commit is contained in:
parent
7c877edd2d
commit
089b5eb212
12
recording.c
12
recording.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: recording.c 3.9 2013/12/24 14:32:29 kls Exp $
|
* $Id: recording.c 3.10 2013/12/27 08:46:17 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "recording.h"
|
#include "recording.h"
|
||||||
@ -1392,6 +1392,7 @@ void cRecordings::Refresh(bool Foreground)
|
|||||||
|
|
||||||
void cRecordings::ScanVideoDir(const char *DirName, bool Foreground, int LinkLevel, int DirLevel)
|
void cRecordings::ScanVideoDir(const char *DirName, bool Foreground, int LinkLevel, int DirLevel)
|
||||||
{
|
{
|
||||||
|
bool DoChangeState = false;
|
||||||
// Find any new recordings:
|
// Find any new recordings:
|
||||||
cReadDir d(DirName);
|
cReadDir d(DirName);
|
||||||
struct dirent *e;
|
struct dirent *e;
|
||||||
@ -1420,7 +1421,10 @@ void cRecordings::ScanVideoDir(const char *DirName, bool Foreground, int LinkLev
|
|||||||
r->deleted = time(NULL);
|
r->deleted = time(NULL);
|
||||||
Lock();
|
Lock();
|
||||||
Add(r);
|
Add(r);
|
||||||
ChangeState();
|
if (initial)
|
||||||
|
ChangeState();
|
||||||
|
else
|
||||||
|
DoChangeState = true;
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1441,11 +1445,13 @@ void cRecordings::ScanVideoDir(const char *DirName, bool Foreground, int LinkLev
|
|||||||
Lock();
|
Lock();
|
||||||
Del(r, false);
|
Del(r, false);
|
||||||
VanishedRecordings.Add(r);
|
VanishedRecordings.Add(r);
|
||||||
ChangeState();
|
DoChangeState = true;
|
||||||
Unlock();
|
Unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (DoChangeState)
|
||||||
|
ChangeState();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cRecordings::StateChanged(int &State)
|
bool cRecordings::StateChanged(int &State)
|
||||||
|
Loading…
Reference in New Issue
Block a user