Remove EnvironmentInfo

This moved the last bit of usefulness of EnvironmentInfo into a static
class.
This commit is contained in:
Bond-009
2019-03-07 17:39:40 +01:00
parent 669c48cc8b
commit decaffed86
20 changed files with 144 additions and 225 deletions

View File

@@ -10,8 +10,8 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Tasks;
using Microsoft.Extensions.Logging;
using OperatingSystem = MediaBrowser.Common.System.OperatingSystem;
namespace Emby.Server.Implementations.IO
{
@@ -127,7 +127,6 @@ namespace Emby.Server.Implementations.IO
private IServerConfigurationManager ConfigurationManager { get; set; }
private readonly IFileSystem _fileSystem;
private readonly IEnvironmentInfo _environmentInfo;
/// <summary>
/// Initializes a new instance of the <see cref="LibraryMonitor" /> class.
@@ -136,14 +135,12 @@ namespace Emby.Server.Implementations.IO
ILoggerFactory loggerFactory,
ILibraryManager libraryManager,
IServerConfigurationManager configurationManager,
IFileSystem fileSystem,
IEnvironmentInfo environmentInfo)
IFileSystem fileSystem)
{
LibraryManager = libraryManager;
Logger = loggerFactory.CreateLogger(GetType().Name);
ConfigurationManager = configurationManager;
_fileSystem = fileSystem;
_environmentInfo = environmentInfo;
}
private bool IsLibraryMonitorEnabled(BaseItem item)
@@ -267,7 +264,7 @@ namespace Emby.Server.Implementations.IO
return;
}
if (_environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows)
if (OperatingSystem.Id != OperatingSystemId.Windows)
{
if (path.StartsWith("\\\\", StringComparison.OrdinalIgnoreCase) || path.StartsWith("smb://", StringComparison.OrdinalIgnoreCase))
{
@@ -276,12 +273,6 @@ namespace Emby.Server.Implementations.IO
}
}
if (_environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Android)
{
// causing crashing
return;
}
// Already being watched
if (_fileSystemWatchers.ContainsKey(path))
{