/// <summary> /// Public scrobble function. Scrobbles a PlayedTrack object. /// </summary> /// <param name="track"> /// A <see cref="PlayedTrack"/> /// </param> public void Scrobble(Entry track) { RequestParameters p = new RequestParameters(parameters); // Add parameters of track to base parameters p.Append(track.getParameters()); // This scrobbles the collection of parameters no matter what they belong to. this.Scrobble(p); }
/// <summary> /// Send the now playing notification. /// </summary> /// <param name="track"> /// A <see cref="NowplayingTrack"/> /// </param> public void ReportNowplaying(NowplayingTrack track) { RequestParameters p = new RequestParameters(parameters); p.Append(track.getParameters()); p["method"] = "track.updateNowPlaying"; p["api_sig"] = Utilities.MD5(p.ToStringForSig(ApiSecret)); Request request = new Request(new Uri(this.ApiURL), p); // A BadSessionException occurs when another client has made a handshake // with this user's credentials, should redo a handshake and pass this // exception quietly. try { request.executeThreaded(); } catch (BadSessionException) { this.ReportNowplaying(track); } }