Add PluginServiceRegistrator for DI and translate logs to English
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
using MediaBrowser.Controller.Plugins;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using JellyfinPlugin.Tasks;
|
||||||
|
|
||||||
|
namespace JellyfinPlugin
|
||||||
|
{
|
||||||
|
public class PluginServiceRegistrator : IPluginServiceRegistrator
|
||||||
|
{
|
||||||
|
public void RegisterServices(IServiceCollection serviceCollection, MediaBrowser.Controller.IServerApplicationHost applicationHost)
|
||||||
|
{
|
||||||
|
// Rejestracja serwisów tła
|
||||||
|
serviceCollection.AddHostedService<HtmlPatcher>();
|
||||||
|
serviceCollection.AddHostedService<WrapperGenerator>();
|
||||||
|
serviceCollection.AddHostedService<LibraryMonitor>();
|
||||||
|
|
||||||
|
// W Jellyfin 10.9+ zadania harmonogramu czasami trzeba jawnie rejestrować jeśli refleksja ich nie wychwyci
|
||||||
|
serviceCollection.AddScoped<MediaBrowser.Model.Tasks.IScheduledTask, LibraryRetroactiveScanTask>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,7 +33,7 @@ namespace JellyfinPlugin.Tasks
|
|||||||
var config = Plugin.Instance!.Configuration;
|
var config = Plugin.Instance!.Configuration;
|
||||||
if (!config.IsEnabled)
|
if (!config.IsEnabled)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Wtyczka wyłączona. Pomijanie.");
|
_logger.LogInformation("Plugin is disabled. Skipping.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,11 +73,11 @@ namespace JellyfinPlugin.Tasks
|
|||||||
await _libraryManager.UpdateItemAsync(item, item, ItemUpdateType.MetadataEdit, cancellationToken);
|
await _libraryManager.UpdateItemAsync(item, item, ItemUpdateType.MetadataEdit, cancellationToken);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(cropData))
|
if (!string.IsNullOrEmpty(cropData))
|
||||||
_logger.LogInformation("Znaleziono pasy {Crop} w {Path}", cropData, path);
|
_logger.LogInformation("Found black bars {Crop} in {Path}", cropData, path);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Błąd skanowania pliku {Path}", path);
|
_logger.LogError(ex, "Error scanning file {Path}", path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user