diff options
author | methodus <methodus@web.de> | 2012-10-31 18:32:39 +0100 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-10-31 18:32:39 +0100 |
commit | 8a101f6b70a7407bdc7408083cb280cb14ba3bce (patch) | |
tree | 8208196be9bcd9f66a38b205932a72c56b20f8cc | |
parent | d054d60aa495b513744eb3fcd59af952dbc0c1aa (diff) | |
download | vdr-plugin-upnp-8a101f6b70a7407bdc7408083cb280cb14ba3bce.tar.gz vdr-plugin-upnp-8a101f6b70a7407bdc7408083cb280cb14ba3bce.tar.bz2 |
Fixed sql statement of sort criteria.
-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); } } |