mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-06 04:41:44 +02:00
Force unique stream name, use name as id
This commit is contained in:
parent
d76aac0de7
commit
341466ceb5
7 changed files with 32 additions and 39 deletions
|
@ -41,15 +41,6 @@ StreamUri::StreamUri(const std::string& streamUri)
|
|||
string decodedUri = uriDecode(uri);
|
||||
logD << "StreamUri: " << decodedUri << "\n";
|
||||
|
||||
id_ = decodedUri;
|
||||
pos = id_.find('?');
|
||||
if (pos != string::npos)
|
||||
id_ = id_.substr(0, pos);
|
||||
pos = id_.find('#');
|
||||
if (pos != string::npos)
|
||||
id_ = id_.substr(0, pos);
|
||||
logD << "id: '" << id_ << "'\n";
|
||||
|
||||
string tmp(decodedUri);
|
||||
|
||||
pos = tmp.find(':');
|
||||
|
@ -98,8 +89,6 @@ StreamUri::StreamUri(const std::string& streamUri)
|
|||
string key = trim_copy(kv.substr(0, pos));
|
||||
string value = trim_copy(kv.substr(pos+1));
|
||||
query[key] = value;
|
||||
if (key == "id")
|
||||
id_ = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,12 +108,6 @@ json StreamUri::toJson() const
|
|||
}
|
||||
|
||||
|
||||
std::string StreamUri::id() const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
|
||||
std::string StreamUri::getQuery(const std::string& key, const std::string& def) const
|
||||
{
|
||||
auto iter = query.find(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue