diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs index a8e8f815a0..efe8f98ec7 100644 --- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs +++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs @@ -501,7 +501,6 @@ namespace Emby.Server.Implementations.Activity _sessionManager.PlaybackStart -= _sessionManager_PlaybackStart; _sessionManager.PlaybackStopped -= _sessionManager_PlaybackStopped; - _subManager.SubtitlesDownloaded -= _subManager_SubtitlesDownloaded; _subManager.SubtitleDownloadFailure -= _subManager_SubtitleDownloadFailure; _userManager.UserCreated -= _userManager_UserCreated; diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 454e266f78..31dad48bef 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -112,7 +112,6 @@ using ServiceStack; using ServiceStack.Text.Jsv; using StringExtensions = MediaBrowser.Controller.Extensions.StringExtensions; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; -using UtfUnknown; namespace Emby.Server.Implementations { @@ -881,7 +880,7 @@ namespace Emby.Server.Implementations MediaSourceManager = new MediaSourceManager(ItemRepository, ApplicationPaths, LocalizationManager, UserManager, LibraryManager, LoggerFactory, JsonSerializer, FileSystemManager, UserDataManager, TimerFactory, () => MediaEncoder); RegisterSingleInstance(MediaSourceManager); - SubtitleManager = new SubtitleManager(LoggerFactory, FileSystemManager, LibraryMonitor, MediaSourceManager, ServerConfigurationManager, LocalizationManager); + SubtitleManager = new SubtitleManager(LoggerFactory, FileSystemManager, LibraryMonitor, MediaSourceManager, LocalizationManager); RegisterSingleInstance(SubtitleManager); ProviderManager = new ProviderManager(HttpClient, SubtitleManager, ServerConfigurationManager, LibraryMonitor, LoggerFactory, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer); diff --git a/MediaBrowser.Api/PluginService.cs b/MediaBrowser.Api/PluginService.cs index 94be454744..af61887b20 100644 --- a/MediaBrowser.Api/PluginService.cs +++ b/MediaBrowser.Api/PluginService.cs @@ -153,7 +153,11 @@ namespace MediaBrowser.Api private readonly INetworkManager _network; private readonly IDeviceManager _deviceManager; - public PluginService(IJsonSerializer jsonSerializer, IApplicationHost appHost, IInstallationManager installationManager, INetworkManager network, IDeviceManager deviceManager) + public PluginService(IJsonSerializer jsonSerializer, + IApplicationHost appHost, + IInstallationManager installationManager, + INetworkManager network, + IDeviceManager deviceManager) : base() { if (jsonSerializer == null) @@ -173,7 +177,7 @@ namespace MediaBrowser.Api /// /// The request. /// System.Object. - public async Task Get(GetRegistrationStatus request) + public object Get(GetRegistrationStatus request) { var record = new MBRegistrationRecord { @@ -187,26 +191,12 @@ namespace MediaBrowser.Api return ToOptimizedResult(record); } - //TODO this function is only kept for compatibility and should be removed once paid plugins break - public async Task Get(GetRegistration request) - { - var info = new RegistrationInfo - { - ExpirationDate = DateTime.Now.AddYears(100), - IsRegistered = true, - IsTrial = false, - Name = request.Name - }; - - return ToOptimizedResult(info); - } - /// /// Gets the specified request. /// /// The request. /// System.Object. - public async Task Get(GetPlugins request) + public object Get(GetPlugins request) { var result = _appHost.Plugins.OrderBy(p => p.Name).Select(p => p.GetPluginInfo()).ToArray(); return ToOptimizedResult(result); @@ -230,7 +220,7 @@ namespace MediaBrowser.Api /// /// The request. /// System.Object. - public async Task Get(GetPluginSecurityInfo request) + public object Get(GetPluginSecurityInfo request) { var result = new PluginSecurityInfo { diff --git a/MediaBrowser.Api/UserLibrary/PlaystateService.cs b/MediaBrowser.Api/UserLibrary/PlaystateService.cs index 76f91e3738..72a9430921 100644 --- a/MediaBrowser.Api/UserLibrary/PlaystateService.cs +++ b/MediaBrowser.Api/UserLibrary/PlaystateService.cs @@ -267,13 +267,13 @@ namespace MediaBrowser.Api.UserLibrary var session = GetSession(_sessionContext); - var dto = await UpdatePlayedStatus(user, request.Id, true, datePlayed).ConfigureAwait(false); + var dto = UpdatePlayedStatus(user, request.Id, true, datePlayed); foreach (var additionalUserInfo in session.AdditionalUsers) { var additionalUser = _userManager.GetUserById(additionalUserInfo.UserId); - await UpdatePlayedStatus(additionalUser, request.Id, true, datePlayed).ConfigureAwait(false); + UpdatePlayedStatus(additionalUser, request.Id, true, datePlayed); } return dto; @@ -412,13 +412,13 @@ namespace MediaBrowser.Api.UserLibrary var session = GetSession(_sessionContext); - var dto = await UpdatePlayedStatus(user, request.Id, false, null).ConfigureAwait(false); + var dto = UpdatePlayedStatus(user, request.Id, false, null); foreach (var additionalUserInfo in session.AdditionalUsers) { var additionalUser = _userManager.GetUserById(additionalUserInfo.UserId); - await UpdatePlayedStatus(additionalUser, request.Id, false, null).ConfigureAwait(false); + UpdatePlayedStatus(additionalUser, request.Id, false, null); } return dto; @@ -432,7 +432,7 @@ namespace MediaBrowser.Api.UserLibrary /// if set to true [was played]. /// The date played. /// Task. - private async Task UpdatePlayedStatus(User user, string itemId, bool wasPlayed, DateTime? datePlayed) + private UserItemDataDto UpdatePlayedStatus(User user, string itemId, bool wasPlayed, DateTime? datePlayed) { var item = _libraryManager.GetItemById(itemId); diff --git a/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs b/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs index 2ee58bbe6a..0872335c55 100644 --- a/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs +++ b/MediaBrowser.Controller/Subtitles/ISubtitleManager.cs @@ -15,11 +15,6 @@ namespace MediaBrowser.Controller.Subtitles /// event EventHandler SubtitleDownloadFailure; - /// - /// Occurs when [subtitles downloaded]. - /// - event EventHandler SubtitlesDownloaded; - /// /// Adds the parts. /// diff --git a/MediaBrowser.Providers/Subtitles/SubtitleManager.cs b/MediaBrowser.Providers/Subtitles/SubtitleManager.cs index 138794b7cf..e247c4f860 100644 --- a/MediaBrowser.Providers/Subtitles/SubtitleManager.cs +++ b/MediaBrowser.Providers/Subtitles/SubtitleManager.cs @@ -30,9 +30,7 @@ namespace MediaBrowser.Providers.Subtitles private readonly IFileSystem _fileSystem; private readonly ILibraryMonitor _monitor; private readonly IMediaSourceManager _mediaSourceManager; - private readonly IServerConfigurationManager _config; - public event EventHandler SubtitlesDownloaded; public event EventHandler SubtitleDownloadFailure; private ILocalizationManager _localization; @@ -42,14 +40,12 @@ namespace MediaBrowser.Providers.Subtitles IFileSystem fileSystem, ILibraryMonitor monitor, IMediaSourceManager mediaSourceManager, - IServerConfigurationManager config, ILocalizationManager localizationManager) { _logger = loggerFactory.CreateLogger(nameof(SubtitleManager)); _fileSystem = fileSystem; _monitor = monitor; _mediaSourceManager = mediaSourceManager; - _config = config; _localization = localizationManager; } @@ -134,11 +130,6 @@ namespace MediaBrowser.Providers.Subtitles return results.SelectMany(i => i).ToArray(); } - private SubtitleOptions GetOptions() - { - return _config.GetConfiguration("subtitles"); - } - public Task DownloadSubtitles(Video video, string subtitleId, CancellationToken cancellationToken) { var libraryOptions = BaseItem.LibraryManager.GetLibraryOptions(video);