summaryrefslogtreecommitdiff
path: root/videodir.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-12-18 10:41:26 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-12-18 10:41:26 +0100
commit579719a7f24079bc36939c6b7757030b7299ba29 (patch)
tree4c9ba173f8e58d16e96c993f3b561fb14a898c03 /videodir.c
parentdb35165e25974df8719d253cde398831877c526d (diff)
downloadvdr-579719a7f24079bc36939c6b7757030b7299ba29.tar.gz
vdr-579719a7f24079bc36939c6b7757030b7299ba29.tar.bz2
When displaying the amount of free disk space, the space consumed by "deleted" recordings is now taken into account
Diffstat (limited to 'videodir.c')
-rw-r--r--videodir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/videodir.c b/videodir.c
index 5206d0c7..a07ed28e 100644
--- a/videodir.c
+++ b/videodir.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: videodir.c 1.13 2005/10/31 12:07:41 kls Exp $
+ * $Id: videodir.c 1.14 2005/12/18 10:33:20 kls Exp $
*/
#include "videodir.h"
@@ -16,6 +16,7 @@
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
+#include "recording.h"
#include "tools.h"
const char *VideoDirectory = VIDEODIR;
@@ -185,12 +186,17 @@ bool VideoFileSpaceAvailable(int SizeMB)
int VideoDiskSpace(int *FreeMB, int *UsedMB)
{
int free = 0, used = 0;
+ int deleted = DeletedRecordings.TotalFileSizeMB();
cVideoDirectory Dir;
do {
int u;
free += Dir.FreeMB(&u);
used += u;
} while (Dir.Next());
+ if (deleted > used)
+ deleted = used; // let's not get beyond 100%
+ free += deleted;
+ used -= deleted;
if (FreeMB)
*FreeMB = free;
if (UsedMB)