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

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Please build via BOT and see if you still get the error.
    Just installed your branch, and unfortunately the same error :(
    Odd. I am not near a PC for a while but will try and debug. This sounds like there is actually a bug in the logging and this is triggering that bug. @Sebastiii are you able to debug this?
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Yeah, very odd! even let the BOT build the release, but that has the same error.
    With my VERY limited debug knowledge i think the problem is in CommonLog4NetLogger.cs
    CommonLog4NetLogger.PNG
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Yeah, very odd! even let the BOT build the release, but that has the same error.
    With my VERY limited debug knowledge i think the problem is in CommonLog4NetLogger.cs
    View attachment 127138
    Types for enum, exception and string and core to .NET and certainly not seeing those errors here. This is very odd and given that very little has changed a little perplexing. My only thought would be that perhaps trying to log from a background thread is causing the error (but this was previously running as a background worker thread so I can't see why that would be the case)
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Then it's probably best to wait for @Sebastiii since my debugging knowledge is horrible ;)

    I'm sure i had everything working fine before. When i first reported the error, it was only related to Radio Webstreams (i only have webstreams, saves me a tuner slot :) )
    After disabling the option 'Announce to Website' it seemed fixed, and i was still able to use Music section, but somehow it seems completely broken now.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Mike :

    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

    Code:
    	private static void AnnounceTrack(string filename)
    	{
    	  // Get song details and announce on last.fm
    	  var pl = PlayListPlayer.SingletonPlayer.GetPlaylist(PlayListPlayer.SingletonPlayer.CurrentPlaylistType);
    	  var plI = pl.First(plItem => plItem.FileName == filename);
    	  if (plI == null || plI.MusicTag == null)
    	  {
    		Log.Info("Unable to announce song: {0}  as it does not exist in the playlist");
    		return;
    	  }
     
    	  var currentSong = (MusicTag) plI.MusicTag;
     
    	  try
    	  {
    		LastFMLibrary.UpdateNowPlaying(currentSong.Artist, currentSong.Title, currentSong.Album,
    									  currentSong.Duration.ToString(CultureInfo.InvariantCulture));
    		Log.Info("Submitted last.fm now playing update for: {0} - {1}", currentSong.Artist, currentSong.Title);
    	  }
    	  catch (LastFMException ex)
    	  {
    		if (ex.Source == "")
    		{
    		  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.Message);
    		  //Log.Error(ex.InnerException);
    		}
    	  }

    It give that in error.log :

    Code:
    [2013-04-26 18:39:26,717] [Error  ] [Announce/Auto DJ] [ERROR] - Exception when updating now playing track on last.fm
    [2013-04-26 18:39:30,406] [Error  ] [Announce/Auto DJ] [ERROR] -
    	Invalid session key - Please re-authenticate
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    Nice 1 Seb! That seems to fix the crash here, and i hear music again :)
    Code:
    [2013-04-26 18:48:44,280] [Log	] [MPMain  ] [INFO ] - BASS: WASAPI Device successfully initialised
    [2013-04-26 18:48:44,280] [Log	] [MPMain  ] [DEBUG] - BASS: Successfully created BASS Mixer stream
    [2013-04-26 18:48:44,281] [Log	] [MPMain  ] [INFO ] - BASS: playback started
    [2013-04-26 18:48:44,284] [Log	] [MPMain  ] [INFO ] - g_Player.OnStarted() \\Server\flac\Birdy\Birdy - Special Edition (2011)\08. Shelter.flac media:Music
    [2013-04-26 18:48:44,479] [Log	] [Announce/Auto DJ] [INFO ] - Submitted last.fm now playing update for: Birdy - Shelter
    [2013-04-26 18:48:48,055] [Log	] [MPMain  ] [DEBUG] - g_Player: ShowFullScreenWindow
    [2013-04-26 18:48:48,056] [Log	] [MPMain  ] [INFO ] - g_Player: ShowFullScreenWindow: No Visualisation defined. Switching to Now Playing
    [2013-04-26 18:48:48,170] [Log	] [Announce/Auto DJ] [INFO ] - Auto DJ: Matched 10 local songs.  Attempting to add 5 tracks
    [2013-04-26 18:48:48,183] [Log	] [Announce/Auto DJ] [INFO ] - Auto DJ: Added to playlist: Ed Sheeran - Drunk
    [2013-04-26 18:48:48,183] [Log	] [Announce/Auto DJ] [INFO ] - Auto DJ: Added to playlist: Beyoncé - Best Thing I Never Had
    [2013-04-26 18:48:48,183] [Log	] [Announce/Auto DJ] [INFO ] - Auto DJ: Added to playlist: Birdy - Young Blood
    [2013-04-26 18:48:48,183] [Log	] [Announce/Auto DJ] [INFO ] - Auto DJ: Added to playlist: Lana Del Rey - Without You
    [2013-04-26 18:48:48,183] [Log	] [Announce/Auto DJ] [INFO ] - Auto DJ: Added to playlist: Lana Del Rey - Blue Velvet
    [2013-04-26 18:48:48,593] [Log	] [MPMain  ] [DEBUG] - Window: MediaPortal.GUI.Music.GUIMusicGenres deinit
    [2013-04-26 18:48:48,621] [Log	] [MPMain  ] [DEBUG] - TextureManager: CleanupThumbs()
    [2013-04-26 18:48:48,641] [Log	] [MPMain  ] [DEBUG] - Window: MediaPortal.GUI.Music.GUIMusicPlayingNow init
     
    Last edited:

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    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
     
    Last edited:

    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 :)
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    I will try and yes it's when 'null' is parsed that the crash occurs :)
    I'm really starting to get lost with the bugs... ;) They seem to popup without changes being done on the specific files?!?
     

    Users who are viewing this thread

    Top Bottom