diff options
-rw-r--r-- | recman.cpp | 20 | ||||
-rw-r--r-- | recman.h | 5 |
2 files changed, 12 insertions, 13 deletions
@@ -27,8 +27,7 @@ namespace vdrlive { std::tr1::shared_ptr< RecordingsList > RecordingsManager::m_recList; std::tr1::shared_ptr< DirectoryList > RecordingsManager::m_recDirs; #if VDRVERSNUM >= 20301 - time_t RecordingsManager::m_recordingsState = 0; - string RecordingsManager::m_UpdateFileName; + cStateKey RecordingsManager::m_recordingsStateKey; #else int RecordingsManager::m_recordingsState = 0; #endif @@ -262,15 +261,16 @@ namespace vdrlive { } #if VDRVERSNUM >= 20301 - bool RecordingsManager::StateChanged (time_t& tm) + bool RecordingsManager::StateChanged () { - if (m_UpdateFileName.empty()) { - m_UpdateFileName = AddDirectory (cVideoDirectory::Name(), ".update"); + bool result = false; + + // will return != 0 only, if the Recordings List has been changed since last read + if (cRecordings::GetRecordingsRead(m_recordingsStateKey)) { + result = true; + m_recordingsStateKey.Remove(); } - LOCK_RECORDINGS_READ; - time_t lastmod = LastModifiedTime (m_UpdateFileName.c_str()); - bool result = tm != lastmod; - tm = lastmod; + return result; } #endif @@ -291,7 +291,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 = StateChanged (m_recordingsState); + bool stateChanged = StateChanged(); #else bool stateChanged = Recordings.StateChanged(m_recordingsState); #endif @@ -123,7 +123,7 @@ namespace vdrlive { RecordingsManager(); #if VDRVERSNUM >= 20301 - static bool StateChanged (time_t& tm); + static bool StateChanged(); #endif static RecordingsManagerPtr EnsureValidData(); @@ -132,8 +132,7 @@ namespace vdrlive { static std::tr1::shared_ptr< RecordingsList > m_recList; static std::tr1::shared_ptr< DirectoryList > m_recDirs; #if VDRVERSNUM >= 20301 - static time_t m_recordingsState; - static std::string m_UpdateFileName; + static cStateKey m_recordingsStateKey; #else static int m_recordingsState; #endif |