diff options
Diffstat (limited to 'recman.cpp')
-rw-r--r-- | recman.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -26,7 +26,8 @@ namespace vdrlive { shared_ptr< RecordingsTree > RecordingsManager::m_recTree; shared_ptr< RecordingsList > RecordingsManager::m_recList; shared_ptr< DirectoryList > RecordingsManager::m_recDirs; - int RecordingsManager::m_recordingsState = 0; + time_t RecordingsManager::m_recordingsState = 0; + string RecordingsManager::m_UpdateFileName; // The RecordingsManager holds a VDR lock on the // Recordings. Additionally the singleton instance of @@ -256,6 +257,20 @@ namespace vdrlive { return archived; } +#if VDRVERSNUM >= 20301 + bool RecordingsManager::StateChanged (time_t& tm) + { + if (m_UpdateFileName.empty()) { + m_UpdateFileName = AddDirectory (cVideoDirectory::Name(), ".update"); + } + LOCK_RECORDINGS_READ; + time_t lastmod = LastModifiedTime (m_UpdateFileName.c_str()); + bool result = tm != lastmod; + tm = lastmod; + return result; + } +#endif + RecordingsManagerPtr RecordingsManager::EnsureValidData() { // Get singleton instance of RecordingsManager. 'this' is not @@ -272,7 +287,7 @@ namespace vdrlive { // StateChanged must be executed every time, so not part of // the short cut evaluation in the if statement below. #if VDRVERSNUM >= 20301 - bool stateChanged = true; + bool stateChanged = StateChanged (m_recordingsState); #else bool stateChanged = Recordings.StateChanged(m_recordingsState); #endif |