mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-04 08:42:07 +00:00
Fixed musik::core::Query::SortTracks for remote library.
This commit is contained in:
parent
9732fd0eff
commit
8b331108da
@ -232,7 +232,17 @@ void Query::SortTracks::ClearTracks(){
|
|||||||
bool Query::SortTracks::RecieveQuery(musik::core::xml::ParserNode &queryNode){
|
bool Query::SortTracks::RecieveQuery(musik::core::xml::ParserNode &queryNode){
|
||||||
|
|
||||||
while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){
|
while( musik::core::xml::ParserNode node = queryNode.ChildNode() ){
|
||||||
if(node.Name()=="tracks"){
|
if(node.Name()=="sortby"){
|
||||||
|
node.WaitForContent();
|
||||||
|
try{
|
||||||
|
// Split list directly into the sortMetaKeys
|
||||||
|
boost::algorithm::split(this->sortMetaKeys,node.Content(),boost::algorithm::is_any_of(","));
|
||||||
|
}
|
||||||
|
catch(...){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(node.Name()=="tracks"){
|
||||||
node.WaitForContent();
|
node.WaitForContent();
|
||||||
|
|
||||||
typedef std::vector<std::string> StringVector;
|
typedef std::vector<std::string> StringVector;
|
||||||
@ -260,6 +270,16 @@ std::string Query::SortTracks::Name(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Query::SortTracks::SendQuery(musik::core::xml::WriterNode &queryNode){
|
bool Query::SortTracks::SendQuery(musik::core::xml::WriterNode &queryNode){
|
||||||
|
{
|
||||||
|
xml::WriterNode sortbyNode(queryNode,"sortby");
|
||||||
|
|
||||||
|
for(StringList::iterator metaKey=this->sortMetaKeys.begin();metaKey!=this->sortMetaKeys.end();++metaKey){
|
||||||
|
if(!sortbyNode.Content().empty()){
|
||||||
|
sortbyNode.Content().append(",");
|
||||||
|
}
|
||||||
|
sortbyNode.Content().append(*metaKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
xml::WriterNode tracksNode(queryNode,"tracks");
|
xml::WriterNode tracksNode(queryNode,"tracks");
|
||||||
|
|
||||||
|
@ -69,7 +69,9 @@ namespace musik{ namespace core{
|
|||||||
|
|
||||||
typedef std::vector<int> IntVector;
|
typedef std::vector<int> IntVector;
|
||||||
IntVector tracksToSort;
|
IntVector tracksToSort;
|
||||||
std::list<std::string> sortMetaKeys;
|
|
||||||
|
typedef std::list<std::string> StringList;
|
||||||
|
StringList sortMetaKeys;
|
||||||
|
|
||||||
|
|
||||||
friend class Library::Base;
|
friend class Library::Base;
|
||||||
|
Loading…
Reference in New Issue
Block a user