Last.FM Rework and Auto DJ mode (1 Viewer)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    So i think it crash here :
    Code:
    /// <summary>
        /// Attempt to get XML web response via HTTP
        /// </summary>
        /// <param name="querystring">Querystring to be passed to webservice</param>
        /// <param name="httpMethod">GET or POST</param>
        /// <param name="useHttps">Whether to use HTTPS</param>
        /// <returns>The xml returned by Webservice</returns>
        /// <exception cref="LastFMException">Details of last.fm error or will wrap actual exception as inner exception</exception>
        private static XDocument GetXml(string querystring, string httpMethod, bool useHttps)
        {
          HttpWebResponse response;
          XDocument xDoc;
          var url = useHttps ? BaseURLHttps : BaseURL;
          if (httpMethod == "GET")
          {
            url = url + "?" + querystring;
          }
    
          bool webExceptionStatus = false;
          var postArray = Encoding.UTF8.GetBytes(querystring);
          var request = (HttpWebRequest) WebRequest.Create(url);
          request.Method = httpMethod;
          request.ServicePoint.Expect100Continue = false;
          if (httpMethod == "POST")
          {
            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postArray.Length;
            var s = request.GetRequestStream();
            s.Write(postArray, 0, postArray.Length);
            s.Close();
          }

    Can you try attached bin ?
     

    Attachments

    • LastFMLibrary.zip
      33.2 KB

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Too busy with fontEngine stuff now, I tested with build from "Early 1.6.0..." thread, unfortunately I had my modified Core.dll on but I really think it should not matter in these cases.

    I think that for b) the problem is just that the processing is done in a separate thread without error handling -> all errors lead to hard-crash. In this case error is probably just a connection timeout to Last.FM site.
     

    royne

    Portal Member
    January 4, 2007
    41
    2
    59
    Asker
    Home Country
    Norway Norway
    Hi
    I have a valid Subscription in Norway for last.fm, but i cant get Radio to work. (Autoscrobler Works fine).
    Radio is ok when using it With web/IE, but in MP i get this Message:
    "radio station not supported with this country/client combination"

    Why does last.fm work in IE but not in MP 1.6 ?
     
    Last edited:

    royne

    Portal Member
    January 4, 2007
    41
    2
    59
    Asker
    Home Country
    Norway Norway
    Thanks, I liked to use last.fm radio (no need to act as a DJ) This seems to be difficult from all countries except UK, Germany and US :(
    Is the country sendt to last.fm via the API?
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    It would be nice if this would be a separate plugin in the future, I don't think it should ship with default MP setup. Maybe when blowing WindowPlugins to separate projects is done (see Area-51).
     

    edterbak

    Portal Pro
    March 4, 2008
    2,114
    1,176
    Home Country
    Netherlands Netherlands
    It would be nice if this would be a separate plugin in the future, I don't think it should ship with default MP setup. Maybe when blowing WindowPlugins to separate projects is done (see Area-51).
    Same maybe for Minidisplay?
     

    Peter2

    MP Donator
  • Premium Supporter
  • September 18, 2006
    848
    53
    Home Country
    Belgium Belgium
    Hi guys,
    What is that numeric field in the plugin - in my case it holds the number 100.
    P.
     

    olli14

    Portal Pro
    December 17, 2008
    740
    35
    Home Country
    Germany Germany
    I'm on Mediaportal 1.3 final and want to test this plugin. What do I have to do? Do I have to make a clean re-install?

    olli14
     

    Users who are viewing this thread

    Top Bottom