diff options
-rw-r--r-- | media/mediaManager.cpp | 6 | ||||
-rw-r--r-- | plugins/provider/recProvider/recProvider.cpp | 24 |
2 files changed, 24 insertions, 6 deletions
diff --git a/media/mediaManager.cpp b/media/mediaManager.cpp index c59e357..5bd02eb 100644 --- a/media/mediaManager.cpp +++ b/media/mediaManager.cpp @@ -425,11 +425,11 @@ int cMediaManager::Browse(BrowseRequest& request){ cSortCriteria::SortCriteriaList list = cSortCriteria::parse(request.sortCriteria); if(!list.empty()){ - metadata << " ORDER BY "; + metadata << " ORDER BY `"; upnp::cSortCriteria::SortCriteriaList::iterator it = list.begin(); - metadata << (*it).property << " " << ((*it).sortDescending ? "DESC" : "ASC"); + metadata << (*it).property << "` " << ((*it).sortDescending ? "DESC" : "ASC"); for(++it; it != list.end(); ++it){ - metadata << ", " << (*it).property << " " << ((*it).sortDescending ? "DESC" : "ASC"); + metadata << ", `" << (*it).property << "` " << ((*it).sortDescending ? "DESC" : "ASC"); } } 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); } } |