mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
0110f22b78
13 changed files with 81 additions and 16 deletions
|
@ -171,6 +171,12 @@ namespace MediaBrowser.Common.Implementations
|
||||||
/// <value>The name.</value>
|
/// <value>The name.</value>
|
||||||
public abstract string Name { get; }
|
public abstract string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether this instance is running as service.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
||||||
|
public abstract bool IsRunningAsService { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System.Reflection;
|
using MediaBrowser.Common.Net;
|
||||||
using MediaBrowser.Common.Configuration;
|
|
||||||
using MediaBrowser.Common.Net;
|
|
||||||
using MediaBrowser.Common.ScheduledTasks;
|
using MediaBrowser.Common.ScheduledTasks;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System;
|
using System;
|
||||||
|
@ -74,7 +72,16 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||||
|
|
||||||
progress.Report(0);
|
progress.Report(0);
|
||||||
var mac = NetworkManager.GetMacAddress();
|
var mac = NetworkManager.GetMacAddress();
|
||||||
var data = new Dictionary<string, string> { { "feature", ApplicationHost.Name }, { "mac", mac }, { "ver", ApplicationHost.ApplicationVersion.ToString() }, { "platform", Environment.OSVersion.VersionString } };
|
|
||||||
|
var data = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "feature", ApplicationHost.Name },
|
||||||
|
{ "mac", mac },
|
||||||
|
{ "ver", ApplicationHost.ApplicationVersion.ToString() },
|
||||||
|
{ "platform", Environment.OSVersion.VersionString },
|
||||||
|
{ "isservice", ApplicationHost.IsRunningAsService.ToString().ToLower()}
|
||||||
|
};
|
||||||
|
|
||||||
await HttpClient.Post(Constants.Constants.MbAdminUrl + "service/registration/ping", data, CancellationToken.None).ConfigureAwait(false);
|
await HttpClient.Post(Constants.Constants.MbAdminUrl + "service/registration/ping", data, CancellationToken.None).ConfigureAwait(false);
|
||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
|
|
||||||
|
@ -86,7 +93,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
||||||
/// <value>The name.</value>
|
/// <value>The name.</value>
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "Collect stats"; }
|
get { return "Collect anonymous usage stats"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -24,6 +24,12 @@ namespace MediaBrowser.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event EventHandler<GenericEventArgs<Version>> ApplicationUpdated;
|
event EventHandler<GenericEventArgs<Version>> ApplicationUpdated;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether this instance is running as service.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
||||||
|
bool IsRunningAsService { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance has pending kernel reload.
|
/// Gets or sets a value indicating whether this instance has pending kernel reload.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -159,7 +159,8 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
folder = ResolveArgs.GetFileSystemEntryByName("specials");
|
folder = ResolveArgs.GetFileSystemEntryByName("extras") ??
|
||||||
|
ResolveArgs.GetFileSystemEntryByName("specials");
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -227,6 +227,8 @@ namespace MediaBrowser.Model.Configuration
|
||||||
public TvFileOrganizationOptions TvFileOrganizationOptions { get; set; }
|
public TvFileOrganizationOptions TvFileOrganizationOptions { get; set; }
|
||||||
public LiveTvOptions LiveTvOptions { get; set; }
|
public LiveTvOptions LiveTvOptions { get; set; }
|
||||||
|
|
||||||
|
public bool EnableRealtimeMonitor { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -294,6 +296,8 @@ namespace MediaBrowser.Model.Configuration
|
||||||
LiveTvOptions = new LiveTvOptions();
|
LiveTvOptions = new LiveTvOptions();
|
||||||
|
|
||||||
TvFileOrganizationOptions = new TvFileOrganizationOptions();
|
TvFileOrganizationOptions = new TvFileOrganizationOptions();
|
||||||
|
|
||||||
|
EnableRealtimeMonitor = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,13 @@ namespace MediaBrowser.Model.System
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The operating sytem.</value>
|
/// <value>The operating sytem.</value>
|
||||||
public string OperatingSystem { get; set; }
|
public string OperatingSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether this instance is running as service.
|
||||||
|
/// </summary>
|
||||||
|
/// <value><c>true</c> if this instance is running as service; otherwise, <c>false</c>.</value>
|
||||||
|
public bool IsRunningAsService { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the mac address.
|
/// Gets or sets the mac address.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -79,9 +79,15 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
||||||
|
|
||||||
foreach (var path in watchLocations)
|
foreach (var path in watchLocations)
|
||||||
{
|
{
|
||||||
if (options.LeftOverFileExtensionsToDelete.Length > 0)
|
var deleteExtensions = options.LeftOverFileExtensionsToDelete
|
||||||
|
.Select(i => i.Trim().TrimStart('.'))
|
||||||
|
.Where(i => !string.IsNullOrEmpty(i))
|
||||||
|
.Select(i => "." + i)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
if (deleteExtensions.Count > 0)
|
||||||
{
|
{
|
||||||
DeleteLeftOverFiles(path, options.LeftOverFileExtensionsToDelete);
|
DeleteLeftOverFiles(path, deleteExtensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.DeleteEmptyFolders)
|
if (options.DeleteEmptyFolders)
|
||||||
|
|
|
@ -18,7 +18,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
||||||
{
|
{
|
||||||
var log = new StringBuilder();
|
var log = new StringBuilder();
|
||||||
|
|
||||||
log.AppendLine("Ip: " + request.RemoteEndPoint + ". Headers: " + string.Join(",", request.Headers.AllKeys.Select(k => k + "=" + request.Headers[k])));
|
var headers = string.Join(",", request.Headers.AllKeys.Where(i => !string.Equals(i, "cookie", StringComparison.OrdinalIgnoreCase) && !string.Equals(i, "Referer", StringComparison.OrdinalIgnoreCase)).Select(k => k + "=" + request.Headers[k]));
|
||||||
|
|
||||||
|
log.AppendLine("Ip: " + request.RemoteEndPoint + ". Headers: " + headers);
|
||||||
|
|
||||||
var type = request.IsWebSocketRequest ? "Web Socket" : "HTTP " + request.HttpMethod;
|
var type = request.IsWebSocketRequest ? "Web Socket" : "HTTP " + request.HttpMethod;
|
||||||
|
|
||||||
|
|
|
@ -129,15 +129,28 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||||
/// <param name="sender">The source of the event.</param>
|
/// <param name="sender">The source of the event.</param>
|
||||||
/// <param name="e">The <see cref="PowerModeChangedEventArgs"/> instance containing the event data.</param>
|
/// <param name="e">The <see cref="PowerModeChangedEventArgs"/> instance containing the event data.</param>
|
||||||
void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
Restart();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Restart()
|
||||||
{
|
{
|
||||||
Stop();
|
Stop();
|
||||||
Start();
|
Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Start()
|
||||||
|
{
|
||||||
|
if (ConfigurationManager.Configuration.EnableRealtimeMonitor)
|
||||||
|
{
|
||||||
|
StartInternal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Starts this instance.
|
/// Starts this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Start()
|
private void StartInternal()
|
||||||
{
|
{
|
||||||
LibraryManager.ItemAdded += LibraryManager_ItemAdded;
|
LibraryManager.ItemAdded += LibraryManager_ItemAdded;
|
||||||
LibraryManager.ItemRemoved += LibraryManager_ItemRemoved;
|
LibraryManager.ItemRemoved += LibraryManager_ItemRemoved;
|
||||||
|
@ -359,7 +372,7 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||||
{
|
{
|
||||||
throw new ArgumentNullException("path");
|
throw new ArgumentNullException("path");
|
||||||
}
|
}
|
||||||
|
|
||||||
var filename = Path.GetFileName(path);
|
var filename = Path.GetFileName(path);
|
||||||
|
|
||||||
// Ignore certain files
|
// Ignore certain files
|
||||||
|
|
|
@ -179,10 +179,16 @@ namespace MediaBrowser.ServerApplication
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="applicationPaths">The application paths.</param>
|
/// <param name="applicationPaths">The application paths.</param>
|
||||||
/// <param name="logManager">The log manager.</param>
|
/// <param name="logManager">The log manager.</param>
|
||||||
public ApplicationHost(ServerApplicationPaths applicationPaths, ILogManager logManager)
|
public ApplicationHost(ServerApplicationPaths applicationPaths, ILogManager logManager, bool isRunningAsService)
|
||||||
: base(applicationPaths, logManager)
|
: base(applicationPaths, logManager)
|
||||||
{
|
{
|
||||||
|
_isRunningAsService = isRunningAsService;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly bool _isRunningAsService;
|
||||||
|
public override bool IsRunningAsService
|
||||||
|
{
|
||||||
|
get { return _isRunningAsService; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -431,7 +437,7 @@ namespace MediaBrowser.ServerApplication
|
||||||
await ItemRepository.Initialize().ConfigureAwait(false);
|
await ItemRepository.Initialize().ConfigureAwait(false);
|
||||||
|
|
||||||
await ProviderRepository.Initialize().ConfigureAwait(false);
|
await ProviderRepository.Initialize().ConfigureAwait(false);
|
||||||
|
|
||||||
((LibraryManager)LibraryManager).ItemRepository = ItemRepository;
|
((LibraryManager)LibraryManager).ItemRepository = ItemRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,7 +693,8 @@ namespace MediaBrowser.ServerApplication
|
||||||
WanAddress = GetWanAddress(),
|
WanAddress = GetWanAddress(),
|
||||||
HasUpdateAvailable = _hasUpdateAvailable,
|
HasUpdateAvailable = _hasUpdateAvailable,
|
||||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath
|
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||||
|
IsRunningAsService = IsRunningAsService
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ namespace MediaBrowser.ServerApplication
|
||||||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||||
|
|
||||||
_appHost = new ApplicationHost(appPaths, logManager);
|
_appHost = new ApplicationHost(appPaths, logManager, runService);
|
||||||
|
|
||||||
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
||||||
|
|
||||||
|
|
|
@ -495,6 +495,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
"itemdetailpage.js",
|
"itemdetailpage.js",
|
||||||
"itemgallery.js",
|
"itemgallery.js",
|
||||||
"itemlistpage.js",
|
"itemlistpage.js",
|
||||||
|
"librarypathmapping.js",
|
||||||
"librarysettings.js",
|
"librarysettings.js",
|
||||||
"livetvchannel.js",
|
"livetvchannel.js",
|
||||||
"livetvchannels.js",
|
"livetvchannels.js",
|
||||||
|
|
|
@ -175,6 +175,9 @@
|
||||||
<Content Include="dashboard-ui\autoorganizelog.html">
|
<Content Include="dashboard-ui\autoorganizelog.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\librarypathmapping.html">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\livetvchannel.html">
|
<Content Include="dashboard-ui\livetvchannel.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -436,6 +439,9 @@
|
||||||
<Content Include="dashboard-ui\scripts\librarymenu.js">
|
<Content Include="dashboard-ui\scripts\librarymenu.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\scripts\librarypathmapping.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\scripts\livetvchannel.js">
|
<Content Include="dashboard-ui\scripts\livetvchannel.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Reference in a new issue