From 2a58c643d24354ad8b6c45451bcedf82caa344c0 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Fri, 9 Aug 2019 23:16:24 +0200 Subject: Fix more warnings --- Jellyfin.Server/Program.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 08c0983be..952990493 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -18,7 +18,6 @@ using Jellyfin.Drawing.Skia; using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Drawing; using MediaBrowser.Model.Globalization; -using MediaBrowser.Model.IO; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -41,12 +40,12 @@ namespace Jellyfin.Server // For backwards compatibility. // Modify any input arguments now which start with single-hyphen to POSIX standard // double-hyphen to allow parsing by CommandLineParser package. - const string pattern = @"^(-[^-\s]{2})"; // Match -xx, not -x, not --xx, not xx - const string substitution = @"-$1"; // Prepend with additional single-hyphen - var regex = new Regex(pattern); + const string Pattern = @"^(-[^-\s]{2})"; // Match -xx, not -x, not --xx, not xx + const string Substitution = @"-$1"; // Prepend with additional single-hyphen + var regex = new Regex(Pattern); for (var i = 0; i < args.Length; i++) { - args[i] = regex.Replace(args[i], substitution); + args[i] = regex.Replace(args[i], Substitution); } // Parse the command line arguments and either start the app or exit indicating error @@ -134,7 +133,7 @@ namespace Jellyfin.Server Batteries_V2.Init(); if (raw.sqlite3_enable_shared_cache(1) != raw.SQLITE_OK) { - Console.WriteLine("WARN: Failed to enable shared cache for SQLite"); + _logger.LogWarning("Failed to enable shared cache for SQLite"); } using (var appHost = new CoreAppHost( -- cgit v1.2.3 From 003238ef5e5151c43738fedcc90f83fd5064580a Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 11 Aug 2019 15:11:53 +0200 Subject: Update deps + document startup project * Fixed the release build * Documented all public/internal members of Jellyfin.Server * Enable TreatWarningsAsErrors for debug builds for Jellyfin.Server This will ensure that any new public/internal members of Jellyfin.Server are documented --- Emby.Naming/Emby.Naming.csproj | 2 +- Emby.Photos/Emby.Photos.csproj | 2 +- .../Emby.Server.Implementations.csproj | 10 +++----- Jellyfin.Server/CoreAppHost.cs | 17 ++++++++++++++ Jellyfin.Server/Jellyfin.Server.csproj | 10 ++++---- Jellyfin.Server/Program.cs | 27 +++++++++++++++++----- Jellyfin.Server/StartupOptions.cs | 26 +++++++++++++++++++++ .../MediaBrowser.MediaEncoding.csproj | 2 +- 8 files changed, 74 insertions(+), 22 deletions(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Emby.Naming/Emby.Naming.csproj b/Emby.Naming/Emby.Naming.csproj index 9e2a4950f..0b1ce2fce 100644 --- a/Emby.Naming/Emby.Naming.csproj +++ b/Emby.Naming/Emby.Naming.csproj @@ -23,7 +23,7 @@ - + diff --git a/Emby.Photos/Emby.Photos.csproj b/Emby.Photos/Emby.Photos.csproj index c9830abc5..8a79bf7e1 100644 --- a/Emby.Photos/Emby.Photos.csproj +++ b/Emby.Photos/Emby.Photos.csproj @@ -10,7 +10,7 @@ - + diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 73a64b0cd..c78d96d4a 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -32,7 +32,7 @@ - + @@ -48,17 +48,13 @@ - + latest - - true - - - + diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs index b9b0cc382..8b4b61e29 100644 --- a/Jellyfin.Server/CoreAppHost.cs +++ b/Jellyfin.Server/CoreAppHost.cs @@ -9,8 +9,21 @@ using Microsoft.Extensions.Logging; namespace Jellyfin.Server { + /// + /// Implementation of the abstract class. + /// public class CoreAppHost : ApplicationHost { + /// + /// Initializes a new instance of the class. + /// + /// The to be used by the . + /// The to be used by the . + /// The to be used by the . + /// The to be used by the . + /// The to be used by the . + /// The to be used by the . + /// The to be used by the . public CoreAppHost( ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, @@ -30,15 +43,19 @@ namespace Jellyfin.Server { } + /// public override bool CanSelfRestart => StartupOptions.RestartPath != null; + /// protected override void RestartInternal() => Program.Restart(); + /// protected override IEnumerable GetAssembliesWithPartsInternal() { yield return typeof(CoreAppHost).Assembly; } + /// protected override void ShutdownInternal() => Program.Shutdown(); } } diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index 641b3f182..e87283477 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -9,10 +9,8 @@ - + latest - - SA1600;SA1601;SA1629;CS1591 true @@ -26,7 +24,7 @@ - + @@ -36,7 +34,7 @@ - + @@ -45,7 +43,7 @@ - + diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 952990493..82b903198 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -28,6 +28,9 @@ using ILogger = Microsoft.Extensions.Logging.ILogger; namespace Jellyfin.Server { + /// + /// Class containing the entry point of the application. + /// public static class Program { private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource(); @@ -35,6 +38,11 @@ namespace Jellyfin.Server private static ILogger _logger; private static bool _restartOnShutdown; + /// + /// The entry point of the application. + /// + /// The command line arguments passed. + /// . public static Task Main(string[] args) { // For backwards compatibility. @@ -53,7 +61,10 @@ namespace Jellyfin.Server .MapResult(StartApp, _ => Task.CompletedTask); } - public static void Shutdown() + /// + /// Shuts down the application. + /// + internal static void Shutdown() { if (!_tokenSource.IsCancellationRequested) { @@ -61,7 +72,10 @@ namespace Jellyfin.Server } } - public static void Restart() + /// + /// Restarts the application. + /// + internal static void Restart() { _restartOnShutdown = true; @@ -171,11 +185,12 @@ namespace Jellyfin.Server /// /// Create the data, config and log paths from the variety of inputs(command line args, /// environment variables) or decide on what default to use. For Windows it's %AppPath% - /// for everything else the XDG approach is followed: - /// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html + /// for everything else the + /// XDG approach + /// is followed. /// - /// StartupOptions - /// ServerApplicationPaths + /// The for this instance. + /// . private static ServerApplicationPaths CreateApplicationPaths(StartupOptions options) { // dataDir diff --git a/Jellyfin.Server/StartupOptions.cs b/Jellyfin.Server/StartupOptions.cs index 8296d414e..bb0adaf63 100644 --- a/Jellyfin.Server/StartupOptions.cs +++ b/Jellyfin.Server/StartupOptions.cs @@ -8,36 +8,62 @@ namespace Jellyfin.Server /// public class StartupOptions : IStartupOptions { + /// + /// Gets or sets the path to the data directory. + /// + /// The path to the data directory. [Option('d', "datadir", Required = false, HelpText = "Path to use for the data folder (database files, etc.).")] public string DataDir { get; set; } + /// + /// Gets or sets the path to the web directory. + /// + /// The path to the web directory. [Option('w', "webdir", Required = false, HelpText = "Path to the Jellyfin web UI resources.")] public string WebDir { get; set; } + /// + /// Gets or sets the path to the cache directory. + /// + /// The path to the cache directory. [Option('C', "cachedir", Required = false, HelpText = "Path to use for caching.")] public string CacheDir { get; set; } + /// + /// Gets or sets the path to the config directory. + /// + /// The path to the config directory. [Option('c', "configdir", Required = false, HelpText = "Path to use for configuration data (user settings and pictures).")] public string ConfigDir { get; set; } + /// + /// Gets or sets the path to the log directory. + /// + /// The path to the log directory. [Option('l', "logdir", Required = false, HelpText = "Path to use for writing log files.")] public string LogDir { get; set; } + /// [Option("ffmpeg", Required = false, HelpText = "Path to external FFmpeg executable to use in place of default found in PATH.")] public string FFmpegPath { get; set; } + /// [Option("service", Required = false, HelpText = "Run as headless service.")] public bool IsService { get; set; } + /// [Option("noautorunwebapp", Required = false, HelpText = "Run headless if startup wizard is complete.")] public bool NoAutoRunWebApp { get; set; } + /// [Option("package-name", Required = false, HelpText = "Used when packaging Jellyfin (example, synology).")] public string PackageName { get; set; } + /// [Option("restartpath", Required = false, HelpText = "Path to restart script.")] public string RestartPath { get; set; } + /// [Option("restartargs", Required = false, HelpText = "Arguments for restart script.")] public string RestartArgs { get; set; } } diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj index c0f92ac4a..681a2e372 100644 --- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj +++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj @@ -18,7 +18,7 @@ - + -- cgit v1.2.3 From cb492fe3c74f87e9eb4d6b35efc8be4dc3f45201 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 11 Aug 2019 15:17:39 +0200 Subject: Improve clickable link --- Jellyfin.Server/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 82b903198..5e4e36a34 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -186,7 +186,7 @@ namespace Jellyfin.Server /// Create the data, config and log paths from the variety of inputs(command line args, /// environment variables) or decide on what default to use. For Windows it's %AppPath% /// for everything else the - /// XDG approach + /// XDG approach /// is followed. /// /// The for this instance. -- cgit v1.2.3 From 99aea27723dc7acc2beb14393eae89a3d2bd860f Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 18 Aug 2019 20:01:08 +0200 Subject: Fix possible hidden exceptions If an error occurred while starting the server which in turn caused an exception in the dispose method of the apphost, the first exception wouldn't get logged. --- Jellyfin.Server/Program.cs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 5e4e36a34..594441af0 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -150,14 +150,15 @@ namespace Jellyfin.Server _logger.LogWarning("Failed to enable shared cache for SQLite"); } - using (var appHost = new CoreAppHost( + var appHost = new CoreAppHost( appPaths, _loggerFactory, options, new ManagedFileSystem(_loggerFactory.CreateLogger(), appPaths), new NullImageEncoder(), new NetworkManager(_loggerFactory.CreateLogger()), - appConfig)) + appConfig); + try { await appHost.InitAsync(new ServiceCollection()).ConfigureAwait(false); @@ -165,15 +166,20 @@ namespace Jellyfin.Server await appHost.RunStartupTasksAsync().ConfigureAwait(false); - try - { - // Block main thread until shutdown - await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false); - } - catch (TaskCanceledException) - { - // Don't throw on cancellation - } + // Block main thread until shutdown + await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false); + } + catch (TaskCanceledException) + { + // Don't throw on cancellation + } + catch (Exception ex) + { + _logger.LogCritical(ex, "Error while starting server."); + } + finally + { + appHost?.Dispose(); } if (_restartOnShutdown) -- cgit v1.2.3 From 2919cf28ead3fc7b80dec789477eef4d2688616b Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Wed, 11 Sep 2019 19:31:35 +0200 Subject: Update deps (#1735) --- Emby.Server.Implementations/Emby.Server.Implementations.csproj | 4 ++-- Jellyfin.Server/Jellyfin.Server.csproj | 4 ++-- Jellyfin.Server/Program.cs | 2 +- MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index b48193c58..2c71f0457 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -21,7 +21,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index 8c57ee453..35f0c84cb 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -37,13 +37,13 @@ - + - + diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 594441af0..716dd0fcd 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -22,7 +22,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Serilog; -using Serilog.AspNetCore; +using Serilog.Extensions.Logging; using SQLitePCL; using ILogger = Microsoft.Extensions.Logging.ILogger; diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj index fdb20477f..264f31f3c 100644 --- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj +++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj @@ -19,7 +19,7 @@ - + -- cgit v1.2.3 From 0ca0d9d01e3f255b22e8952059c52a696d6c14bc Mon Sep 17 00:00:00 2001 From: Erwin de Haan Date: Tue, 24 Sep 2019 16:22:26 +0200 Subject: Remove submodule and add clone and build to CI --- .ci/azure-pipelines.yml | 35 +++++++++++++++++----- .gitmodules | 4 --- Dockerfile | 2 +- Dockerfile.arm | 2 +- Dockerfile.arm64 | 2 +- Jellyfin.Server/Program.cs | 2 +- .../MediaBrowser.WebDashboard.csproj | 2 +- MediaBrowser.WebDashboard/jellyfin-web | 1 - 8 files changed, 33 insertions(+), 17 deletions(-) delete mode 100644 .gitmodules delete mode 160000 MediaBrowser.WebDashboard/jellyfin-web (limited to 'Jellyfin.Server/Program.cs') diff --git a/.ci/azure-pipelines.yml b/.ci/azure-pipelines.yml index 705a64d85..03bd0f690 100644 --- a/.ci/azure-pipelines.yml +++ b/.ci/azure-pipelines.yml @@ -178,18 +178,39 @@ jobs: persistCredentials: true - task: CmdLine@2 - displayName: "Update submodules" + displayName: "Check out web" condition: and(succeeded(), or(contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI', 'BuildCompletion')) inputs: - script: 'git submodule foreach --recursive git checkout $(Build.SourceBranch)' - workingDirectory: '$(Build.SourcesDirectory)' + script: 'git clone --single-branch --branch $(Build.SourceBranch) --depth=1 https://github.com/jellyfin/jellyfin-web.git $(Agent.TempDirectory)/jellyfin-web' - task: CmdLine@2 - displayName: "Update submodules (PR)" + displayName: "Check out web (PR)" condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest')) inputs: - script: 'git submodule foreach --recursive git checkout $(System.PullRequest.TargetBranch)' - workingDirectory: '$(Build.SourcesDirectory)' + script: 'git clone --single-branch --branch $(System.PullRequest.TargetBranch) --depth 1 https://github.com/jellyfin/jellyfin-web.git $(Agent.TempDirectory)/jellyfin-web' + + - task: NodeTool@0 + displayName: 'Install Node.js' + condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion')) + inputs: + versionSpec: '10.x' + + - task: CmdLine@2 + displayName: "Build Web UI" + condition: and(succeeded(), or(contains(variables['System.PullRequest.TargetBranch'], 'release'), contains(variables['System.PullRequest.TargetBranch'], 'master'), contains(variables['Build.SourceBranch'], 'release'), contains(variables['Build.SourceBranch'], 'master')) ,eq(variables['BuildConfiguration'], 'Release'), in(variables['Build.Reason'], 'PullRequest', 'IndividualCI', 'BatchedCI', 'BuildCompletion')) + inputs: + script: yarn install + workingDirectory: $(Agent.TempDirectory)/jellyfin-web + + - task: CopyFiles@2 + displayName: Copy the web UI + inputs: + sourceFolder: $(Agent.TempDirectory)/jellyfin-web/dist # Optional + contents: '**' + targetFolder: $(Build.SourcesDirectory)/MediaBrowser.WebDashboard/jellyfin-web + cleanTargetFolder: true # Optional + overWrite: true # Optional + flattenFolders: false # Optional - task: CmdLine@2 displayName: Clone the UX repository @@ -214,7 +235,7 @@ jobs: inputs: sourceFolder: $(Build.SourcesDirectory)/deployment/windows/ # Optional contents: 'jellyfin*.exe' - targetFolder: $(System.ArtifactsDirectory)/setup + targetFolder: $(System.ArtifactsDirectory)/MediaBrowser.WebDashboard/jellyfin-web cleanTargetFolder: true # Optional overWrite: true # Optional flattenFolders: true # Optional diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2b97b1331..000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "MediaBrowser.WebDashboard/jellyfin-web"] - path = MediaBrowser.WebDashboard/jellyfin-web - url = https://github.com/jellyfin/jellyfin-web.git - branch = . diff --git a/Dockerfile b/Dockerfile index 017f8c697..483345e39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN apt-get update \ && chmod 777 /cache /config /media COPY --from=ffmpeg / / COPY --from=builder /jellyfin /jellyfin -COPY --from=web-builder /dist /jellyfin/jellyfin-web/src +COPY --from=web-builder /dist /jellyfin/jellyfin-web EXPOSE 8096 VOLUME /cache /config /media diff --git a/Dockerfile.arm b/Dockerfile.arm index d06eeb561..8a91d71be 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -35,7 +35,7 @@ RUN apt-get update \ && mkdir -p /cache /config /media \ && chmod 777 /cache /config /media COPY --from=builder /jellyfin /jellyfin -COPY --from=web-builder /dist /jellyfin/jellyfin-web/src +COPY --from=web-builder /dist /jellyfin/jellyfin-web EXPOSE 8096 VOLUME /cache /config /media diff --git a/Dockerfile.arm64 b/Dockerfile.arm64 index 1c5de4ed0..b24d5d599 100644 --- a/Dockerfile.arm64 +++ b/Dockerfile.arm64 @@ -35,7 +35,7 @@ RUN apt-get update \ && mkdir -p /cache /config /media \ && chmod 777 /cache /config /media COPY --from=builder /jellyfin /jellyfin -COPY --from=web-builder /dist /jellyfin/jellyfin-web/src +COPY --from=web-builder /dist /jellyfin/jellyfin-web EXPOSE 8096 VOLUME /cache /config /media diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 716dd0fcd..e9e884a3f 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -312,7 +312,7 @@ namespace Jellyfin.Server if (string.IsNullOrEmpty(webDir)) { // Use default location under ResourcesPath - webDir = Path.Combine(AppContext.BaseDirectory, "jellyfin-web", "src"); + webDir = Path.Combine(AppContext.BaseDirectory, "jellyfin-web"); } } diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 883986894..a43949367 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -10,7 +10,7 @@ - + PreserveNewest diff --git a/MediaBrowser.WebDashboard/jellyfin-web b/MediaBrowser.WebDashboard/jellyfin-web deleted file mode 160000 index 867a5e664..000000000 --- a/MediaBrowser.WebDashboard/jellyfin-web +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 867a5e664cb968602b50dee4874fcb961eed4803 -- cgit v1.2.3 From 4f63bfd616b98193a087c7e6d23b551382c80a34 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Fri, 27 Sep 2019 23:58:04 +0200 Subject: Don't log revision number --- Jellyfin.Server/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index e9e884a3f..6f1c111c6 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -125,7 +125,9 @@ namespace Jellyfin.Server Shutdown(); }; - _logger.LogInformation("Jellyfin version: {Version}", Assembly.GetEntryAssembly().GetName().Version); + _logger.LogInformation( + "Jellyfin version: {Version}", + Assembly.GetEntryAssembly().GetName().Version.ToString(3)); ApplicationHost.LogEnvironmentInfo(_logger, appPaths); -- cgit v1.2.3 From 1745f0181c0fdb4119c072f45bcfeb3af7b9132b Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 29 Sep 2019 00:29:28 +0200 Subject: Log startup time --- Jellyfin.Server/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 6f1c111c6..3ab19769a 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -84,6 +84,8 @@ namespace Jellyfin.Server private static async Task StartApp(StartupOptions options) { + var stopWatch = new Stopwatch(); + stopWatch.Start(); ServerApplicationPaths appPaths = CreateApplicationPaths(options); // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager @@ -168,6 +170,10 @@ namespace Jellyfin.Server await appHost.RunStartupTasksAsync().ConfigureAwait(false); + stopWatch.Stop(); + + _logger.LogInformation("Startup complete {Time:g}", stopWatch.Elapsed); + // Block main thread until shutdown await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false); } -- cgit v1.2.3 From c3eac58dda0b7cd185cb3ebd04284bbf3b9c0ebd Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Wed, 23 Oct 2019 19:52:12 +0200 Subject: Reload logging.json on changes --- Jellyfin.Server/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Jellyfin.Server/Program.cs') diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 3ab19769a..e8bd0cd30 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -376,7 +376,7 @@ namespace Jellyfin.Server return new ConfigurationBuilder() .SetBasePath(appPaths.ConfigurationDirectoryPath) - .AddJsonFile("logging.json") + .AddJsonFile("logging.json", false, true) .AddEnvironmentVariables("JELLYFIN_") .AddInMemoryCollection(ConfigurationOptions.Configuration) .Build(); -- cgit v1.2.3