Last.FM Rework and Auto DJ mode (2 Viewers)

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I will try and yes it's when 'null' is parsed that the crash occurs :)
    I know you are not busy :whistle: so if you do want to spend some time you could check for regression here :D

    Using pre log4net code if you passed a null to Log.Error(Exception ex) did it fail like it does now or is this regression?
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I fixed it by replacing in line 286 here : Log.Error(ex.InnerException); to Log.Error(ex.Message);
    Now error is logged but no crash anymore.
    Don't know if it's the right way to do lol
    Seb could you try
    Code:
    		if (ex.LastFMError != LastFMException.LastFMErrorCode.UnknownError)
    		{
    		  Log.Error("Last.fm error when announcing now playing track: {0} - {1}",currentSong.Artist, currentSong.Title);
    		  Log.Error(ex.Message);
    		}
    		else
    		{
    		  Log.Error("Exception when updating now playing track on last.fm");
    		  Log.Error(ex.InnerException);
    		}

    Instead?

    Also are you able to see why this is a problem? Can you debug as is to see if ex.innerexception is actually set? If not I am guessing that the logging does not handle a null being passed to it? (but did previously ??)

    Also I did notice a bug that since last commit AutoDJ will not work unless the announce option is ticked but I will fix that when I am next at a dev machine

    It's working :) (about log error now with your change)
    I did break AutoDJ then :(
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I will try and yes it's when 'null' is parsed that the crash occurs :)
    I know you are not busy :whistle: so if you do want to spend some time you could check for regression here :D

    Using pre log4net code if you passed a null to Log.Error(Exception ex) did it fail like it does now or is this regression?

    I'm not sure to see/know how to do that :(
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I'm not sure to see/know how to do that :(
    Could you checkout and test 1.3 Final code with old logger and just get some code to do the same (something like)
    Code:
    var ex = new Exception();
    Log.Error(ex.InnerException);
    Probably will be the same and probably should be like this but just want to be sure this is still working as it did before.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I have add your line in videoplayer code :)
    And mp didn't crash and i can confirm that we have the same 'null' value :)

    Code:
    2013-04-26 19:51:12.780471 [ERROR][MPMain(1)]: VideoPlayer9: Exception while creating DShow graph Object reference not set to an instance of an object.	at MediaPortal.ServiceImplementations.LogImpl.Write(Exception ex) in D:\svnroot\MediaPortal-1-Git_Commit-4-Master\mediaportal\Utils\ServiceImplementations\LogImpl.cs:line 172
      at MediaPortal.ServiceImplementations.LogImpl.Error(Exception ex) in D:\svnroot\MediaPortal-1-Git_Commit-4-Master\mediaportal\Utils\ServiceImplementations\LogImpl.cs:line 238
      at MediaPortal.GUI.Library.Log.Error(Exception ex) in D:\svnroot\MediaPortal-1-Git_Commit-4-Master\mediaportal\Core\guilib\Log.cs:line 60
      at MediaPortal.Player.VideoPlayerVMR9.GetInterfaces() in D:\svnroot\MediaPortal-1-Git_Commit-4-Master\mediaportal\Core\Player\VideoPlayerVMR9.cs:line 510
    2013-04-26 19:51:15.097946 [ERROR][MPMain(1)]: PlaylistPlayer: *** unable to play - Z:\-=- Serie TV 1 -=-\Charmed Saison 7\Charmed_-_7x01_-_Ensorcelés.french.DVB.$Death-Team$.xvid.avi - skipping track!

    If my test is OK, so it's clearly a regression.
    The diff between 1.3Final and your branch is that music start.

    I will going to do another test in another part of code :)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I don't know what to say :)

    If i add the same code on your branch to create the issue in videoplayer, it's ok MP didn't crash but when it comes from music it crash.
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Almost perfect Mike, but the new option 'Allow different versions of the same track' seems broken. I've seen a lot of similar songs again in my playlist.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I'm not sure to see/know how to do that :(
    Could you checkout and test 1.3 Final code with old logger and just get some code to do the same (something like)
    Code:
    var ex = new Exception();
    Log.Error(ex.InnerException);
    Probably will be the same and probably should be like this but just want to be sure this is still working as it did before.

    Hi,

    I have push some commit in branch, can you see if it's ok, i have commit your change about null value and also prevent to announce track for URL stream.
    When i have tested regression about null value in other place than music, MP didn't crash.

    So best you can try by yourself when back from your work trip :)

    Thanks :)

    Ps : Like HomeY said, it seems to work fine but i have also some same track in log lol
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    1 tiny hick-up in HTTP response:
    Code:
    [2013-05-04 14:39:31,975] [Error  ] [Announce/Auto DJ] [ERROR] - Error in Last.fm AutoDJ
    [2013-05-04 14:39:31,984] [Log	] [Announce/Auto DJ] [ERROR] - Exception: MediaPortal.LastFM.LastFMException: Error in HTTP response ---> System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 2, position 3.
      at System.Xml.XmlTextReaderImpl.Throw(Exception e)
      at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
      at System.Xml.XmlTextReaderImpl.ParsePI(BufferBuilder piInDtdStringBuilder)
      at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
      at System.Xml.XmlTextReaderImpl.Read()
      at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
      at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
      at System.Xml.Linq.XDocument.Parse(String text)
      at MediaPortal.LastFM.LastFMLibrary.GetXml(String querystring, String httpMethod, Boolean useHttps)
      --- End of inner exception stack trace ---
      at MediaPortal.LastFM.LastFMLibrary.GetXml(String querystring, String httpMethod, Boolean useHttps)
      at MediaPortal.LastFM.LastFMLibrary.GetSimilarTracks(String strTrack, String strArtist)
      at MediaPortal.ProcessPlugins.LastFMScrobbler.LastFMScrobbler.AutoDJ(String strArtist, String strTrack)  Message: Error in HTTP response  Site  : System.Xml.Linq.XDocument GetXml(System.String, System.String, Boolean)  Source : LastFMLibrary  Inner Exception(s):  -> Error in HTTP response  -> Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 2, position 3.  Stack Trace:	 at MediaPortal.LastFM.LastFMLibrary.GetXml(String querystring, String httpMethod, Boolean useHttps)
      at MediaPortal.LastFM.LastFMLibrary.GetSimilarTracks(String strTrack, String strArtist)
      at MediaPortal.ProcessPlugins.LastFMScrobbler.LastFMScrobbler.AutoDJ(String strArtist, String strTrack)
    which was completely unnoticeable in MP ;)
     
    Last edited:

    Users who are viewing this thread

    Top Bottom