aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs5
-rw-r--r--Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs65
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs20
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs30
-rw-r--r--Jellyfin.Server/CoreAppHost.cs4
-rw-r--r--Jellyfin.Server/Jellyfin.Server.csproj1
-rw-r--r--Jellyfin.Server/PowerManagement.cs23
-rw-r--r--Jellyfin.Server/Program.cs8
-rw-r--r--Jellyfin.Server/Resources/Configuration/logging.json19
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs18
-rw-r--r--MediaBrowser.Model/System/IPowerManagement.cs11
-rw-r--r--SharedVersion.cs2
-rw-r--r--debian/source/options1
13 files changed, 63 insertions, 144 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index 9b9c6146f..950ae10c7 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -369,7 +369,6 @@ namespace Emby.Server.Implementations
public StartupOptions StartupOptions { get; private set; }
- internal IPowerManagement PowerManagement { get; private set; }
internal IImageEncoder ImageEncoder { get; private set; }
protected IProcessFactory ProcessFactory { get; private set; }
@@ -391,7 +390,6 @@ namespace Emby.Server.Implementations
ILoggerFactory loggerFactory,
StartupOptions options,
IFileSystem fileSystem,
- IPowerManagement powerManagement,
IEnvironmentInfo environmentInfo,
IImageEncoder imageEncoder,
ISystemEvents systemEvents,
@@ -417,7 +415,6 @@ namespace Emby.Server.Implementations
Logger = LoggerFactory.CreateLogger("App");
StartupOptions = options;
- PowerManagement = powerManagement;
ImageEncoder = imageEncoder;
@@ -857,8 +854,6 @@ namespace Emby.Server.Implementations
SocketFactory = new SocketFactory(LoggerFactory.CreateLogger("SocketFactory"));
RegisterSingleInstance(SocketFactory);
- RegisterSingleInstance(PowerManagement);
-
SecurityManager = new PluginSecurityManager(this, HttpClient, JsonSerializer, ApplicationPaths, LoggerFactory, FileSystemManager, CryptographyProvider);
RegisterSingleInstance(SecurityManager);
diff --git a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs b/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
deleted file mode 100644
index a6dadcef0..000000000
--- a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using MediaBrowser.Controller;
-using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Controller.Session;
-using Microsoft.Extensions.Logging;
-using System;
-using System.Linq;
-using MediaBrowser.Model.System;
-using MediaBrowser.Model.Threading;
-
-namespace Emby.Server.Implementations.EntryPoints
-{
- public class KeepServerAwake : IServerEntryPoint
- {
- private readonly ISessionManager _sessionManager;
- private readonly ILogger _logger;
- private ITimer _timer;
- private readonly IServerApplicationHost _appHost;
- private readonly ITimerFactory _timerFactory;
- private readonly IPowerManagement _powerManagement;
-
- public KeepServerAwake(ISessionManager sessionManager, ILogger logger, IServerApplicationHost appHost, ITimerFactory timerFactory, IPowerManagement powerManagement)
- {
- _sessionManager = sessionManager;
- _logger = logger;
- _appHost = appHost;
- _timerFactory = timerFactory;
- _powerManagement = powerManagement;
- }
-
- public void Run()
- {
- _timer = _timerFactory.Create(OnTimerCallback, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
- }
-
- private void OnTimerCallback(object state)
- {
- var now = DateTime.UtcNow;
-
- try
- {
- if (_sessionManager.Sessions.Any(i => (now - i.LastActivityDate).TotalMinutes < 15))
- {
- _powerManagement.PreventSystemStandby();
- }
- else
- {
- _powerManagement.AllowSystemStandby();
- }
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error resetting system standby timer");
- }
- }
-
- public void Dispose()
- {
- if (_timer != null)
- {
- _timer.Dispose();
- _timer = null;
- }
- }
- }
-}
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 59f9fe86f..81a47bfea 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -75,7 +75,23 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
private readonly IStreamHelper _streamHelper;
- public EmbyTV(IServerApplicationHost appHost, IStreamHelper streamHelper, IMediaSourceManager mediaSourceManager, IAssemblyInfo assemblyInfo, ILogger logger, IJsonSerializer jsonSerializer, IPowerManagement powerManagement, IHttpClient httpClient, IServerConfigurationManager config, ILiveTvManager liveTvManager, IFileSystem fileSystem, ILibraryManager libraryManager, ILibraryMonitor libraryMonitor, IProviderManager providerManager, IMediaEncoder mediaEncoder, ITimerFactory timerFactory, IProcessFactory processFactory, ISystemEvents systemEvents)
+ public EmbyTV(IServerApplicationHost appHost,
+ IStreamHelper streamHelper,
+ IMediaSourceManager mediaSourceManager,
+ IAssemblyInfo assemblyInfo,
+ ILogger logger,
+ IJsonSerializer jsonSerializer,
+ IHttpClient httpClient,
+ IServerConfigurationManager config,
+ ILiveTvManager liveTvManager,
+ IFileSystem fileSystem,
+ ILibraryManager libraryManager,
+ ILibraryMonitor libraryMonitor,
+ IProviderManager providerManager,
+ IMediaEncoder mediaEncoder,
+ ITimerFactory timerFactory,
+ IProcessFactory processFactory,
+ ISystemEvents systemEvents)
{
Current = this;
@@ -97,7 +113,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_streamHelper = streamHelper;
_seriesTimerProvider = new SeriesTimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "seriestimers"));
- _timerProvider = new TimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "timers"), _logger, timerFactory, powerManagement);
+ _timerProvider = new TimerManager(fileSystem, jsonSerializer, _logger, Path.Combine(DataPath, "timers"), _logger, timerFactory);
_timerProvider.TimerFired += _timerProvider_TimerFired;
_config.NamedConfigurationUpdated += _config_NamedConfigurationUpdated;
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
index 76a044c02..e4ab34770 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/TimerManager.cs
@@ -9,7 +9,6 @@ using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Threading;
-using MediaBrowser.Model.System;
namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
@@ -20,14 +19,12 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public event EventHandler<GenericEventArgs<TimerInfo>> TimerFired;
private readonly ITimerFactory _timerFactory;
- private readonly IPowerManagement _powerManagement;
- public TimerManager(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath, ILogger logger1, ITimerFactory timerFactory, IPowerManagement powerManagement)
+ public TimerManager(IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, string dataPath, ILogger logger1, ITimerFactory timerFactory)
: base(fileSystem, jsonSerializer, logger, dataPath, (r1, r2) => string.Equals(r1.Id, r2.Id, StringComparison.OrdinalIgnoreCase))
{
_logger = logger1;
_timerFactory = timerFactory;
- _powerManagement = powerManagement;
}
public void RestartTimers()
@@ -36,7 +33,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
foreach (var item in GetAll().ToList())
{
- AddOrUpdateSystemTimer(item, false);
+ AddOrUpdateSystemTimer(item);
}
}
@@ -59,7 +56,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public override void Update(TimerInfo item)
{
base.Update(item);
- AddOrUpdateSystemTimer(item, false);
+ AddOrUpdateSystemTimer(item);
}
public void AddOrUpdate(TimerInfo item, bool resetTimer)
@@ -90,7 +87,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
base.Add(item);
- AddOrUpdateSystemTimer(item, true);
+ AddOrUpdateSystemTimer(item);
}
private bool ShouldStartTimer(TimerInfo item)
@@ -104,7 +101,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return true;
}
- private void AddOrUpdateSystemTimer(TimerInfo item, bool scheduleSystemWakeTimer)
+ private void AddOrUpdateSystemTimer(TimerInfo item)
{
StopTimer(item);
@@ -124,23 +121,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var dueTime = startDate - now;
StartTimer(item, dueTime);
-
- if (scheduleSystemWakeTimer && dueTime >= TimeSpan.FromMinutes(15))
- {
- ScheduleSystemWakeTimer(startDate, item.Name);
- }
- }
-
- private void ScheduleSystemWakeTimer(DateTime startDate, string displayName)
- {
- try
- {
- _powerManagement.ScheduleWake(startDate.AddMinutes(-5), displayName);
- }
- catch (Exception ex)
- {
- _logger.LogError(ex, "Error scheduling wake timer");
- }
}
private void StartTimer(TimerInfo item, TimeSpan dueTime)
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.cs
index b54634387..64e03f22e 100644
--- a/Jellyfin.Server/CoreAppHost.cs
+++ b/Jellyfin.Server/CoreAppHost.cs
@@ -11,8 +11,8 @@ namespace Jellyfin.Server
{
public class CoreAppHost : ApplicationHost
{
- public CoreAppHost(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, StartupOptions options, IFileSystem fileSystem, IPowerManagement powerManagement, IEnvironmentInfo environmentInfo, MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder, ISystemEvents systemEvents, MediaBrowser.Common.Net.INetworkManager networkManager)
- : base(applicationPaths, loggerFactory, options, fileSystem, powerManagement, environmentInfo, imageEncoder, systemEvents, networkManager)
+ public CoreAppHost(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, StartupOptions options, IFileSystem fileSystem, IEnvironmentInfo environmentInfo, MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder, ISystemEvents systemEvents, MediaBrowser.Common.Net.INetworkManager networkManager)
+ : base(applicationPaths, loggerFactory, options, fileSystem, environmentInfo, imageEncoder, systemEvents, networkManager)
{
}
diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj
index 8ecae1b5b..98c578e83 100644
--- a/Jellyfin.Server/Jellyfin.Server.csproj
+++ b/Jellyfin.Server/Jellyfin.Server.csproj
@@ -25,6 +25,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.0.1" />
+ <PackageReference Include="Serilog.Sinks.Async" Version="1.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="SkiaSharp" Version="1.68.0" />
diff --git a/Jellyfin.Server/PowerManagement.cs b/Jellyfin.Server/PowerManagement.cs
deleted file mode 100644
index c27c51893..000000000
--- a/Jellyfin.Server/PowerManagement.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using MediaBrowser.Model.System;
-
-namespace Jellyfin.Server.Native
-{
- public class PowerManagement : IPowerManagement
- {
- public void PreventSystemStandby()
- {
-
- }
-
- public void AllowSystemStandby()
- {
-
- }
-
- public void ScheduleWake(DateTime wakeTimeUtc, string displayName)
- {
-
- }
- }
-}
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index eedc9f9ce..e9f4708c8 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -13,7 +13,6 @@ using Emby.Server.Implementations;
using Emby.Server.Implementations.EnvironmentInfo;
using Emby.Server.Implementations.IO;
using Emby.Server.Implementations.Networking;
-using Jellyfin.Server.Native;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Drawing;
@@ -71,7 +70,6 @@ namespace Jellyfin.Server
_loggerFactory,
options,
fileSystem,
- new PowerManagement(),
environmentInfo,
new NullImageEncoder(),
new SystemEvents(_loggerFactory.CreateLogger("SystemEvents")),
@@ -214,10 +212,10 @@ namespace Jellyfin.Server
{
Serilog.Log.Logger = new LoggerConfiguration()
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}")
- .WriteTo.File(
+ .WriteTo.Async(x => x.File(
Path.Combine(appPaths.LogDirectoryPath, "log_.log"),
rollingInterval: RollingInterval.Day,
- outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}")
+ outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}"))
.Enrich.FromLogContext()
.CreateLogger();
@@ -274,7 +272,7 @@ namespace Jellyfin.Server
}
}
- public static void Shutdown()
+ public static void Shutdown()
{
ApplicationTaskCompletionSource.SetResult(true);
}
diff --git a/Jellyfin.Server/Resources/Configuration/logging.json b/Jellyfin.Server/Resources/Configuration/logging.json
index 78f99b2ad..d16991277 100644
--- a/Jellyfin.Server/Resources/Configuration/logging.json
+++ b/Jellyfin.Server/Resources/Configuration/logging.json
@@ -2,16 +2,25 @@
"Serilog": {
"MinimumLevel": "Information",
"WriteTo": [
- { "Name": "Console",
+ {
+ "Name": "Console",
"Args": {
"outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}"
}
},
- { "Name": "File",
+ {
+ "Name": "Async",
"Args": {
- "path": "%JELLYFIN_LOG_DIR%//log_.log",
- "rollingInterval": "Day",
- "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}"
+ "configure": [
+ {
+ "Name": "File",
+ "Args": {
+ "path": "%JELLYFIN_LOG_DIR%//log_.log",
+ "rollingInterval": "Day",
+ "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] {Message}{NewLine}{Exception}"
+ }
+ }
+ ]
}
}
]
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 28e75bf55..fa6502bda 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -590,6 +590,22 @@ namespace MediaBrowser.Api.Playback
}
/// <summary>
+ /// Parses query parameters as StreamOptions
+ /// <summary>
+ /// <param name="request">The stream request.</param>
+ private void ParseStreamOptions(StreamRequest request)
+ {
+ foreach (var param in Request.QueryString) {
+ if (Char.IsLower(param.Name[0])) {
+ // This was probably not parsed initially and should be a StreamOptions
+ // TODO: This should be incorporated either in the lower framework for parsing requests
+ // or the generated URL should correctly serialize it
+ request.StreamOptions[param.Name] = param.Value;
+ }
+ }
+ }
+
+ /// <summary>
/// Parses the dlna headers.
/// </summary>
/// <param name="request">The request.</param>
@@ -667,6 +683,8 @@ namespace MediaBrowser.Api.Playback
ParseParams(request);
}
+ ParseStreamOptions(request);
+
var url = Request.PathInfo;
if (string.IsNullOrEmpty(request.AudioCodec))
diff --git a/MediaBrowser.Model/System/IPowerManagement.cs b/MediaBrowser.Model/System/IPowerManagement.cs
deleted file mode 100644
index 03907568c..000000000
--- a/MediaBrowser.Model/System/IPowerManagement.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-
-namespace MediaBrowser.Model.System
-{
- public interface IPowerManagement
- {
- void PreventSystemStandby();
- void AllowSystemStandby();
- void ScheduleWake(DateTime wakeTimeUtc, string displayName);
- }
-}
diff --git a/SharedVersion.cs b/SharedVersion.cs
index 379b5b43c..791d6cac5 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,3 +1,3 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.5.2.0")]
+[assembly: AssemblyVersion("10.0.0")]
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 000000000..45bef4764
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+tar-ignore = ".git*"