Warnings for docs
This commit is contained in:
parent
34af7501fa
commit
be77e14db9
|
@ -5,11 +5,14 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<!-- We need C# 7.1 for async main-->
|
<!-- We need C# 7.1 for async main-->
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
<!-- Disable ducumentation warnings (for now) -->
|
||||||
|
<NoWarn>SA1600</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -57,6 +57,21 @@ namespace Jellyfin.Server
|
||||||
errs => Task.FromResult(0)).ConfigureAwait(false);
|
errs => Task.FromResult(0)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Shutdown()
|
||||||
|
{
|
||||||
|
if (!_tokenSource.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
_tokenSource.Cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Restart()
|
||||||
|
{
|
||||||
|
_restartOnShutdown = true;
|
||||||
|
|
||||||
|
Shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
private static async Task StartApp(StartupOptions options)
|
private static async Task StartApp(StartupOptions options)
|
||||||
{
|
{
|
||||||
ServerApplicationPaths appPaths = CreateApplicationPaths(options);
|
ServerApplicationPaths appPaths = CreateApplicationPaths(options);
|
||||||
|
@ -76,6 +91,7 @@ namespace Jellyfin.Server
|
||||||
{
|
{
|
||||||
return; // Already shutting down
|
return; // Already shutting down
|
||||||
}
|
}
|
||||||
|
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
_logger.LogInformation("Ctrl+C, shutting down");
|
_logger.LogInformation("Ctrl+C, shutting down");
|
||||||
Environment.ExitCode = 128 + 2;
|
Environment.ExitCode = 128 + 2;
|
||||||
|
@ -89,6 +105,7 @@ namespace Jellyfin.Server
|
||||||
{
|
{
|
||||||
return; // Already shutting down
|
return; // Already shutting down
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Received a SIGTERM signal, shutting down");
|
_logger.LogInformation("Received a SIGTERM signal, shutting down");
|
||||||
Environment.ExitCode = 128 + 15;
|
Environment.ExitCode = 128 + 15;
|
||||||
Shutdown();
|
Shutdown();
|
||||||
|
@ -102,7 +119,7 @@ namespace Jellyfin.Server
|
||||||
SQLitePCL.Batteries_V2.Init();
|
SQLitePCL.Batteries_V2.Init();
|
||||||
|
|
||||||
// Allow all https requests
|
// Allow all https requests
|
||||||
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
|
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; } );
|
||||||
|
|
||||||
var fileSystem = new ManagedFileSystem(_loggerFactory, environmentInfo, null, appPaths.TempDirectory, true);
|
var fileSystem = new ManagedFileSystem(_loggerFactory, environmentInfo, null, appPaths.TempDirectory, true);
|
||||||
|
|
||||||
|
@ -146,7 +163,7 @@ namespace Jellyfin.Server
|
||||||
/// for everything else the XDG approach is followed:
|
/// for everything else the XDG approach is followed:
|
||||||
/// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
/// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="options"></param>
|
/// <param name="options">StartupOptions</param>
|
||||||
/// <returns>ServerApplicationPaths</returns>
|
/// <returns>ServerApplicationPaths</returns>
|
||||||
private static ServerApplicationPaths CreateApplicationPaths(StartupOptions options)
|
private static ServerApplicationPaths CreateApplicationPaths(StartupOptions options)
|
||||||
{
|
{
|
||||||
|
@ -308,6 +325,7 @@ namespace Jellyfin.Server
|
||||||
await rscstr.CopyToAsync(fstr).ConfigureAwait(false);
|
await rscstr.CopyToAsync(fstr).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var configuration = new ConfigurationBuilder()
|
var configuration = new ConfigurationBuilder()
|
||||||
.SetBasePath(appPaths.ConfigurationDirectoryPath)
|
.SetBasePath(appPaths.ConfigurationDirectoryPath)
|
||||||
.AddJsonFile("logging.json")
|
.AddJsonFile("logging.json")
|
||||||
|
@ -335,7 +353,7 @@ namespace Jellyfin.Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IImageEncoder GetImageEncoder(
|
private static IImageEncoder GetImageEncoder(
|
||||||
IFileSystem fileSystem,
|
IFileSystem fileSystem,
|
||||||
IApplicationPaths appPaths,
|
IApplicationPaths appPaths,
|
||||||
ILocalizationManager localizationManager)
|
ILocalizationManager localizationManager)
|
||||||
|
@ -376,26 +394,12 @@ namespace Jellyfin.Server
|
||||||
{
|
{
|
||||||
return MediaBrowser.Model.System.OperatingSystem.BSD;
|
return MediaBrowser.Model.System.OperatingSystem.BSD;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception($"Can't resolve OS with description: '{osDescription}'");
|
throw new Exception($"Can't resolve OS with description: '{osDescription}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Shutdown()
|
|
||||||
{
|
|
||||||
if (!_tokenSource.IsCancellationRequested)
|
|
||||||
{
|
|
||||||
_tokenSource.Cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Restart()
|
|
||||||
{
|
|
||||||
_restartOnShutdown = true;
|
|
||||||
|
|
||||||
Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void StartNewInstance(StartupOptions options)
|
private static void StartNewInstance(StartupOptions options)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Starting new instance");
|
_logger.LogInformation("Starting new instance");
|
||||||
|
|
|
@ -82,9 +82,7 @@ namespace Jellyfin.Server.SocketSharp
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// We use a substream, as in 2.x we will support large uploads streamed to disk,
|
// We use a substream, as in 2.x we will support large uploads streamed to disk,
|
||||||
//
|
|
||||||
var sub = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length);
|
var sub = new HttpPostedFile(e.Filename, e.ContentType, input, e.Start, e.Length);
|
||||||
files[e.Name] = sub;
|
files[e.Name] = sub;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ namespace Jellyfin.Server.SocketSharp
|
||||||
void socket_OnError(object sender, SocketHttpListener.ErrorEventArgs e)
|
void socket_OnError(object sender, SocketHttpListener.ErrorEventArgs e)
|
||||||
{
|
{
|
||||||
_logger.LogError("Error in SharpWebSocket: {Message}", e.Message ?? string.Empty);
|
_logger.LogError("Error in SharpWebSocket: {Message}", e.Message ?? string.Empty);
|
||||||
|
|
||||||
// Closed?.Invoke(this, EventArgs.Empty);
|
// Closed?.Invoke(this, EventArgs.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user