azam / jellyfin-plugin-localsubs

Subtitle provider plugin for local subtitle files on Jellyfin
GNU General Public License v3.0
9 stars 0 forks source link

Can't add/delete template #5

Closed inzsome closed 3 months ago

inzsome commented 4 months ago

Jellyfin Server: Version: 10.9.1 Operating System: Windows 10 Architecture: X64

Jellyfin Web Version: 10.8.10

Whenever I try to add a new template, or even delete a default one, I get this error:

image

There is no error in the console, so I'm not really sure what's wrong. I restarted the server several times and even reinstalled the plugin. Maybe this plugin is out of date, due to the recent changes of the latest Jellyfin version?

Edit, here is a excerpt of the log file:

Delete request:

[2024-05-15 23:35:32.801 +02:00] [ERR] [32] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "POST" "/Jellyfin.Plugin.LocalSubs/DeleteTemplates". System.InvalidOperationException: The AuthorizationPolicy named: 'DefaultAuthorization' was not found. at Microsoft.AspNetCore.Authorization.AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider policyProvider, IEnumerable1 authorizeData, IEnumerable1 policies) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.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.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

Add request:

[2024-05-15 23:37:01.250 +02:00] [ERR] [31] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL "POST" "/Jellyfin.Plugin.LocalSubs/AddTemplate". System.InvalidOperationException: The AuthorizationPolicy named: 'DefaultAuthorization' was not found. at Microsoft.AspNetCore.Authorization.AuthorizationPolicy.CombineAsync(IAuthorizationPolicyProvider policyProvider, IEnumerable1 authorizeData, IEnumerable1 policies) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Jellyfin.Api.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.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext) at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context) at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager) at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

azam commented 3 months ago

@inzsome Will take a look.

azam commented 3 months ago

@inzsome Could you try plugin version v0.2.0 ?

CC @sezeriper

inzsome commented 3 months ago

@azam sure, will try as soon as possible. Thanks!

inzsome commented 3 months ago

@azam Thanks for the fix. Upon installing the latest version, I was able to now add/delete templates. However, I can't seem to get the plugin to find any subtitles relative to the media.

I used the template Subtitles\%any%.srt. By the looks of it, it should match a .srt file with any name in the sub-directory "Subtitles" relative to the media.

Using the template Subs\%fn%.%l%.srt, from the readme, didn't do the trick either.

Am I doing something wrong, or is this a bug?

azam commented 3 months ago

@inzsome I retested yesterday on Jellyfin 10.9 and it correctly picked up the subtitle files with a number of languages. Could you please check for the following:

Here are my results

キャプチャ キャプチャ2 キャプチャ3 キャプチャ4 キャプチャ5

inzsome commented 3 months ago

@azam Setting the metadata download language and rescanning the library again did the trick. May I suggest to add this to the README as well?

I could create a PR for this as well.

Thanks for the quick help!

azam commented 3 months ago

@inzsome Thank you for confirming!

Regarding the steps (adding the languages, refreshing metadata)), they are common to all Jellyfin subtitle providers, so I think it would be a better fit to add the documentation to Jellyfin rather than here.

inzsome commented 3 months ago

@azam I see your point. Regardless, it's way harder to add anything to Jellyfin's docs, so you might as well provide assistance via your README. This could also prevent people from creating issues because of "missing" documentation.

No hard feelings either way, just trying to help.

Thanks for resolving my issue.

azam commented 3 months ago

@inzsome No worries!