diff options
author | methodus <methodus@web.de> | 2012-10-31 18:32:39 +0100 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-10-31 18:32:39 +0100 |
commit | 8a101f6b70a7407bdc7408083cb280cb14ba3bce (patch) | |
tree | 8208196be9bcd9f66a38b205932a72c56b20f8cc /plugins/provider/recProvider | |
parent | d054d60aa495b513744eb3fcd59af952dbc0c1aa (diff) | |
download | vdr-plugin-upnp-8a101f6b70a7407bdc7408083cb280cb14ba3bce.tar.gz vdr-plugin-upnp-8a101f6b70a7407bdc7408083cb280cb14ba3bce.tar.bz2 |
Fixed sql statement of sort criteria.
Diffstat (limited to 'plugins/provider/recProvider')
-rw-r--r-- | plugins/provider/recProvider/recProvider.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/plugins/provider/recProvider/recProvider.cpp b/plugins/provider/recProvider/recProvider.cpp index 22fc5eb..31d46e4 100644 --- a/plugins/provider/recProvider/recProvider.cpp +++ b/plugins/provider/recProvider/recProvider.cpp @@ -258,12 +258,30 @@ public: } virtual void Action(){ + int state = 0; + time_t now; + bool update = false; while(Running()){ - int state = 0; - if(Recordings.NeedsUpdate() || Recordings.StateChanged(state)){ + update = false; + + if(Recordings.NeedsUpdate()){ + update = true; + } else if(Recordings.StateChanged(state)){ + now = time(NULL); + for(cRecording* rec = Recordings.First(); rec; rec = Recordings.Next(rec)){ + struct stat st; + if (lstat(rec->FileName(), &st) == 0) { + if(now < st.st_mtime){ + update = true; + } + } + } + } + + if(update){ OnContainerUpdate(GetRootContainer(), GetContainerUpdateId(GetRootContainer())); } - sleep(100); + sleep(10); } } |