jesseward / jellyfin-plugin-lastfm

LastFM plugin for the Jellyfin media system. Fork of the Emby Last.FM plug-in
179 stars 12 forks source link

Exception when trying to scrobble #4

Closed lxea closed 5 years ago

lxea commented 5 years ago

I get the following exception when trying to scrobble recentsly, it was working fine previously im not sure what might have changed. Its in a docker containe, Im not sure what may have changed that broke it. Restarting didnt change anything.

[2019-03-13 14:39:24.708 +00:00] [ERR] Error ProtocolError getting response from "http://ws.audioscrobbler.com/2.0/?format=json"

System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
[2019-03-13 14:39:24.710 +00:00] [ERR] Failed to Scrobble track: "MediaBrowser.Model.Net.HttpException: The remote server returned an error: (400) Bad Request. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsyncInternal(HttpRequestOptions options, String httpMethod)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsync(HttpRequestOptions options, String httpMethod)
   at Jellyfin.Plugin.Lastfm.Api.BaseLastfmApiClient.Post[TRequest,TResponse](TRequest request)
   at Jellyfin.Plugin.Lastfm.Api.LastfmApiClient.Scrobble(Audio item, LastfmUser user)"
jesseward commented 5 years ago

hey @AlexKraak , thanks for logging this. Can you provide some additional context around those logs? I suspect it is trying to submit bogus data to the audioscrobbler API. Try something like egrep "played|now playing|audios" LOG_FILE_HERE

$ egrep "played|now playing|audios" log_20190314.log
[2019-03-14 02:18:54.173 +00:00] [INF] "jw76" is now playing '"House of God"' - "R&S Records - In Order to Dance 3" - "DHS"
[2019-03-14 02:19:49.429 +00:00] [INF] HttpClientManager "POST": "http://ws.audioscrobbler.com/2.0/?format=json"
[2019-03-14 02:19:49.565 +00:00] [INF] HttpClientManager "POST": "http://ws.audioscrobbler.com/2.0/?format=json"
[2019-03-14 02:19:49.678 +00:00] [INF] "jw76" played '"House of God"' - "R&S Records - In Order to Dance 3" - "DHS"

Could you also confirm if this is happening for all, or only some of your submissions ?

A couple things that I will do

jesseward commented 5 years ago

@AlexKraak : I published a new build that captures and removes null values when submitting to Last.FM api.

Published in v1.0.1

lxea commented 5 years ago

Hey thanks very much for the new build, its working extremely well :)

jesseward commented 5 years ago

Great to hear. Thanks for checking in to confirm it is working well.