diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index dad81c195c..ed5fddb52f 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -601,20 +601,26 @@ namespace Emby.Server.Implementations.IO
///
public void Dispose()
{
- _disposed = true;
Dispose(true);
}
///
/// Releases unmanaged and - optionally - managed resources.
///
- /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
- protected virtual void Dispose(bool dispose)
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ protected virtual void Dispose(bool disposing)
{
- if (dispose)
+ if (_disposed)
+ {
+ return;
+ }
+
+ if (disposing)
{
Stop();
}
+
+ _disposed = true;
}
}
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 4e68bb545e..bce9c240d5 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -35,7 +35,6 @@ using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Reflection;
using MediaBrowser.Model.Serialization;
-using MediaBrowser.Model.System;
using MediaBrowser.Model.Threading;
using Microsoft.Extensions.Logging;
@@ -275,7 +274,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
foreach (var timer in seriesTimers)
{
- await UpdateTimersForSeriesTimer(timer, false, true).ConfigureAwait(false);
+ UpdateTimersForSeriesTimer(timer, false, true);
}
}
@@ -763,12 +762,12 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_timerProvider.AddOrUpdate(timer, false);
}
- await UpdateTimersForSeriesTimer(info, true, false).ConfigureAwait(false);
+ UpdateTimersForSeriesTimer(info, true, false);
return info.Id;
}
- public async Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
+ public Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
{
var instance = _seriesTimerProvider.GetAll().FirstOrDefault(i => string.Equals(i.Id, info.Id, StringComparison.OrdinalIgnoreCase));
@@ -792,8 +791,10 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_seriesTimerProvider.Update(instance);
- await UpdateTimersForSeriesTimer(instance, true, true).ConfigureAwait(false);
+ UpdateTimersForSeriesTimer(instance, true, true);
}
+
+ return Task.CompletedTask;
}
public Task UpdateTimerAsync(TimerInfo updatedTimer, CancellationToken cancellationToken)
@@ -2346,10 +2347,9 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
}
- private async Task UpdateTimersForSeriesTimer(SeriesTimerInfo seriesTimer, bool updateTimerSettings, bool deleteInvalidTimers)
+ private void UpdateTimersForSeriesTimer(SeriesTimerInfo seriesTimer, bool updateTimerSettings, bool deleteInvalidTimers)
{
- var allTimers = GetTimersForSeries(seriesTimer)
- .ToList();
+ var allTimers = GetTimersForSeries(seriesTimer).ToList();
var enabledTimersForSeries = new List();
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
index 716417ccbc..4eff9252e4 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/SharedHttpStream.cs
@@ -94,7 +94,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
var now = DateTime.UtcNow;
- StartStreaming(response, taskCompletionSource, LiveStreamCancellationTokenSource.Token);
+ var _ = StartStreaming(response, taskCompletionSource, LiveStreamCancellationTokenSource.Token);
//OpenedMediaSource.Protocol = MediaProtocol.File;
//OpenedMediaSource.Path = tempFile;
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 5521556356..9a49b97c71 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -164,7 +164,7 @@ namespace Emby.Server.Implementations.Updates
/// Gets all available packages.
///
/// Task{List{PackageInfo}}.
- public async Task> GetAvailablePackages(CancellationToken cancellationToken,
+ public Task> GetAvailablePackages(CancellationToken cancellationToken,
bool withRegistration = true,
string packageType = null,
Version applicationVersion = null)
@@ -172,7 +172,7 @@ namespace Emby.Server.Implementations.Updates
// TODO cvium: when plugins get back this would need to be fixed
// var packages = await GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false);
- return new List(); //FilterPackages(packages, packageType, applicationVersion);
+ return Task.FromResult(new List()); //FilterPackages(packages, packageType, applicationVersion);
}
///
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 2f18283360..88b10cdbe4 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -62,7 +62,7 @@ namespace Jellyfin.Server
// $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
- await createLogger(appPaths);
+ await CreateLogger(appPaths);
_logger = _loggerFactory.CreateLogger("Main");
AppDomain.CurrentDomain.UnhandledException += (sender, e)
@@ -95,7 +95,7 @@ namespace Jellyfin.Server
_logger.LogInformation("Jellyfin version: {Version}", Assembly.GetEntryAssembly().GetName().Version);
- EnvironmentInfo environmentInfo = new EnvironmentInfo(getOperatingSystem());
+ EnvironmentInfo environmentInfo = new EnvironmentInfo(GetOperatingSystem());
ApplicationHost.LogEnvironmentInfo(_logger, appPaths, environmentInfo);
SQLitePCL.Batteries_V2.Init();
@@ -226,7 +226,7 @@ namespace Jellyfin.Server
return new ServerApplicationPaths(programDataPath, appPath, appPath, logDir, configDir);
}
- private static async Task createLogger(IApplicationPaths appPaths)
+ private static async Task CreateLogger(IApplicationPaths appPaths)
{
try
{
@@ -286,7 +286,7 @@ namespace Jellyfin.Server
return new NullImageEncoder();
}
- private static MediaBrowser.Model.System.OperatingSystem getOperatingSystem()
+ private static MediaBrowser.Model.System.OperatingSystem GetOperatingSystem()
{
switch (Environment.OSVersion.Platform)
{
diff --git a/MediaBrowser.Api/PackageService.cs b/MediaBrowser.Api/PackageService.cs
index 16819ee37f..fbb876deae 100644
--- a/MediaBrowser.Api/PackageService.cs
+++ b/MediaBrowser.Api/PackageService.cs
@@ -197,7 +197,7 @@ namespace MediaBrowser.Api
throw new ResourceNotFoundException(string.Format("Package not found: {0}", request.Name));
}
- Task.Run(() => _installationManager.InstallPackage(package, true, new SimpleProgress(), CancellationToken.None));
+ await _installationManager.InstallPackage(package, true, new SimpleProgress(), CancellationToken.None);
}
///
diff --git a/MediaBrowser.Api/UserLibrary/PlaystateService.cs b/MediaBrowser.Api/UserLibrary/PlaystateService.cs
index 72a9430921..a133bc8e90 100644
--- a/MediaBrowser.Api/UserLibrary/PlaystateService.cs
+++ b/MediaBrowser.Api/UserLibrary/PlaystateService.cs
@@ -247,14 +247,14 @@ namespace MediaBrowser.Api.UserLibrary
/// Posts the specified request.
///
/// The request.
- public async Task