Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
0110f22b78
|
@ -171,6 +171,12 @@ namespace MediaBrowser.Common.Implementations
|
|||
/// <value>The name.</value>
|
||||
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>
|
||||
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
|
||||
/// </summary>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System.Reflection;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
|
@ -74,7 +72,16 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
|||
|
||||
progress.Report(0);
|
||||
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);
|
||||
progress.Report(100);
|
||||
|
||||
|
@ -86,7 +93,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks.Tasks
|
|||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get { return "Collect stats"; }
|
||||
get { return "Collect anonymous usage stats"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -24,6 +24,12 @@ namespace MediaBrowser.Common
|
|||
/// </summary>
|
||||
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>
|
||||
/// Gets or sets a value indicating whether this instance has pending kernel reload.
|
||||
/// </summary>
|
||||
|
|
|
@ -159,7 +159,8 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||
|
||||
try
|
||||
{
|
||||
folder = ResolveArgs.GetFileSystemEntryByName("specials");
|
||||
folder = ResolveArgs.GetFileSystemEntryByName("extras") ??
|
||||
ResolveArgs.GetFileSystemEntryByName("specials");
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
|
|
|
@ -227,6 +227,8 @@ namespace MediaBrowser.Model.Configuration
|
|||
public TvFileOrganizationOptions TvFileOrganizationOptions { get; set; }
|
||||
public LiveTvOptions LiveTvOptions { get; set; }
|
||||
|
||||
public bool EnableRealtimeMonitor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
||||
/// </summary>
|
||||
|
@ -294,6 +296,8 @@ namespace MediaBrowser.Model.Configuration
|
|||
LiveTvOptions = new LiveTvOptions();
|
||||
|
||||
TvFileOrganizationOptions = new TvFileOrganizationOptions();
|
||||
|
||||
EnableRealtimeMonitor = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,13 @@ namespace MediaBrowser.Model.System
|
|||
/// </summary>
|
||||
/// <value>The operating sytem.</value>
|
||||
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>
|
||||
/// Gets or sets the mac address.
|
||||
/// </summary>
|
||||
|
|
|
@ -79,9 +79,15 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
|||
|
||||
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)
|
||||
|
|
|
@ -18,7 +18,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
{
|
||||
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;
|
||||
|
||||
|
|
|
@ -129,15 +129,28 @@ namespace MediaBrowser.Server.Implementations.IO
|
|||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="PowerModeChangedEventArgs"/> instance containing the event data.</param>
|
||||
void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||
{
|
||||
Restart();
|
||||
}
|
||||
|
||||
private void Restart()
|
||||
{
|
||||
Stop();
|
||||
Start();
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (ConfigurationManager.Configuration.EnableRealtimeMonitor)
|
||||
{
|
||||
StartInternal();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts this instance.
|
||||
/// </summary>
|
||||
public void Start()
|
||||
private void StartInternal()
|
||||
{
|
||||
LibraryManager.ItemAdded += LibraryManager_ItemAdded;
|
||||
LibraryManager.ItemRemoved += LibraryManager_ItemRemoved;
|
||||
|
@ -359,7 +372,7 @@ namespace MediaBrowser.Server.Implementations.IO
|
|||
{
|
||||
throw new ArgumentNullException("path");
|
||||
}
|
||||
|
||||
|
||||
var filename = Path.GetFileName(path);
|
||||
|
||||
// Ignore certain files
|
||||
|
|
|
@ -179,10 +179,16 @@ namespace MediaBrowser.ServerApplication
|
|||
/// </summary>
|
||||
/// <param name="applicationPaths">The application paths.</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)
|
||||
{
|
||||
_isRunningAsService = isRunningAsService;
|
||||
}
|
||||
|
||||
private readonly bool _isRunningAsService;
|
||||
public override bool IsRunningAsService
|
||||
{
|
||||
get { return _isRunningAsService; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -431,7 +437,7 @@ namespace MediaBrowser.ServerApplication
|
|||
await ItemRepository.Initialize().ConfigureAwait(false);
|
||||
|
||||
await ProviderRepository.Initialize().ConfigureAwait(false);
|
||||
|
||||
|
||||
((LibraryManager)LibraryManager).ItemRepository = ItemRepository;
|
||||
}
|
||||
|
||||
|
@ -687,7 +693,8 @@ namespace MediaBrowser.ServerApplication
|
|||
WanAddress = GetWanAddress(),
|
||||
HasUpdateAvailable = _hasUpdateAvailable,
|
||||
SupportsAutoRunAtStartup = SupportsAutoRunAtStartup,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||
IsRunningAsService = IsRunningAsService
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,7 @@ namespace MediaBrowser.ServerApplication
|
|||
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
||||
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
||||
|
||||
_appHost = new ApplicationHost(appPaths, logManager);
|
||||
_appHost = new ApplicationHost(appPaths, logManager, runService);
|
||||
|
||||
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
||||
|
||||
|
|
|
@ -495,6 +495,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
"itemdetailpage.js",
|
||||
"itemgallery.js",
|
||||
"itemlistpage.js",
|
||||
"librarypathmapping.js",
|
||||
"librarysettings.js",
|
||||
"livetvchannel.js",
|
||||
"livetvchannels.js",
|
||||
|
|
|
@ -175,6 +175,9 @@
|
|||
<Content Include="dashboard-ui\autoorganizelog.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\librarypathmapping.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\livetvchannel.html">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
@ -436,6 +439,9 @@
|
|||
<Content Include="dashboard-ui\scripts\librarymenu.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\librarypathmapping.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\scripts\livetvchannel.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
Loading…
Reference in New Issue
Block a user