diff options
-rw-r--r-- | recordings.cpp | 11 | ||||
-rw-r--r-- | recordings.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/recordings.cpp b/recordings.cpp index 5d82a68..a1fe886 100644 --- a/recordings.cpp +++ b/recordings.cpp @@ -27,6 +27,17 @@ namespace vdrlive { return hashStr.str(); } + const cRecording* RecordingsManager::GetByMd5Hash(const string& hash) const + { + if (!hash.empty()) { + for (cRecording* rec = Recordings.First(); rec != 0; rec = Recordings.Next(rec)) { + if (hash == Md5Hash(rec)) + return rec; + } + } + return 0; + } + RecordingsTree::RecordingsTree(RecordingsManagerPtr recMan) : m_maxLevel(0), m_root(new RecordingsItemDir()), diff --git a/recordings.h b/recordings.h index bf016a4..e629d8c 100644 --- a/recordings.h +++ b/recordings.h @@ -26,6 +26,12 @@ namespace vdrlive { */ string Md5Hash(const cRecording* recording) const; + /** + * fetches a cRecording from VDR's Recordings collection. Returns + * NULL if recording was not found + */ + const cRecording* GetByMd5Hash(const std::string& hash) const; + private: RecordingsManager(); |