mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-11 08:06:41 +02:00
validate parameters
This commit is contained in:
parent
1cc4bc23e7
commit
ce8ed1e3f3
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : P
|
|||
string password = uri_.getQuery("password", "");
|
||||
string bitrate = uri_.getQuery("bitrate", "320");
|
||||
string devicename = uri_.getQuery("devicename", "Snapcast");
|
||||
|
||||
if (username.empty())
|
||||
throw SnapException("missing parameter \"username\"");
|
||||
if (password.empty())
|
||||
throw SnapException("missing parameter \"password\"");
|
||||
|
||||
params = "--name \"" + devicename + "\" --username \"" + username + "\" --password \"" + password + "\" --bitrate " + bitrate + " --backend stdout";
|
||||
logO << "params: " << params << "\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue