summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-09-25 13:49:31 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-09-25 13:49:31 +0200
commitc3a76dfef6b62a003f159f2ec1ef0ca6d2290db7 (patch)
tree852a9b9177f3ec7c666ab4e6c01976bfcd41bf0a /recording.c
parentf2183f9ff56f6f0024d9c55df6472f37f638adc0 (diff)
downloadvdr-c3a76dfef6b62a003f159f2ec1ef0ca6d2290db7.tar.gz
vdr-c3a76dfef6b62a003f159f2ec1ef0ca6d2290db7.tar.bz2
The '.update' file in the video directory is now touched when a recording is added or deleted
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/recording.c b/recording.c
index 35aefc80..de657698 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.117 2005/09/25 12:28:40 kls Exp $
+ * $Id: recording.c 1.118 2005/09/25 13:45:13 kls Exp $
*/
#include "recording.h"
@@ -746,6 +746,7 @@ cRecordings Recordings;
cRecordings::cRecordings(bool Deleted)
:cThread("video directory scanner")
{
+ updateFileName = strdup(AddDirectory(VideoDirectory, ".update"));
deleted = Deleted;
lastUpdate = 0;
state = 0;
@@ -754,6 +755,7 @@ cRecordings::cRecordings(bool Deleted)
cRecordings::~cRecordings()
{
Cancel(3);
+ free(updateFileName);
}
void cRecordings::Action(void)
@@ -821,9 +823,15 @@ bool cRecordings::StateChanged(int &State)
return Result;
}
+void cRecordings::TouchUpdate(void)
+{
+ TouchFile(updateFileName);
+ lastUpdate = time(NULL); // make sure we don't tigger ourselves
+}
+
bool cRecordings::NeedsUpdate(void)
{
- return lastUpdate < LastModifiedTime(AddDirectory(VideoDirectory, ".update"));
+ return lastUpdate < LastModifiedTime(updateFileName);
}
bool cRecordings::Update(bool Wait)
@@ -854,6 +862,7 @@ void cRecordings::AddByName(const char *FileName)
recording = new cRecording(FileName);
Add(recording);
ChangeState();
+ TouchUpdate();
}
}
@@ -864,6 +873,7 @@ void cRecordings::DelByName(const char *FileName)
if (recording) {
Del(recording);
ChangeState();
+ TouchUpdate();
}
}