jesseward / jellyfin-plugin-lastfm

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

10.8.0 support #38

Closed tandy-1000 closed 1 year ago

tandy-1000 commented 2 years ago

The plugin says it is malfunctioning on the 10.8.0 unstable releases on debian.

Log info:

[2022-01-10 12:52:59.318 +00:00] [ERR] Failed to deserialize the plugin manifest retrieved from "https://github.com/jesseward/jellyfin-plugin-lastfm"
System.Text.Json.JsonException: '<' is an invalid start of a value. Path: $ | LineNumber: 6 | BytePositionInLine: 0.
 ---> System.Text.Json.JsonReaderException: '<' is an invalid start of a value. LineNumber: 6 | BytePositionInLine: 0.
   at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
   at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
   at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
   at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
   at System.Text.Json.Utf8JsonReader.Read()
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   --- End of inner exception stack trace ---
   at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
   at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
   at System.Text.Json.JsonSerializer.ReadCore[TValue](JsonReaderState& readerState, Boolean isFinalBlock, ReadOnlySpan`1 buffer, JsonSerializerOptions options, ReadStack& state, JsonConverter converterBase)
   at System.Text.Json.JsonSerializer.ContinueDeserialize[TValue](ReadBufferState& bufferState, JsonReaderState& jsonReaderState, ReadStack& readStack, JsonConverter converter, JsonSerializerOptions options)
   at System.Text.Json.JsonSerializer.ReadAllAsync[TValue](Stream utf8Json, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
   at System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsyncCore[T](HttpContent content, Encoding sourceEncoding, JsonSerializerOptions options, CancellationToken cancellationToken)
   at System.Net.Http.Json.HttpClientJsonExtensions.GetFromJsonAsyncCore[T](Task`1 taskResponse, JsonSerializerOptions options, CancellationToken cancellationToken)
   at Emby.Server.Implementations.Updates.InstallationManager.GetPackages(String manifestName, String manifest, Boolean filterIncompatible, CancellationToken cancellationToken)

Let me know if you need any more info.

lwsx commented 2 years ago

Just came to chime in that I am having the same problem on 10.8.0-alpha5. Seemingly lets me enter the configuration and enter login details, but fails when trying to login:

[10:30:11] [ERR] [26] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL POST /Lastfm/Login.
System.TypeLoadException: Could not load type 'MediaBrowser.Model.Serialization.IJsonSerializer' from assembly 'MediaBrowser.Model, Version=10.8.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimeConstructorInfo.<get_Signature>g__LazyCreateSignature|19_0()
   at System.Reflection.RuntimeConstructorInfo.GetParameters()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(Type serviceType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(Type serviceType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(Type serviceType, CallSiteChain callSiteChain)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass6_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Jellyfin.Server.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Server.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Server.Middleware.IpBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Server.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Server.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Server.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context)
   at Jellyfin.Server.Middleware.ExceptionMiddleware.Invoke(HttpContext context)
ilkersigirci commented 2 years ago

Is there any estimate date for 10.8 support ?

0x09AF commented 2 years ago

Jellyfin 10.8 is released. Is importing the plugin is as simple as editing the target version in the .json file?

lmaonator commented 2 years ago

I've attempted to fix it up for 10.8.0.0, if you want to try it you can get it here: https://github.com/lmaonator/jellyfin-plugin-lastfm/releases/tag/v8.0.0.0a You'll have to replace the .dll in the jellyfin config/plugins/LastFM_7.0.0.0 directory and edit the meta.json I haven't really tested anything besides scrobbling, which seems to work.

I'm hesitant to open a pull request, I'm not a C# dev and I have no idea if my changes are really correct (IJsonSerializer seems to be deprecated but I'm ignorant about the differences between it and the new JsonSerializer), and I don't know how to properly resolve the conflict between MoreLinq.MoreEnumerable.DistinctBy and System.Linq.Enumerable.DistinctBy..

0x09AF commented 2 years ago

@lmaonator tried. It says in a popup "Something went wrong". [12:31:25] [INF] [24] Jellyfin.Plugin.Lastfm.Api.RestApi: Fetching LastFM mobilesession auth for Username=mylastfmusername

vartiovaara commented 2 years ago

@lmaonator I have the same as @0x09AF. A popup with "Something went wrong" when trying to save my credentials. Jun 13 17:40:50 server jellyfin[410733]: [17:40:50] [INF] Fetching LastFM mobilesession auth for Username=mylastfmusername

lmaonator commented 2 years ago

@0x09AF @vartiovaara Yeah, it shows that I'm no C# dev I guess. I did the deserialization wrong, after all. And I didn't test the authentication because my Jellyfin was still authenticated.. oops.

This should work, hopefully: https://github.com/lmaonator/jellyfin-plugin-lastfm/releases/tag/v8.0.0.0b

waynepaulward commented 2 years ago

Will this work direct from the repo soon ?

Gotrees commented 2 years ago

@0x09AF @vartiovaara Yeah, it shows that I'm no C# dev I guess. I did the deserialization wrong, after all. And I didn't test the authentication because my Jellyfin was still authenticated.. oops.

This should work, hopefully: https://github.com/lmaonator/jellyfin-plugin-lastfm/releases/tag/v8.0.0.0b

This worked! Thanks so much!

waynepaulward commented 2 years ago

So if I install the plug-in then locate the directory and replace the dll with the above attached dll and change the text in the json file with the same text in the above link then start the plug-in it will work is that correct !…

captainnapalm commented 2 years ago

@0x09AF @vartiovaara Yeah, it shows that I'm no C# dev I guess. I did the deserialization wrong, after all. And I didn't test the authentication because my Jellyfin was still authenticated.. oops.

This should work, hopefully: https://github.com/lmaonator/jellyfin-plugin-lastfm/releases/tag/v8.0.0.0b

Thanks for this. It's "working" but, at least in my use case with listening through the Symfonium android app, I have missed whole albums of scrobbles.

vartiovaara commented 2 years ago

Thanks for this. It's "working" but, at least in my use case with listening through the Symfonium android app, I have missed whole albums of scrobbles.

I think this is a separate issue in itself.

captainnapalm commented 2 years ago

I mean, in theory Jellyfin is playing the file through my account, which I have configured for last.fm scrobbling through the plugin . It shouldn't matter what the client is. Where are the logs? I'll have a check to see if anything was showing up.

I-G-1-1 commented 2 years ago

I mean, in theory Jellyfin is playing the file through my account, which I have configured for last.fm scrobbling through the plugin . It shouldn't matter what the client is. Where are the logs? I'll have a check to see if anything was showing up.

Last time I checked there was a bug when using jellyfin clients (like Gelli or Finamp on Android) that was causing the scrobble to appear as "now listening" and then disappear and not appear as "played" when the client's player start to play the next song. If I remember correctly the issue was related to jellyfin or the client not sending the "stop" intent to the last.fm or listen.brain plug-in. Using the webinterface of jellyfin instead was working without issue.

I solved using Pano Scrobbler

captainnapalm commented 2 years ago

Ah, makes sense, thanks for that. Was hoping to avoid a local scrobbler. Might just continue using plexamp for the time being for music then.

fucksophie commented 2 years ago

Error:

Aug 01 13:59:58 rpi jellyfin[26102]: [13:59:58] [ERR] Failed to load assembly /var/lib/jellyfin/plugins/LastFM_7.0.0.0/home/runner/work/jellyfin-plugin-lastfm/jellyfin-plugin-lastfm/Jellyfin.Plugin.Lastfm/bin/Debug/net5.0/Jellyfin.Plugin.Lastfm.dll. This error occurs when a plugin references an incompatible version of one of the shared libraries. Disabling plugin.
Aug 01 13:59:58 rpi jellyfin[26102]: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Aug 01 13:59:58 rpi jellyfin[26102]: Method 'ExecuteAsync' in type 'Jellyfin.Plugin.Lastfm.ScheduledTasks.ImportLastfmData' from assembly 'Jellyfin.Plugin.Lastfm, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Aug 01 13:59:58 rpi jellyfin[26102]:    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
Aug 01 13:59:58 rpi jellyfin[26102]:    at System.Reflection.Assembly.GetTypes()
Aug 01 13:59:58 rpi jellyfin[26102]:    at Emby.Server.Implementations.Plugins.PluginManager.LoadAssemblies()+MoveNext()

Reproduction steps: Install Jellyfin 10.8.1 Install the plugin and restart via systemctl

Zeklyn commented 1 year ago

Did anyone find a fix for the scrobbling issue on the FinAmp app? I am having a hard time finding any alternatives for music streaming on ios that supports Jellyfin.

As everyone else, "now listening" appears but lastfm doesnt save it as played.

tandy-1000 commented 1 year ago

Did anyone find a fix for the scrobbling issue on the FinAmp app? I am having a hard time finding any alternatives for music streaming on ios that supports Jellyfin.

As everyone else, "now listening" appears but lastfm doesnt save it as played.

That's a finamp issue https://github.com/jmshrv/finamp/issues/87

gaizaharduz commented 1 year ago

Since development on this plugin seems to have stalled, I've looked into alternatives.

The best option I found is https://github.com/FoxxMD/multi-scrobbler. It's quite a bit more work to set up, but it's also much more powerful (supports scrobbling from multiple sources and to multiple destinations).

It also works perfectly fine with Finamp, and any other client I've thrown at it.

kidwellj commented 1 year ago

I've also pivoted to multi-scrobbler, which can interact with last.fm and self-hosted options like maloja. But there are some features in this plugin around last.fm metadata I'd still like to engage with. I wonder whether it would be worth splitting features, e.g. have a last.fm metadata plugin and a scrobbler plugin?

jesseward commented 1 year ago

hey thanks @lmaonator , i have merged in the changes from your fork and pushed a new build v8.0.0.2 which should be available in the online repository now