nicknsy / jellyscrub

Smooth mouse-over video scrubbing previews for Jellyfin.
MIT License
660 stars 25 forks source link

Recent JellyFin Version Breaks Scrub #107

Closed Silvenga closed 1 month ago

Silvenga commented 1 year ago

It appears this commit 209edd38a4163a8cf4abd5e47bfe0ea1a100f351 breaks authentication that JellyScrub uses by removing the default authentication policy:

https://github.com/nicknsy/jellyscrub/blob/4a941a46af793760f897bd2c8c6bb7cb0c3909bf/Nick.Plugin.Jellyscrub/Api/TrickplayController.cs#L100-L104

[08:00:50] [ERR] [32] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL GET /Trickplay/<id>/GetManifest.
System.InvalidOperationException: The AuthorizationPolicy named: 'DefaultAuthorization' was not found.
   at Microsoft.AspNetCore.Authorization.AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider policyProvider, IEnumerable`1 authorizeData, IEnumerable`1 policies)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext) in /repo/Jellyfin.Api/Middleware/QueryStringDecodingMiddleware.cs:line 37
   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.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) in /repo/Jellyfin.Api/Middleware/RobotsRedirectionMiddleware.cs:line 45
   at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) in /repo/Jellyfin.Api/Middleware/LegacyEmbyRouteRewriteMiddleware.cs:line 52
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) in /repo/Jellyfin.Api/Middleware/ResponseTimeMiddleware.cs:line 67
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context) in /repo/Jellyfin.Api/Middleware/ExceptionMiddleware.cs:line 101

Unfortunately, I don't see a relevant replacement.

This brings up the question, do these endpoints need authentication? Looking at the existing Jelly endpoints e.g. /Items/<id>/Images/Primary, the static content endpoints don't require authentication.

I would propose removing authentication from these endpoints (which will allow clients to better cache the responses).

Silvenga commented 1 year ago

I should note this is a pre-release version.

teobaranga commented 1 year ago

Could the fix here be just removing the explicit Policy argument like done here? https://github.com/jellyfin/jellyfin/commit/209edd38a4163a8cf4abd5e47bfe0ea1a100f351#diff-ee9914583a403442a14a5459d3e71969377f7aabbbef8c257883925e9ecdf5c7

Silvenga commented 1 year ago

Maybe? I don't know what the default policy implies.

That said, I still wonder if it would be better remove authentication, since Jelly doesn't require auth for static content e.g. chapter images.

ryleu commented 1 year ago

i believe this is the issue causing jellyscrub to not work at all on the latest version of jellyfin. it still works in JMP, with the toggle enabled

Silvenga commented 1 year ago

@ryleu what version are you on? I think the 10.8.X branch should still work - I was running off of master (which is looking to be the next major version), which has quite a few updates.

I do know there's an unrelated "bug" with jellyscrub, where if you play media directly from the library (instead of viewing the media details first), jellyscrub doesn't load.

memehammad commented 1 year ago

Same issue here, running Jellyfin 10.9/Nightly. Its also broken in JMP despite having the option to use it enabled.

ryleu commented 11 months ago

@ryleu what version are you on? I think the 10.8.X branch should still work - I was running off of master (which is looking to be the next major version), which has quite a few updates.

I do know there's an unrelated "bug" with jellyscrub, where if you play media directly from the library (instead of viewing the media details first), jellyscrub doesn't load.

hmm yea i'm on 10.8.10. you're right about the unrelated bug. apologies for the clutter