Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace onstart and onstop with onevent #465

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions server/streamreader/spotifyStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : P
string volume = uri_.getQuery("volume", "");
string bitrate = uri_.getQuery("bitrate", "320");
string devicename = uri_.getQuery("devicename", "Snapcast");
string onstart = uri_.getQuery("onstart", "");
string onstop = uri_.getQuery("onstop", "");
string onevent = uri_.getQuery("onevent", "");

if (username.empty() != password.empty())
throw SnapException("missing parameter \"username\" or \"password\" (must provide both, or neither)");
Expand All @@ -54,10 +53,8 @@ SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : P
params_ += " --cache \"" + cache + "\"";
if (!volume.empty())
params_ += " --initial-volume \"" + volume + "\"";
if (!onstart.empty())
params_ += " --onstart \"" + onstart + "\"";
if (!onstop.empty())
params_ += " --onstop \"" + onstop + "\"";
if (!onevent.empty())
params_ += " --onevent \"" + onevent + "\"";

if (uri_.query.find("username") != uri_.query.end())
uri_.query["username"] = "xxx";
Expand Down