Skip to content

Commit

Permalink
Replace onstart and onstop with onevent
Browse files Browse the repository at this point in the history
Update to replace onstart and onstop parameters with librespots onevent parameter.

librespot-org/librespot#185
  • Loading branch information
zteifel authored and badaix committed Sep 23, 2019
1 parent 6204506 commit b733f64
Showing 1 changed file with 3 additions and 6 deletions.
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

0 comments on commit b733f64

Please sign in to comment.