Merge pull request #716 from Bond-009/warnings
Remove more compile time warnings
This commit is contained in:
commit
c8cb908004
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
|||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public async Task<object> 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<object> Get(GetRegistration request)
|
||||
{
|
||||
var info = new RegistrationInfo
|
||||
{
|
||||
ExpirationDate = DateTime.Now.AddYears(100),
|
||||
IsRegistered = true,
|
||||
IsTrial = false,
|
||||
Name = request.Name
|
||||
};
|
||||
|
||||
return ToOptimizedResult(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified request.
|
||||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public async Task<object> 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
|
|||
/// </summary>
|
||||
/// <param name="request">The request.</param>
|
||||
/// <returns>System.Object.</returns>
|
||||
public async Task<object> Get(GetPluginSecurityInfo request)
|
||||
public object Get(GetPluginSecurityInfo request)
|
||||
{
|
||||
var result = new PluginSecurityInfo
|
||||
{
|
||||
|
|
|
@ -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
|
|||
/// <param name="wasPlayed">if set to <c>true</c> [was played].</param>
|
||||
/// <param name="datePlayed">The date played.</param>
|
||||
/// <returns>Task.</returns>
|
||||
private async Task<UserItemDataDto> 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);
|
||||
|
||||
|
|
|
@ -15,11 +15,6 @@ namespace MediaBrowser.Controller.Subtitles
|
|||
/// </summary>
|
||||
event EventHandler<SubtitleDownloadFailureEventArgs> SubtitleDownloadFailure;
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when [subtitles downloaded].
|
||||
/// </summary>
|
||||
event EventHandler<SubtitleDownloadEventArgs> SubtitlesDownloaded;
|
||||
|
||||
/// <summary>
|
||||
/// Adds the parts.
|
||||
/// </summary>
|
||||
|
|
|
@ -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<SubtitleDownloadEventArgs> SubtitlesDownloaded;
|
||||
public event EventHandler<SubtitleDownloadFailureEventArgs> 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<SubtitleOptions>("subtitles");
|
||||
}
|
||||
|
||||
public Task DownloadSubtitles(Video video, string subtitleId, CancellationToken cancellationToken)
|
||||
{
|
||||
var libraryOptions = BaseItem.LibraryManager.GetLibraryOptions(video);
|
||||
|
|
Loading…
Reference in New Issue
Block a user