From cf1941ca0195829b6865de778bc24d12eb9b77d7 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 19 Mar 2006 14:12:57 +0100 Subject: Only calling RemoveEmptyVideoDirectories() once in case a recording has been deleted --- CONTRIBUTORS | 2 ++ HISTORY | 2 ++ recording.c | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2888445e..2b3641c8 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1619,6 +1619,8 @@ Marcus Hilbrich Hardy Flor for a patch that was used as a base to implement SVDRP commands for plugins for implementing the SVDRP command PLAY + for reporting that RemoveEmptyVideoDirectories() was called for every single + recording that has been deleted Harald Milz for his CUTR patch, which was used as a base to implement the SVDRP command EDIT diff --git a/HISTORY b/HISTORY index 699fabf7..c03e27c9 100644 --- a/HISTORY +++ b/HISTORY @@ -4430,3 +4430,5 @@ Video Disk Recorder Revision History (thanks to Werner Fink). - Updated 'sources.conf'. - Fixed the shutdown timeout (thanks to Alexander Wenzel). +- Only calling RemoveEmptyVideoDirectories() once in case a recording has been + deleted (reported by Hardy Flor). diff --git a/recording.c b/recording.c index b8db2647..6c1692b8 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * 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" @@ -83,6 +83,7 @@ void cRemoveDeletedRecordingsThread::Action(void) // Make sure only one instance of VDR does this: cLockFile LockFile(VideoDirectory); if (LockFile.Lock()) { + bool deleted = false; cThreadLock DeletedRecordingsLock(&DeletedRecordings); for (cRecording *r = DeletedRecordings.First(); r; ) { if (r->deleted && time(NULL) - r->deleted > DELETEDLIFETIME) { @@ -90,11 +91,13 @@ void cRemoveDeletedRecordingsThread::Action(void) r->Remove(); DeletedRecordings.Del(r); r = next; - RemoveEmptyVideoDirectories(); + deleted = true; continue; } r = DeletedRecordings.Next(r); } + if (deleted) + RemoveEmptyVideoDirectories(); } } -- cgit v1.2.3