jellyfin-plugin-lastfm icon indicating copy to clipboard operation
jellyfin-plugin-lastfm copied to clipboard

10.8.0 support

Open tandy-1000 opened this issue 2 years ago • 18 comments

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.

tandy-1000 avatar Jan 10 '22 12:01 tandy-1000

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)

lwsx avatar Jan 29 '22 10:01 lwsx

Is there any estimate date for 10.8 support ?

ilkersigirci avatar Feb 23 '22 07:02 ilkersigirci

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

0x09AF avatar Jun 11 '22 17:06 0x09AF

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..

lmaonator avatar Jun 12 '22 07:06 lmaonator

@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

0x09AF avatar Jun 12 '22 12:06 0x09AF

@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

vartiovaara avatar Jun 13 '22 14:06 vartiovaara

@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

lmaonator avatar Jun 14 '22 08:06 lmaonator

Will this work direct from the repo soon ?

waynepaulward avatar Jun 14 '22 09:06 waynepaulward

@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!

Gotrees avatar Jun 14 '22 20:06 Gotrees

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 !…

waynepaulward avatar Jun 19 '22 23:06 waynepaulward

@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.

captainnapalm avatar Jun 20 '22 19:06 captainnapalm

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.

vartiovaara avatar Jun 20 '22 19:06 vartiovaara

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.

captainnapalm avatar Jun 20 '22 22:06 captainnapalm

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

I-G-1-1 avatar Jun 23 '22 10:06 I-G-1-1

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.

captainnapalm avatar Jun 23 '22 16:06 captainnapalm

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

fucksophie avatar Aug 01 '22 11:08 fucksophie

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.

Zeklyn avatar Oct 15 '22 12:10 Zeklyn

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

tandy-1000 avatar Oct 15 '22 17:10 tandy-1000