mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 09:59:06 -07:00
Use depencency injection for ISubtitleProvider
This commit is contained in:
parent
8898012121
commit
4f81f4daaa
@ -728,8 +728,6 @@ namespace Emby.Server.Implementations
|
||||
|
||||
Resolve<ILiveTvManager>().AddParts(GetExports<ILiveTvService>(), GetExports<ITunerHost>(), GetExports<IListingsProvider>());
|
||||
|
||||
Resolve<ISubtitleManager>().AddParts(GetExports<ISubtitleProvider>());
|
||||
|
||||
Resolve<IChannelManager>().AddParts(GetExports<IChannel>());
|
||||
|
||||
Resolve<IMediaSourceManager>().AddParts(GetExports<IMediaSourceProvider>());
|
||||
|
@ -19,12 +19,6 @@ namespace MediaBrowser.Controller.Subtitles
|
||||
/// </summary>
|
||||
event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
/// </summary>
|
||||
/// <param name="subtitleProviders">The subtitle providers.</param>
|
||||
void AddParts(IEnumerable<ISubtitleProvider> subtitleProviders);
|
||||
|
||||
/// <summary>
|
||||
/// Searches the subtitles.
|
||||
/// </summary>
|
||||
|
@ -35,33 +35,29 @@ namespace MediaBrowser.Providers.Subtitles
|
||||
private readonly IMediaSourceManager _mediaSourceManager;
|
||||
private readonly ILocalizationManager _localization;
|
||||
|
||||
private ISubtitleProvider[] _subtitleProviders;
|
||||
private readonly ISubtitleProvider[] _subtitleProviders;
|
||||
|
||||
public SubtitleManager(
|
||||
ILogger<SubtitleManager> logger,
|
||||
IFileSystem fileSystem,
|
||||
ILibraryMonitor monitor,
|
||||
IMediaSourceManager mediaSourceManager,
|
||||
ILocalizationManager localizationManager)
|
||||
ILocalizationManager localizationManager,
|
||||
IEnumerable<ISubtitleProvider> subtitleProviders)
|
||||
{
|
||||
_logger = logger;
|
||||
_fileSystem = fileSystem;
|
||||
_monitor = monitor;
|
||||
_mediaSourceManager = mediaSourceManager;
|
||||
_localization = localizationManager;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void AddParts(IEnumerable<ISubtitleProvider> subtitleProviders)
|
||||
{
|
||||
_subtitleProviders = subtitleProviders
|
||||
.OrderBy(i => i is IHasOrder hasOrder ? hasOrder.Order : 0)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<RemoteSubtitleInfo[]> SearchSubtitles(SubtitleSearchRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user