~ubuntu-branches/ubuntu/raring/banshee/raring

« back to all changes in this revision

Viewing changes to src/Libraries/Lastfm/Lastfm/AudioscrobblerConnection.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2012-02-18 22:17:24 UTC
  • mfrom: (6.3.23 experimental)
  • Revision ID: package-import@ubuntu.com-20120218221724-cnwdvn490wjjue8t
Tags: 2.3.5-1ubuntu1
* Merge from Debian Experimental, remaining changes:
  + Enable and recommend SoundMenu and Disable NotificationArea by default
  + Disable boo and karma extensions
  + Move desktop file for Meego UI to /usr/share/une/applications
  + Change the url for the Amazon store redirector

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        private const int FAILURE_LOG_MINUTES = 5; /* 5 minute delay on logging failure to upload information */
56
56
        private const int RETRY_SECONDS = 60; /* 60 second delay for transmission retries */
57
57
        private const int MAX_RETRY_SECONDS = 7200; /* 2 hours, as defined in the last.fm protocol */
58
 
        private const int TIME_OUT = 5000; /* 5 seconds timeout for webrequests */
 
58
        private const int TIME_OUT = 10000; /* 10 seconds timeout for webrequests */
59
59
        private const string CLIENT_ID = "bsh";
60
60
        private const string CLIENT_VERSION = "0.1";
61
61
        private const string SCROBBLER_URL = "http://post.audioscrobbler.com/";
241
241
                return;
242
242
            }
243
243
 
 
244
            string song_transmit_info = queue.GetTransmitInfo  (out num_tracks_transmitted);
 
245
            Log.DebugFormat ("Last.fm scrobbler sending '{0}' to {1}", song_transmit_info, post_url);
 
246
 
244
247
            StringBuilder sb = new StringBuilder ();
245
248
 
246
249
            sb.AppendFormat ("s={0}", session_id);
247
 
 
248
 
            sb.Append (queue.GetTransmitInfo (out num_tracks_transmitted));
 
250
            sb.Append (song_transmit_info);
249
251
 
250
252
            current_web_req = (HttpWebRequest) WebRequest.Create (post_url);
251
253
            current_web_req.UserAgent = LastfmCore.UserAgent;
253
255
            current_web_req.ContentType = "application/x-www-form-urlencoded";
254
256
            current_web_req.ContentLength = sb.Length;
255
257
 
256
 
            //Console.WriteLine ("Sending {0} ({1} bytes) to {2}", sb.ToString (), sb.Length, post_url);
257
 
 
258
258
            TransmitState ts = new TransmitState ();
259
259
            ts.Count = num_tracks_transmitted;
260
260
            ts.StringBuilder = sb;