home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Area 51 - Testing Area
Last.FM Rework and Auto DJ mode
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sebastiii" data-source="post: 988561" data-attributes="member: 60104"><p>Mike : </p><p> </p><p>I fixed it by replacing in line 286 here : Log.Error(ex.InnerException); to Log.Error(ex.Message); </p><p>Now error is logged but no crash anymore.</p><p>Don't know if it's the right way to do lol</p><p> </p><p>[code] private static void AnnounceTrack(string filename)</p><p> {</p><p> // Get song details and announce on last.fm</p><p> var pl = PlayListPlayer.SingletonPlayer.GetPlaylist(PlayListPlayer.SingletonPlayer.CurrentPlaylistType);</p><p> var plI = pl.First(plItem => plItem.FileName == filename);</p><p> if (plI == null || plI.MusicTag == null)</p><p> {</p><p> Log.Info("Unable to announce song: {0} as it does not exist in the playlist");</p><p> return;</p><p> }</p><p> </p><p> var currentSong = (MusicTag) plI.MusicTag;</p><p> </p><p> try</p><p> {</p><p> LastFMLibrary.UpdateNowPlaying(currentSong.Artist, currentSong.Title, currentSong.Album,</p><p> currentSong.Duration.ToString(CultureInfo.InvariantCulture));</p><p> Log.Info("Submitted last.fm now playing update for: {0} - {1}", currentSong.Artist, currentSong.Title);</p><p> }</p><p> catch (LastFMException ex)</p><p> {</p><p> if (ex.Source == "")</p><p> {</p><p> Log.Error("Last.fm error when announcing now playing track: {0} - {1}",currentSong.Artist, currentSong.Title);</p><p> Log.Error(ex.Message);</p><p> }</p><p> else</p><p> {</p><p> Log.Error("Exception when updating now playing track on last.fm");</p><p> Log.Error(ex.Message);</p><p> //Log.Error(ex.InnerException);</p><p> }</p><p> }[/CODE]</p><p> </p><p>It give that in error.log : </p><p> </p><p>[code][2013-04-26 18:39:26,717] [Error ] [Announce/Auto DJ] [ERROR] - Exception when updating now playing track on last.fm</p><p>[2013-04-26 18:39:30,406] [Error ] [Announce/Auto DJ] [ERROR] -</p><p> Invalid session key - Please re-authenticate[/CODE]</p></blockquote><p></p>
[QUOTE="Sebastiii, post: 988561, member: 60104"] 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); } }[/CODE] 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[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Area 51 - Testing Area
Last.FM Rework and Auto DJ mode
Contact us
RSS
Top
Bottom