diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-18 17:11:32 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-18 17:11:32 +0000 |
commit | b369ec70384b7e26db556f7eedcb4ddea03b47c3 (patch) | |
tree | 427ffc74e7aa9d27782cdef0bbaa59a3ae25680e | |
parent | 850fe0ddff35d86a0a3c876ee518ecfb778767d5 (diff) | |
download | vdr-plugin-live-b369ec70384b7e26db556f7eedcb4ddea03b47c3.tar.gz vdr-plugin-live-b369ec70384b7e26db556f7eedcb4ddea03b47c3.tar.bz2 |
- added method to retrieve recording by md5-hash
-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(); |