lyarenei / jellyfin-plugin-listenbrainz

ListenBrainz plugin for Jellyfin.
MIT License
65 stars 2 forks source link

[Request]: Support for Jellyfin 10.9.0 #92

Closed rigrig closed 1 month ago

rigrig commented 3 months ago

Description

According to https://jellyfin.org/posts/testing-10.9.0/ : Jellyfin 10.9.0 is scheduled for release during the weekend of April 26th-28th

It would be neat if this plugin worked right away after upgrading.

Additional context

I'm running 10.9.0 from the unstable docker image and would be happy to test stuff.

Right now 3.4.1.0 gives this error in the Jellyfin 10.9.0 log:

[16:39:57] [ERR] Failed to load assembly /config/plugins/ListenBrainz_3.4.1.0/Jellyfin.Plugin.ListenBrainz.dll. This error occurs when a plugin references an incompatible version of one of the shared libraries. Disabling plugin
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load type 'MediaBrowser.Controller.Plugins.IServerEntryPoint' from assembly 'MediaBrowser.Controller, Version=10.9.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at Emby.Server.Implementations.Plugins.PluginManager.LoadAssemblies()+MoveNext()
System.TypeLoadException: Could not load type 'MediaBrowser.Controller.Plugins.IServerEntryPoint' from assembly 'MediaBrowser.Controller, Version=10.9.0.0, Culture=neutral, PublicKeyToken=null'.
lyarenei commented 3 months ago

Hi, thanks for the heads up. I'll have this updated over the weekend. But last time I had a look, there was a bug which effectively breaks almost all plugin functionality (https://github.com/jellyfin/jellyfin/issues/11020).

So in general, I'd advise against upgrading to 10.9. - at least until the bug is fixed or a workaround for that bug is implemented in the plugin (which I am not a fan of).

rigrig commented 3 months ago

Oh, nasty. Thanks for pointing it out. Do you know whether that means it'll scrobble the wrong tracks, or just not any at all? (I don't mind missing some, but random tracks popping up in my history would be annoying, so I'd have to be a bit more careful about testing, to avoid manually deleting hundreds of scrobbles 😉)

Putting a workaround in the plugin doesn't seem like a great idea, but I'm happy to test if the plugin loads/tries to scrobble.

lyarenei commented 3 months ago

Do you know whether that means it'll scrobble the wrong tracks, or just not any at all?

No, this won't happen - that's why I wrote almost all. :)

The scrobbles will still be correct, but the plugin will effectively work in a "bare minimum" mode. All the additional useful features in this plugin rely on the recording MBID, which is obtained through the track MBID field. And that will be set incorrectly after you do a metadata refresh in JF 10.9.

Technically, you can use JF 10.9 with this plugin (when it's compatible), but then you would have to make sure to never do a metadata refresh or add anything new to the libraries. But this is not feasible for most users, so it's better to just not recommend it for now.

On the other hand, the track MBID field will hold the recording MBID value, which is what the plugin needs in most cases. So from a certain perspective, this is also a blessing for some plugin features as there would be no need for lookups. But the ultimate issue with a workaround is how to detect if the value is a track MBID or a recording MBID. And the only way I know is to check with MusicBrainz, which only leads to a lot more requests than necessary and slowing down the plugin even more.

lyarenei commented 3 months ago

@rigrig Just started working on this, unfortunately the Jellyfin team have not released the packages for 10.9.x yet, not even in preview - see https://www.nuget.org/packages?q=jellyfin&prerel=true&sortby=relevance.

I believe this will not take long, but as of right now, there's nothing I can do. :)

rigrig commented 3 months ago

I was worried mixing up recording/track IDs meant it would scrobble essentially random IDs, but I see now it's all UUIDs, so I guess there's no chance of that happening. (Too bad they didn't include a type in those)

My plan is to just keep running unstable 10.9 for now, and restore my 10.8 backup and remigrate once (hopefully) all the bugs are fixed.

I have no idea how dotnet development works, but thanks for the update! 😉

lyarenei commented 2 months ago

Okay, the good news is that the fix for track MBID has been merged, so the plugin should work with 10.9.x without any (known) issues.

Now the last blocker is the availability of updated packages so the plugin could be actually compiled to support JF 10.9.

rasmuslos commented 2 months ago

I may be wrong, but I think the 10.9 packages are only available through the GitHub package registry: https://github.com/orgs/jellyfin/packages

lyarenei commented 2 months ago

@rasmuslos Well, actually no. On github it looks like the packages are publicly available, but you have to be a member of the organization in order to be able to download the packages.

But that gave me an idea - get the packages from the artifacts in azure builds: https://dev.azure.com/jellyfin-project/jellyfin/_artifacts/feed/unstable


So, the first build is available: https://github.com/lyarenei/jellyfin-plugin-listenbrainz/pull/93#issuecomment-2067243185

Please note I only made the necessary changes in the code to get the plugin to compile, so I have actually no idea if this (first) build even works or not - it would be actually really surprising if it works right away, so do not expect much.

I'll look into it tomorrow.

Edit: Does not work. Plugin loads but does not react on events.

lyarenei commented 2 months ago

Updated https://github.com/lyarenei/jellyfin-plugin-listenbrainz/pull/93#issuecomment-2067243185 with a new build (4.0.0.1), now the plugin should at least react on the server events. At this point, I have not observed any other issues with the plugin.


Please note that for local builds, the plugin will report as version 1.0.0.0, so it is necessary to name the plugin folder accordingly - as described in manual installation steps.

rigrig commented 2 months ago

Thanks! 4.0.0.1 works for me (with https://github.com/lyarenei/jellyfin-plugin-listenbrainz/pull/94): both "now playing" and the listen being submitted after the song finished.

lyarenei commented 1 month ago

Plugin version 4.0.0.2 is now available in the repository.


If you are still running Jellyfin 10.8 - and plan to for some time (like me), you can switch to a specific 10.8 repo (https://repo.xkrivo.net/jellyfin-10-8/manifest.json) to avoid plugin breakage on server restarts, caused by the server automatically installing the latest version in repository, even if not compatible.