1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Only calling RemoveEmptyVideoDirectories() once in case a recording has been deleted

This commit is contained in:
Klaus Schmidinger 2006-03-19 14:12:57 +01:00
parent 7fb99e696f
commit cf1941ca01
3 changed files with 9 additions and 2 deletions

View File

@ -1619,6 +1619,8 @@ Marcus Hilbrich <s4440288@mail.inf.tu-dresden.de>
Hardy Flor <HFlor@web.de> Hardy Flor <HFlor@web.de>
for a patch that was used as a base to implement SVDRP commands for plugins for a patch that was used as a base to implement SVDRP commands for plugins
for implementing the SVDRP command PLAY for implementing the SVDRP command PLAY
for reporting that RemoveEmptyVideoDirectories() was called for every single
recording that has been deleted
Harald Milz <hm@seneca.muc.de> Harald Milz <hm@seneca.muc.de>
for his CUTR patch, which was used as a base to implement the SVDRP command EDIT for his CUTR patch, which was used as a base to implement the SVDRP command EDIT

View File

@ -4430,3 +4430,5 @@ Video Disk Recorder Revision History
(thanks to Werner Fink). (thanks to Werner Fink).
- Updated 'sources.conf'. - Updated 'sources.conf'.
- Fixed the shutdown timeout (thanks to Alexander Wenzel). - Fixed the shutdown timeout (thanks to Alexander Wenzel).
- Only calling RemoveEmptyVideoDirectories() once in case a recording has been
deleted (reported by Hardy Flor).

View File

@ -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 1.140 2006/02/26 11:59:59 kls Exp $ * $Id: recording.c 1.141 2006/03/19 14:08:58 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -83,6 +83,7 @@ void cRemoveDeletedRecordingsThread::Action(void)
// Make sure only one instance of VDR does this: // Make sure only one instance of VDR does this:
cLockFile LockFile(VideoDirectory); cLockFile LockFile(VideoDirectory);
if (LockFile.Lock()) { if (LockFile.Lock()) {
bool deleted = false;
cThreadLock DeletedRecordingsLock(&DeletedRecordings); cThreadLock DeletedRecordingsLock(&DeletedRecordings);
for (cRecording *r = DeletedRecordings.First(); r; ) { for (cRecording *r = DeletedRecordings.First(); r; ) {
if (r->deleted && time(NULL) - r->deleted > DELETEDLIFETIME) { if (r->deleted && time(NULL) - r->deleted > DELETEDLIFETIME) {
@ -90,11 +91,13 @@ void cRemoveDeletedRecordingsThread::Action(void)
r->Remove(); r->Remove();
DeletedRecordings.Del(r); DeletedRecordings.Del(r);
r = next; r = next;
RemoveEmptyVideoDirectories(); deleted = true;
continue; continue;
} }
r = DeletedRecordings.Next(r); r = DeletedRecordings.Next(r);
} }
if (deleted)
RemoveEmptyVideoDirectories();
} }
} }