Merge pull request #2827 from MediaBrowser/dev

Dev
pull/1154/head
Luke 7 years ago committed by GitHub
commit c58db90c95

@ -1,902 +0,0 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Events;
using Emby.Common.Implementations.Devices;
using Emby.Common.Implementations.IO;
using Emby.Common.Implementations.ScheduledTasks;
using Emby.Common.Implementations.Serialization;
using MediaBrowser.Common.Net;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
using MediaBrowser.Common.Security;
using MediaBrowser.Common.Updates;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Updates;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Common.Extensions;
using Emby.Common.Implementations.Cryptography;
using Emby.Common.Implementations.Diagnostics;
using Emby.Common.Implementations.Net;
using Emby.Common.Implementations.EnvironmentInfo;
using Emby.Common.Implementations.Threading;
using MediaBrowser.Common;
using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.Diagnostics;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Threading;
namespace Emby.Common.Implementations
{
/// <summary>
/// Class BaseApplicationHost
/// </summary>
/// <typeparam name="TApplicationPathsType">The type of the T application paths type.</typeparam>
public abstract class BaseApplicationHost<TApplicationPathsType> : IApplicationHost
where TApplicationPathsType : class, IApplicationPaths
{
/// <summary>
/// Occurs when [has pending restart changed].
/// </summary>
public event EventHandler HasPendingRestartChanged;
/// <summary>
/// Occurs when [application updated].
/// </summary>
public event EventHandler<GenericEventArgs<PackageVersionInfo>> ApplicationUpdated;
/// <summary>
/// Gets or sets a value indicating whether this instance has changes that require the entire application to restart.
/// </summary>
/// <value><c>true</c> if this instance has pending application restart; otherwise, <c>false</c>.</value>
public bool HasPendingRestart { get; private set; }
/// <summary>
/// Gets or sets the logger.
/// </summary>
/// <value>The logger.</value>
protected ILogger Logger { get; private set; }
/// <summary>
/// Gets or sets the plugins.
/// </summary>
/// <value>The plugins.</value>
public IPlugin[] Plugins { get; protected set; }
/// <summary>
/// Gets or sets the log manager.
/// </summary>
/// <value>The log manager.</value>
public ILogManager LogManager { get; protected set; }
/// <summary>
/// Gets the application paths.
/// </summary>
/// <value>The application paths.</value>
protected TApplicationPathsType ApplicationPaths { get; private set; }
/// <summary>
/// The json serializer
/// </summary>
public IJsonSerializer JsonSerializer { get; private set; }
/// <summary>
/// The _XML serializer
/// </summary>
protected readonly IXmlSerializer XmlSerializer;
/// <summary>
/// Gets assemblies that failed to load
/// </summary>
/// <value>The failed assemblies.</value>
public List<string> FailedAssemblies { get; protected set; }
/// <summary>
/// Gets all concrete types.
/// </summary>
/// <value>All concrete types.</value>
public Type[] AllConcreteTypes { get; protected set; }
/// <summary>
/// The disposable parts
/// </summary>
protected readonly List<IDisposable> DisposableParts = new List<IDisposable>();
/// <summary>
/// Gets a value indicating whether this instance is first run.
/// </summary>
/// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
public bool IsFirstRun { get; private set; }
/// <summary>
/// Gets the kernel.
/// </summary>
/// <value>The kernel.</value>
protected ITaskManager TaskManager { get; private set; }
/// <summary>
/// Gets the HTTP client.
/// </summary>
/// <value>The HTTP client.</value>
public IHttpClient HttpClient { get; private set; }
/// <summary>
/// Gets the network manager.
/// </summary>
/// <value>The network manager.</value>
protected INetworkManager NetworkManager { get; private set; }
/// <summary>
/// Gets the configuration manager.
/// </summary>
/// <value>The configuration manager.</value>
protected IConfigurationManager ConfigurationManager { get; private set; }
public IFileSystem FileSystemManager { get; private set; }
protected IIsoManager IsoManager { get; private set; }
protected IProcessFactory ProcessFactory { get; private set; }
protected ITimerFactory TimerFactory { get; private set; }
protected ISocketFactory SocketFactory { get; private set; }
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public abstract string Name { get; }
protected ICryptoProvider CryptographyProvider = new CryptographyProvider();
protected IEnvironmentInfo EnvironmentInfo { get; private set; }
private DeviceId _deviceId;
public string SystemId
{
get
{
if (_deviceId == null)
{
_deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"), FileSystemManager);
}
return _deviceId.Value;
}
}
public PackageVersionClass SystemUpdateLevel
{
get
{
#if BETA
return PackageVersionClass.Beta;
#endif
return PackageVersionClass.Release;
}
}
public virtual string OperatingSystemDisplayName
{
get { return EnvironmentInfo.OperatingSystemName; }
}
/// <summary>
/// The container
/// </summary>
protected readonly SimpleInjector.Container Container = new SimpleInjector.Container();
protected ISystemEvents SystemEvents { get; private set; }
protected IMemoryStreamFactory MemoryStreamFactory { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationHost{TApplicationPathsType}"/> class.
/// </summary>
protected BaseApplicationHost(TApplicationPathsType applicationPaths,
ILogManager logManager,
IFileSystem fileSystem,
IEnvironmentInfo environmentInfo,
ISystemEvents systemEvents,
IMemoryStreamFactory memoryStreamFactory,
INetworkManager networkManager)
{
NetworkManager = networkManager;
EnvironmentInfo = environmentInfo;
SystemEvents = systemEvents;
MemoryStreamFactory = memoryStreamFactory;
// hack alert, until common can target .net core
BaseExtensions.CryptographyProvider = CryptographyProvider;
XmlSerializer = new MyXmlSerializer(fileSystem, logManager.GetLogger("XmlSerializer"));
FailedAssemblies = new List<string>();
ApplicationPaths = applicationPaths;
LogManager = logManager;
FileSystemManager = fileSystem;
ConfigurationManager = GetConfigurationManager();
// Initialize this early in case the -v command line option is used
Logger = LogManager.GetLogger("App");
}
/// <summary>
/// Inits this instance.
/// </summary>
/// <returns>Task.</returns>
public virtual async Task Init(IProgress<double> progress)
{
progress.Report(1);
JsonSerializer = CreateJsonSerializer();
OnLoggerLoaded(true);
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
IsFirstRun = !ConfigurationManager.CommonConfiguration.IsStartupWizardCompleted;
progress.Report(2);
LogManager.LogSeverity = ConfigurationManager.CommonConfiguration.EnableDebugLevelLogging
? LogSeverity.Debug
: LogSeverity.Info;
progress.Report(3);
DiscoverTypes();
progress.Report(14);
SetHttpLimit();
progress.Report(15);
var innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(p => progress.Report(.8 * p + 15));
await RegisterResources(innerProgress).ConfigureAwait(false);
FindParts();
progress.Report(95);
await InstallIsoMounters(CancellationToken.None).ConfigureAwait(false);
progress.Report(100);
}
protected virtual void OnLoggerLoaded(bool isFirstLoad)
{
Logger.Info("Application version: {0}", ApplicationVersion);
if (!isFirstLoad)
{
LogEnvironmentInfo(Logger, ApplicationPaths, false);
}
// Put the app config in the log for troubleshooting purposes
Logger.LogMultiline("Application configuration:", LogSeverity.Info, new StringBuilder(JsonSerializer.SerializeToString(ConfigurationManager.CommonConfiguration)));
if (Plugins != null)
{
var pluginBuilder = new StringBuilder();
foreach (var plugin in Plugins)
{
pluginBuilder.AppendLine(string.Format("{0} {1}", plugin.Name, plugin.Version));
}
Logger.LogMultiline("Plugins:", LogSeverity.Info, pluginBuilder);
}
}
public static void LogEnvironmentInfo(ILogger logger, IApplicationPaths appPaths, bool isStartup)
{
logger.LogMultiline("Emby", LogSeverity.Info, GetBaseExceptionMessage(appPaths));
}
protected static StringBuilder GetBaseExceptionMessage(IApplicationPaths appPaths)
{
var builder = new StringBuilder();
builder.AppendLine(string.Format("Command line: {0}", string.Join(" ", Environment.GetCommandLineArgs())));
builder.AppendLine(string.Format("Operating system: {0}", Environment.OSVersion));
builder.AppendLine(string.Format("64-Bit OS: {0}", Environment.Is64BitOperatingSystem));
builder.AppendLine(string.Format("64-Bit Process: {0}", Environment.Is64BitProcess));
Type type = Type.GetType("Mono.Runtime");
if (type != null)
{
MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
if (displayName != null)
{
builder.AppendLine("Mono: " + displayName.Invoke(null, null));
}
}
builder.AppendLine(string.Format("Processor count: {0}", Environment.ProcessorCount));
builder.AppendLine(string.Format("Program data path: {0}", appPaths.ProgramDataPath));
builder.AppendLine(string.Format("Application directory: {0}", appPaths.ProgramSystemPath));
return builder;
}
protected abstract IJsonSerializer CreateJsonSerializer();
private void SetHttpLimit()
{
try
{
// Increase the max http request limit
ServicePointManager.DefaultConnectionLimit = Math.Max(96, ServicePointManager.DefaultConnectionLimit);
}
catch (Exception ex)
{
Logger.ErrorException("Error setting http limit", ex);
}
}
/// <summary>
/// Installs the iso mounters.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
private async Task InstallIsoMounters(CancellationToken cancellationToken)
{
var list = new List<IIsoMounter>();
foreach (var isoMounter in GetExports<IIsoMounter>())
{
try
{
if (isoMounter.RequiresInstallation && !isoMounter.IsInstalled)
{
Logger.Info("Installing {0}", isoMounter.Name);
await isoMounter.Install(cancellationToken).ConfigureAwait(false);
}
list.Add(isoMounter);
}
catch (Exception ex)
{
Logger.ErrorException("{0} failed to load.", ex, isoMounter.Name);
}
}
IsoManager.AddParts(list);
}
/// <summary>
/// Runs the startup tasks.
/// </summary>
/// <returns>Task.</returns>
public virtual Task RunStartupTasks()
{
Resolve<ITaskManager>().AddTasks(GetExports<IScheduledTask>(false));
ConfigureAutorun();
ConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
return Task.FromResult(true);
}
/// <summary>
/// Configures the autorun.
/// </summary>
private void ConfigureAutorun()
{
try
{
ConfigureAutoRunAtStartup(ConfigurationManager.CommonConfiguration.RunAtStartup);
}
catch (Exception ex)
{
Logger.ErrorException("Error configuring autorun", ex);
}
}
/// <summary>
/// Gets the composable part assemblies.
/// </summary>
/// <returns>IEnumerable{Assembly}.</returns>
protected abstract IEnumerable<Assembly> GetComposablePartAssemblies();
/// <summary>
/// Gets the configuration manager.
/// </summary>
/// <returns>IConfigurationManager.</returns>
protected abstract IConfigurationManager GetConfigurationManager();
/// <summary>
/// Finds the parts.
/// </summary>
protected virtual void FindParts()
{
ConfigurationManager.AddParts(GetExports<IConfigurationFactory>());
Plugins = GetExports<IPlugin>().Select(LoadPlugin).Where(i => i != null).ToArray();
}
private IPlugin LoadPlugin(IPlugin plugin)
{
try
{
var assemblyPlugin = plugin as IPluginAssembly;
if (assemblyPlugin != null)
{
var assembly = plugin.GetType().Assembly;
var assemblyName = assembly.GetName();
var attribute = (GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
var assemblyId = new Guid(attribute.Value);
var assemblyFileName = assemblyName.Name + ".dll";
var assemblyFilePath = Path.Combine(ApplicationPaths.PluginsPath, assemblyFileName);
assemblyPlugin.SetAttributes(assemblyFilePath, assemblyFileName, assemblyName.Version, assemblyId);
}
var isFirstRun = !File.Exists(plugin.ConfigurationFilePath);
plugin.SetStartupInfo(isFirstRun, File.GetLastWriteTimeUtc, s => Directory.CreateDirectory(s));
}
catch (Exception ex)
{
Logger.ErrorException("Error loading plugin {0}", ex, plugin.GetType().FullName);
return null;
}
return plugin;
}
/// <summary>
/// Discovers the types.
/// </summary>
protected void DiscoverTypes()
{
FailedAssemblies.Clear();
var assemblies = GetComposablePartAssemblies().ToList();
foreach (var assembly in assemblies)
{
Logger.Info("Loading {0}", assembly.FullName);
}
AllConcreteTypes = assemblies
.SelectMany(GetTypes)
.Where(t => t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType)
.ToArray();
}
/// <summary>
/// Registers resources that classes will depend on
/// </summary>
/// <returns>Task.</returns>
protected virtual Task RegisterResources(IProgress<double> progress)
{
RegisterSingleInstance(ConfigurationManager);
RegisterSingleInstance<IApplicationHost>(this);
RegisterSingleInstance<IApplicationPaths>(ApplicationPaths);
TaskManager = new TaskManager(ApplicationPaths, JsonSerializer, LogManager.GetLogger("TaskManager"), FileSystemManager, SystemEvents);
RegisterSingleInstance(JsonSerializer);
RegisterSingleInstance(XmlSerializer);
RegisterSingleInstance(MemoryStreamFactory);
RegisterSingleInstance(SystemEvents);
RegisterSingleInstance(LogManager);
RegisterSingleInstance(Logger);
RegisterSingleInstance(TaskManager);
RegisterSingleInstance(EnvironmentInfo);
RegisterSingleInstance(FileSystemManager);
HttpClient = new HttpClientManager.HttpClientManager(ApplicationPaths, LogManager.GetLogger("HttpClient"), FileSystemManager, MemoryStreamFactory, GetDefaultUserAgent);
RegisterSingleInstance(HttpClient);
RegisterSingleInstance(NetworkManager);
IsoManager = new IsoManager();
RegisterSingleInstance(IsoManager);
ProcessFactory = new ProcessFactory();
RegisterSingleInstance(ProcessFactory);
TimerFactory = new TimerFactory();
RegisterSingleInstance(TimerFactory);
SocketFactory = new SocketFactory(LogManager.GetLogger("SocketFactory"));
RegisterSingleInstance(SocketFactory);
RegisterSingleInstance(CryptographyProvider);
return Task.FromResult(true);
}
private string GetDefaultUserAgent()
{
var name = FormatAttribute(Name);
return name + "/" + ApplicationVersion.ToString();
}
private string FormatAttribute(string str)
{
var arr = str.ToCharArray();
arr = Array.FindAll<char>(arr, (c => (char.IsLetterOrDigit(c)
|| char.IsWhiteSpace(c))));
var result = new string(arr);
if (string.IsNullOrWhiteSpace(result))
{
result = "Emby";
}
return result;
}
/// <summary>
/// Gets a list of types within an assembly
/// This will handle situations that would normally throw an exception - such as a type within the assembly that depends on some other non-existant reference
/// </summary>
/// <param name="assembly">The assembly.</param>
/// <returns>IEnumerable{Type}.</returns>
/// <exception cref="System.ArgumentNullException">assembly</exception>
protected List<Type> GetTypes(Assembly assembly)
{
if (assembly == null)
{
return new List<Type>();
}
try
{
// This null checking really shouldn't be needed but adding it due to some
// unhandled exceptions in mono 5.0 that are a little hard to hunt down
var types = assembly.GetTypes() ?? new Type[] { };
return types.Where(t => t != null).ToList();
}
catch (ReflectionTypeLoadException ex)
{
if (ex.LoaderExceptions != null)
{
foreach (var loaderException in ex.LoaderExceptions)
{
if (loaderException != null)
{
Logger.Error("LoaderException: " + loaderException.Message);
}
}
}
// If it fails we can still get a list of the Types it was able to resolve
var types = ex.Types ?? new Type[] { };
return types.Where(t => t != null).ToList();
}
catch (Exception ex)
{
Logger.ErrorException("Error loading types from assembly", ex);
return new List<Type>();
}
}
/// <summary>
/// Creates an instance of type and resolves all constructor dependancies
/// </summary>
/// <param name="type">The type.</param>
/// <returns>System.Object.</returns>
public object CreateInstance(Type type)
{
try
{
return Container.GetInstance(type);
}
catch (Exception ex)
{
Logger.ErrorException("Error creating {0}", ex, type.FullName);
throw;
}
}
/// <summary>
/// Creates the instance safe.
/// </summary>
/// <param name="type">The type.</param>
/// <returns>System.Object.</returns>
protected object CreateInstanceSafe(Type type)
{
try
{
return Container.GetInstance(type);
}
catch (Exception ex)
{
Logger.ErrorException("Error creating {0}", ex, type.FullName);
// Don't blow up in release mode
return null;
}
}
/// <summary>
/// Registers the specified obj.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="obj">The obj.</param>
/// <param name="manageLifetime">if set to <c>true</c> [manage lifetime].</param>
protected void RegisterSingleInstance<T>(T obj, bool manageLifetime = true)
where T : class
{
Container.RegisterSingleton(obj);
if (manageLifetime)
{
var disposable = obj as IDisposable;
if (disposable != null)
{
DisposableParts.Add(disposable);
}
}
}
/// <summary>
/// Registers the single instance.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="func">The func.</param>
protected void RegisterSingleInstance<T>(Func<T> func)
where T : class
{
Container.RegisterSingleton(func);
}
/// <summary>
/// Resolves this instance.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>``0.</returns>
public T Resolve<T>()
{
return (T)Container.GetRegistration(typeof(T), true).GetInstance();
}
/// <summary>
/// Resolves this instance.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>``0.</returns>
public T TryResolve<T>()
{
var result = Container.GetRegistration(typeof(T), false);
if (result == null)
{
return default(T);
}
return (T)result.GetInstance();
}
/// <summary>
/// Loads the assembly.
/// </summary>
/// <param name="file">The file.</param>
/// <returns>Assembly.</returns>
protected Assembly LoadAssembly(string file)
{
try
{
return Assembly.Load(File.ReadAllBytes(file));
}
catch (Exception ex)
{
FailedAssemblies.Add(file);
Logger.ErrorException("Error loading assembly {0}", ex, file);
return null;
}
}
/// <summary>
/// Gets the export types.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns>IEnumerable{Type}.</returns>
public IEnumerable<Type> GetExportTypes<T>()
{
var currentType = typeof(T);
return AllConcreteTypes.Where(currentType.IsAssignableFrom);
}
/// <summary>
/// Gets the exports.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="manageLiftime">if set to <c>true</c> [manage liftime].</param>
/// <returns>IEnumerable{``0}.</returns>
public IEnumerable<T> GetExports<T>(bool manageLiftime = true)
{
var parts = GetExportTypes<T>()
.Select(CreateInstanceSafe)
.Where(i => i != null)
.Cast<T>()
.ToList();
if (manageLiftime)
{
lock (DisposableParts)
{
DisposableParts.AddRange(parts.OfType<IDisposable>());
}
}
return parts;
}
/// <summary>
/// Gets the application version.
/// </summary>
/// <value>The application version.</value>
public abstract Version ApplicationVersion { get; }
/// <summary>
/// Handles the ConfigurationUpdated event of the ConfigurationManager control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
/// <exception cref="System.NotImplementedException"></exception>
protected virtual void OnConfigurationUpdated(object sender, EventArgs e)
{
ConfigureAutorun();
}
protected abstract void ConfigureAutoRunAtStartup(bool autorun);
/// <summary>
/// Removes the plugin.
/// </summary>
/// <param name="plugin">The plugin.</param>
public void RemovePlugin(IPlugin plugin)
{
var list = Plugins.ToList();
list.Remove(plugin);
Plugins = list.ToArray();
}
/// <summary>
/// Gets a value indicating whether this instance can self restart.
/// </summary>
/// <value><c>true</c> if this instance can self restart; otherwise, <c>false</c>.</value>
public abstract bool CanSelfRestart { get; }
/// <summary>
/// Notifies that the kernel that a change has been made that requires a restart
/// </summary>
public void NotifyPendingRestart()
{
Logger.Info("App needs to be restarted.");
var changed = !HasPendingRestart;
HasPendingRestart = true;
if (changed)
{
EventHelper.QueueEventIfNotNull(HasPendingRestartChanged, this, EventArgs.Empty, Logger);
}
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
Dispose(true);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool dispose)
{
if (dispose)
{
var type = GetType();
Logger.Info("Disposing " + type.Name);
var parts = DisposableParts.Distinct().Where(i => i.GetType() != type).ToList();
DisposableParts.Clear();
foreach (var part in parts)
{
Logger.Info("Disposing " + part.GetType().Name);
try
{
part.Dispose();
}
catch (Exception ex)
{
Logger.ErrorException("Error disposing {0}", ex, part.GetType().Name);
}
}
}
}
/// <summary>
/// Restarts this instance.
/// </summary>
public abstract Task Restart();
/// <summary>
/// Gets or sets a value indicating whether this instance can self update.
/// </summary>
/// <value><c>true</c> if this instance can self update; otherwise, <c>false</c>.</value>
public virtual bool CanSelfUpdate
{
get
{
return false;
}
}
/// <summary>
/// Checks for update.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task{CheckForUpdateResult}.</returns>
public abstract Task<CheckForUpdateResult> CheckForApplicationUpdate(CancellationToken cancellationToken,
IProgress<double> progress);
/// <summary>
/// Updates the application.
/// </summary>
/// <param name="package">The package that contains the update</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="progress">The progress.</param>
/// <returns>Task.</returns>
public abstract Task UpdateApplication(PackageVersionInfo package, CancellationToken cancellationToken,
IProgress<double> progress);
/// <summary>
/// Shuts down.
/// </summary>
public abstract Task Shutdown();
/// <summary>
/// Called when [application updated].
/// </summary>
/// <param name="package">The package.</param>
protected void OnApplicationUpdated(PackageVersionInfo package)
{
Logger.Info("Application has been updated to version {0}", package.versionStr);
EventHelper.FireEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<PackageVersionInfo>
{
Argument = package
}, Logger);
NotifyPendingRestart();
}
}
}

@ -1,452 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1E37A338-9F57-4B70-BD6D-BB9C591E319B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Emby.Common.Implementations</RootNamespace>
<AssemblyName>Emby.Common.Implementations</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SimpleInjector, Version=4.0.8.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.4.0.8\lib\net45\SimpleInjector.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="Archiving\ZipClient.cs" />
<Compile Include="BaseApplicationHost.cs" />
<Compile Include="Cryptography\CryptographyProvider.cs" />
<Compile Include="Devices\DeviceId.cs" />
<Compile Include="Diagnostics\CommonProcess.cs" />
<Compile Include="Diagnostics\ProcessFactory.cs" />
<Compile Include="EnvironmentInfo\EnvironmentInfo.cs" />
<Compile Include="HttpClientManager\HttpClientInfo.cs" />
<Compile Include="HttpClientManager\HttpClientManager.cs" />
<Compile Include="IO\IsoManager.cs" />
<Compile Include="IO\LnkShortcutHandler.cs" />
<Compile Include="IO\ManagedFileSystem.cs" />
<Compile Include="IO\ProgressStream.cs" />
<Compile Include="IO\SharpCifsFileSystem.cs" />
<Compile Include="IO\SharpCifs\Config.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcBind.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcBinding.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcConstants.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcError.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcException.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcMessage.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcPipeHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcSecurityProvider.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\LsaPolicyHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Lsarpc.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\LsarSidArrayX.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcDfsRootEnum.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcEnumerateAliasesInDomain.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcGetMembersInAlias.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcLookupSids.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcLsarOpenPolicy2.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcQueryInformationPolicy.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrConnect2.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrConnect4.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrOpenAlias.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrOpenDomain.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcShareEnum.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcShareGetInfo.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Netdfs.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Samr.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\SamrAliasHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\SamrDomainHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\SamrPolicyHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Srvsvc.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrBuffer.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrException.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrHyper.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrLong.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrObject.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrShort.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrSmall.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Rpc.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\UnicodeString.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\UUID.cs" />
<Compile Include="IO\SharpCifs\Netbios\Lmhosts.cs" />
<Compile Include="IO\SharpCifs\Netbios\Name.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameQueryRequest.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameQueryResponse.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameServiceClient.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameServicePacket.cs" />
<Compile Include="IO\SharpCifs\Netbios\NbtAddress.cs" />
<Compile Include="IO\SharpCifs\Netbios\NbtException.cs" />
<Compile Include="IO\SharpCifs\Netbios\NodeStatusRequest.cs" />
<Compile Include="IO\SharpCifs\Netbios\NodeStatusResponse.cs" />
<Compile Include="IO\SharpCifs\Netbios\SessionRequestPacket.cs" />
<Compile Include="IO\SharpCifs\Netbios\SessionRetargetResponsePacket.cs" />
<Compile Include="IO\SharpCifs\Netbios\SessionServicePacket.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\NtlmFlags.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\NtlmMessage.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\Type1Message.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\Type2Message.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\Type3Message.cs" />
<Compile Include="IO\SharpCifs\Smb\ACE.cs" />
<Compile Include="IO\SharpCifs\Smb\AllocInfo.cs" />
<Compile Include="IO\SharpCifs\Smb\AndXServerMessageBlock.cs" />
<Compile Include="IO\SharpCifs\Smb\BufferCache.cs" />
<Compile Include="IO\SharpCifs\Smb\Dfs.cs" />
<Compile Include="IO\SharpCifs\Smb\DfsReferral.cs" />
<Compile Include="IO\SharpCifs\Smb\DosError.cs" />
<Compile Include="IO\SharpCifs\Smb\DosFileFilter.cs" />
<Compile Include="IO\SharpCifs\Smb\FileEntry.cs" />
<Compile Include="IO\SharpCifs\Smb\IInfo.cs" />
<Compile Include="IO\SharpCifs\Smb\NetServerEnum2.cs" />
<Compile Include="IO\SharpCifs\Smb\NetServerEnum2Response.cs" />
<Compile Include="IO\SharpCifs\Smb\NetShareEnum.cs" />
<Compile Include="IO\SharpCifs\Smb\NetShareEnumResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmAuthenticator.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmChallenge.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmContext.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmPasswordAuthentication.cs" />
<Compile Include="IO\SharpCifs\Smb\NtStatus.cs" />
<Compile Include="IO\SharpCifs\Smb\NtTransQuerySecurityDesc.cs" />
<Compile Include="IO\SharpCifs\Smb\NtTransQuerySecurityDescResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Principal.cs" />
<Compile Include="IO\SharpCifs\Smb\SecurityDescriptor.cs" />
<Compile Include="IO\SharpCifs\Smb\ServerMessageBlock.cs" />
<Compile Include="IO\SharpCifs\Smb\SID.cs" />
<Compile Include="IO\SharpCifs\Smb\SigningDigest.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbAuthException.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComBlankResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComClose.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComCreateDirectory.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComDelete.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComDeleteDirectory.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComFindClose2.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComLogoffAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNegotiate.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNegotiateResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNTCreateAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNTCreateAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNtTransaction.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNtTransactionResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComOpenAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComOpenAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComQueryInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComQueryInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComReadAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComReadAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComRename.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComSessionSetupAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComSessionSetupAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTransaction.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTransactionResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTreeConnectAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTreeConnectAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTreeDisconnect.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWrite.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWriteAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWriteAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWriteResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbConstants.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbException.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFile.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileExtensions.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileFilter.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileInputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFilenameFilter.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileOutputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbRandomAccessFile.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbSession.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbShareInfo.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbTransport.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbTree.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2FindFirst2.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2FindFirst2Response.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2FindNext2.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2GetDfsReferral.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2GetDfsReferralResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryFSInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryFSInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryPathInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryPathInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2SetFileInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2SetFileInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransactNamedPipeInputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\TransactNamedPipeOutputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\TransCallNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransCallNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransPeekNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransPeekNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransTransactNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransTransactNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransWaitNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransWaitNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\WinError.cs" />
<Compile Include="IO\SharpCifs\UniAddress.cs" />
<Compile Include="IO\SharpCifs\Util\Base64.cs" />
<Compile Include="IO\SharpCifs\Util\DES.cs" />
<Compile Include="IO\SharpCifs\Util\Encdec.cs" />
<Compile Include="IO\SharpCifs\Util\Hexdump.cs" />
<Compile Include="IO\SharpCifs\Util\HMACT64.cs" />
<Compile Include="IO\SharpCifs\Util\LogStream.cs" />
<Compile Include="IO\SharpCifs\Util\MD4.cs" />
<Compile Include="IO\SharpCifs\Util\RC4.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\AbstractMap.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Arrays.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\BufferedReader.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\BufferedWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\CharBuffer.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\CharSequence.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Collections.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ConcurrentHashMap.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\DateFormat.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\EnumeratorWrapper.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Exceptions.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Extensions.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FilePath.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileReader.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FilterInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FilterOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Hashtable.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\HttpURLConnection.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ICallable.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IConcurrentMap.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IExecutor.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IFilenameFilter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IFuture.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\InputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\InputStreamReader.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IPrivilegedAction.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IRunnable.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Iterator.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\LinkageError.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Matcher.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\MD5.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\MD5Managed.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\MessageDigest.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\NetworkStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ObjectInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ObjectOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\OutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\OutputStreamWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\PipedInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\PipedOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\PrintWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Properties.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\RandomAccessFile.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ReentrantLock.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Reference.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Runtime.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\SimpleDateFormat.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\SocketEx.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\StringTokenizer.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\SynchronizedList.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Thread.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ThreadFactory.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ThreadPoolExecutor.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\WrappedSystemStream.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\Request.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\Response.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\Transport.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\TransportException.cs" />
<Compile Include="Logging\NLogger.cs" />
<Compile Include="Logging\NlogManager.cs" />
<Compile Include="Networking\NetworkManager.cs" />
<Compile Include="Net\DisposableManagedObjectBase.cs" />
<Compile Include="Net\NetAcceptSocket.cs" />
<Compile Include="Net\SocketAcceptor.cs" />
<Compile Include="Net\SocketFactory.cs" />
<Compile Include="Net\UdpSocket.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reflection\AssemblyInfo.cs" />
<Compile Include="ScheduledTasks\DailyTrigger.cs" />
<Compile Include="ScheduledTasks\IntervalTrigger.cs" />
<Compile Include="ScheduledTasks\ScheduledTaskWorker.cs" />
<Compile Include="ScheduledTasks\StartupTrigger.cs" />
<Compile Include="ScheduledTasks\SystemEventTrigger.cs" />
<Compile Include="ScheduledTasks\TaskManager.cs" />
<Compile Include="ScheduledTasks\Tasks\DeleteCacheFileTask.cs" />
<Compile Include="ScheduledTasks\Tasks\DeleteLogFileTask.cs" />
<Compile Include="ScheduledTasks\Tasks\ReloadLoggerFileTask.cs" />
<Compile Include="ScheduledTasks\WeeklyTrigger.cs" />
<Compile Include="Serialization\JsonSerializer.cs" />
<Compile Include="Serialization\XmlSerializer.cs" />
<Compile Include="TextEncoding\NLangDetect\Detector.cs" />
<Compile Include="TextEncoding\NLangDetect\DetectorFactory.cs" />
<Compile Include="TextEncoding\NLangDetect\ErrorCode.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\CharExtensions.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\RandomExtensions.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\StringExtensions.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\UnicodeBlock.cs" />
<Compile Include="TextEncoding\NLangDetect\GenProfile.cs" />
<Compile Include="TextEncoding\NLangDetect\InternalException.cs" />
<Compile Include="TextEncoding\NLangDetect\Language.cs" />
<Compile Include="TextEncoding\NLangDetect\LanguageDetector.cs" />
<Compile Include="TextEncoding\NLangDetect\NLangDetectException.cs" />
<Compile Include="TextEncoding\NLangDetect\ProbVector.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\LangProfile.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\Messages.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\NGram.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\TagExtractor.cs" />
<Compile Include="TextEncoding\TextEncoding.cs" />
<Compile Include="TextEncoding\TextEncodingDetect.cs" />
<Compile Include="TextEncoding\UniversalDetector\CharsetDetector.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\Big5Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\BitPackage.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\CharDistributionAnalyser.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\CharsetProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\Charsets.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\CodingStateMachine.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EscCharsetProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EscSM.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EUCJPProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EUCKRProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EUCTWProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\GB18030Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\HebrewProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\JapaneseContextAnalyser.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangBulgarianModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangCyrillicModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangGreekModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangHebrewModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangHungarianModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangThaiModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\Latin1Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\MBCSGroupProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\MBCSSM.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SBCharsetProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SBCSGroupProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SequenceModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SJISProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SMModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\UniversalDetector.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\UTF8Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\DetectionConfidence.cs" />
<Compile Include="TextEncoding\UniversalDetector\ICharsetDetector.cs" />
<Compile Include="Threading\CommonTimer.cs" />
<Compile Include="Threading\TimerFactory.cs" />
<Compile Include="Xml\XmlReaderSettingsFactory.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
<Name>MediaBrowser.Common</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
<Name>MediaBrowser.Model</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="TextEncoding\NLangDetect\Profiles\afr" />
<None Include="TextEncoding\NLangDetect\Profiles\ara" />
<None Include="TextEncoding\NLangDetect\Profiles\bul" />
<None Include="TextEncoding\NLangDetect\Profiles\ben" />
<None Include="TextEncoding\NLangDetect\Profiles\ces" />
<None Include="TextEncoding\NLangDetect\Profiles\dan" />
<None Include="TextEncoding\NLangDetect\Profiles\deu" />
<None Include="TextEncoding\NLangDetect\Profiles\ell" />
<None Include="TextEncoding\NLangDetect\Profiles\eng" />
<None Include="TextEncoding\NLangDetect\Profiles\spa" />
<None Include="TextEncoding\NLangDetect\Profiles\est" />
<None Include="TextEncoding\NLangDetect\Profiles\fas" />
<None Include="TextEncoding\NLangDetect\Profiles\fin" />
<None Include="TextEncoding\NLangDetect\Profiles\fra" />
<None Include="TextEncoding\NLangDetect\Profiles\guj" />
<None Include="TextEncoding\NLangDetect\Profiles\heb" />
<None Include="TextEncoding\NLangDetect\Profiles\hin" />
<None Include="TextEncoding\NLangDetect\Profiles\hrv" />
<None Include="TextEncoding\NLangDetect\Profiles\hun" />
<None Include="TextEncoding\NLangDetect\Profiles\ind" />
<None Include="TextEncoding\NLangDetect\Profiles\ita" />
<None Include="TextEncoding\NLangDetect\Profiles\jpn" />
<None Include="TextEncoding\NLangDetect\Profiles\kan" />
<None Include="TextEncoding\NLangDetect\Profiles\kor" />
<None Include="TextEncoding\NLangDetect\Profiles\lit" />
<None Include="TextEncoding\NLangDetect\Profiles\lav" />
<None Include="TextEncoding\NLangDetect\Profiles\mkd" />
<None Include="TextEncoding\NLangDetect\Profiles\mal" />
<None Include="TextEncoding\NLangDetect\Profiles\mar" />
<None Include="TextEncoding\NLangDetect\Profiles\nep" />
<None Include="TextEncoding\NLangDetect\Profiles\nld" />
<None Include="TextEncoding\NLangDetect\Profiles\nor" />
<None Include="TextEncoding\NLangDetect\Profiles\pan" />
<None Include="TextEncoding\NLangDetect\Profiles\pol" />
<None Include="TextEncoding\NLangDetect\Profiles\por" />
<None Include="TextEncoding\NLangDetect\Profiles\ron" />
<None Include="TextEncoding\NLangDetect\Profiles\rus" />
<None Include="TextEncoding\NLangDetect\Profiles\slk" />
<None Include="TextEncoding\NLangDetect\Profiles\slv" />
<None Include="TextEncoding\NLangDetect\Profiles\som" />
<None Include="TextEncoding\NLangDetect\Profiles\sqi" />
<None Include="TextEncoding\NLangDetect\Profiles\swe" />
<None Include="TextEncoding\NLangDetect\Profiles\swa" />
<None Include="TextEncoding\NLangDetect\Profiles\tam" />
<None Include="TextEncoding\NLangDetect\Profiles\tel" />
<None Include="TextEncoding\NLangDetect\Profiles\tha" />
<None Include="TextEncoding\NLangDetect\Profiles\tgl" />
<None Include="TextEncoding\NLangDetect\Profiles\tur" />
<None Include="TextEncoding\NLangDetect\Profiles\ukr" />
<None Include="TextEncoding\NLangDetect\Profiles\urd" />
<None Include="TextEncoding\NLangDetect\Profiles\vie" />
<EmbeddedResource Include="TextEncoding\NLangDetect\Profiles\zh-cn" />
<EmbeddedResource Include="TextEncoding\NLangDetect\Profiles\zh-tw" />
<EmbeddedResource Include="TextEncoding\NLangDetect\Utils\messages.properties" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

@ -1,224 +0,0 @@
using MediaBrowser.Model.Logging;
using System;
using System.Text;
namespace Emby.Common.Implementations.Logging
{
/// <summary>
/// Class NLogger
/// </summary>
public class NLogger : ILogger
{
/// <summary>
/// The _logger
/// </summary>
private readonly NLog.Logger _logger;
private readonly ILogManager _logManager;
/// <summary>
/// The _lock object
/// </summary>
private static readonly object LockObject = new object();
/// <summary>
/// Initializes a new instance of the <see cref="NLogger" /> class.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="logManager">The log manager.</param>
public NLogger(string name, ILogManager logManager)
{
_logManager = logManager;
lock (LockObject)
{
_logger = NLog.LogManager.GetLogger(name);
}
}
/// <summary>
/// Infoes the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
public void Info(string message, params object[] paramList)
{
_logger.Info(message, paramList);
}
/// <summary>
/// Errors the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
public void Error(string message, params object[] paramList)
{
_logger.Error(message, paramList);
}
/// <summary>
/// Warns the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
public void Warn(string message, params object[] paramList)
{
_logger.Warn(message, paramList);
}
/// <summary>
/// Debugs the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
public void Debug(string message, params object[] paramList)
{
if (_logManager.LogSeverity == LogSeverity.Info)
{
return;
}
_logger.Debug(message, paramList);
}
/// <summary>
/// Logs the exception.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="exception">The exception.</param>
/// <param name="paramList">The param list.</param>
/// <exception cref="System.NotImplementedException"></exception>
public void ErrorException(string message, Exception exception, params object[] paramList)
{
LogException(LogSeverity.Error, message, exception, paramList);
}
/// <summary>
/// Logs the exception.
/// </summary>
/// <param name="level">The level.</param>
/// <param name="message">The message.</param>
/// <param name="exception">The exception.</param>
/// <param name="paramList">The param list.</param>
private void LogException(LogSeverity level, string message, Exception exception, params object[] paramList)
{
message = FormatMessage(message, paramList).Replace(Environment.NewLine, ". ");
var messageText = LogHelper.GetLogMessage(exception);
var prefix = _logManager.ExceptionMessagePrefix;
if (!string.IsNullOrWhiteSpace(prefix))
{
messageText.Insert(0, prefix);
}
LogMultiline(message, level, messageText);
}
/// <summary>
/// Formats the message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
/// <returns>System.String.</returns>
private static string FormatMessage(string message, params object[] paramList)
{
if (paramList != null)
{
for (var i = 0; i < paramList.Length; i++)
{
var obj = paramList[i];
message = message.Replace("{" + i + "}", (obj == null ? "null" : obj.ToString()));
}
}
return message;
}
/// <summary>
/// Logs the multiline.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="severity">The severity.</param>
/// <param name="additionalContent">Content of the additional.</param>
public void LogMultiline(string message, LogSeverity severity, StringBuilder additionalContent)
{
if (severity == LogSeverity.Debug && _logManager.LogSeverity == LogSeverity.Info)
{
return;
}
additionalContent.Insert(0, message + Environment.NewLine);
const char tabChar = '\t';
var text = additionalContent.ToString()
.Replace(Environment.NewLine, Environment.NewLine + tabChar)
.TrimEnd(tabChar);
if (text.EndsWith(Environment.NewLine))
{
text = text.Substring(0, text.LastIndexOf(Environment.NewLine, StringComparison.OrdinalIgnoreCase));
}
_logger.Log(GetLogLevel(severity), text);
}
/// <summary>
/// Gets the log level.
/// </summary>
/// <param name="severity">The severity.</param>
/// <returns>NLog.LogLevel.</returns>
private NLog.LogLevel GetLogLevel(LogSeverity severity)
{
switch (severity)
{
case LogSeverity.Debug:
return NLog.LogLevel.Debug;
case LogSeverity.Error:
return NLog.LogLevel.Error;
case LogSeverity.Warn:
return NLog.LogLevel.Warn;
case LogSeverity.Fatal:
return NLog.LogLevel.Fatal;
case LogSeverity.Info:
return NLog.LogLevel.Info;
default:
throw new ArgumentException("Unknown LogSeverity: " + severity.ToString());
}
}
/// <summary>
/// Logs the specified severity.
/// </summary>
/// <param name="severity">The severity.</param>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
public void Log(LogSeverity severity, string message, params object[] paramList)
{
_logger.Log(GetLogLevel(severity), message, paramList);
}
/// <summary>
/// Fatals the specified message.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="paramList">The param list.</param>
public void Fatal(string message, params object[] paramList)
{
_logger.Fatal(message, paramList);
}
/// <summary>
/// Fatals the exception.
/// </summary>
/// <param name="message">The message.</param>
/// <param name="exception">The exception.</param>
/// <param name="paramList">The param list.</param>
public void FatalException(string message, Exception exception, params object[] paramList)
{
LogException(LogSeverity.Fatal, message, exception, paramList);
}
}
}

@ -1,554 +0,0 @@
using System;
using System.IO;
using System.Linq;
using System.Xml;
using NLog;
using NLog.Config;
using NLog.Filters;
using NLog.Targets;
using NLog.Targets.Wrappers;
using MediaBrowser.Model.Logging;
namespace Emby.Common.Implementations.Logging
{
/// <summary>
/// Class NlogManager
/// </summary>
public class NlogManager : ILogManager
{
#region Private Fields
private LogSeverity _severity = LogSeverity.Debug;
/// <summary>
/// Gets or sets the log directory.
/// </summary>
/// <value>The log directory.</value>
private readonly string LogDirectory;
/// <summary>
/// Gets or sets the log file prefix.
/// </summary>
/// <value>The log file prefix.</value>
private readonly string LogFilePrefix;
#endregion
#region Event Declarations
/// <summary>
/// Occurs when [logger loaded].
/// </summary>
public event EventHandler LoggerLoaded;
#endregion
#region Public Properties
/// <summary>
/// Gets the log file path.
/// </summary>
/// <value>The log file path.</value>
public string LogFilePath { get; private set; }
/// <summary>
/// Gets or sets the exception message prefix.
/// </summary>
/// <value>The exception message prefix.</value>
public string ExceptionMessagePrefix { get; set; }
public string NLogConfigurationFilePath { get; set; }
public LogSeverity LogSeverity
{
get
{
return _severity;
}
set
{
DebugFileWriter(
LogDirectory, String.Format(
"SET LogSeverity, _severity = [{0}], value = [{1}]",
_severity.ToString(),
value.ToString()
));
var changed = _severity != value;
_severity = value;
if (changed)
{
UpdateLogLevel(value);
}
}
}
#endregion
#region Constructor(s)
/// <summary>
/// Initializes a new instance of the <see cref="NlogManager" /> class.
/// </summary>
/// <param name="logDirectory">The log directory.</param>
/// <param name="logFileNamePrefix">The log file name prefix.</param>
public NlogManager(string logDirectory, string logFileNamePrefix)
{
DebugFileWriter(
logDirectory, String.Format(
"NlogManager constructor called, logDirectory is [{0}], logFileNamePrefix is [{1}], _severity is [{2}].",
logDirectory,
logFileNamePrefix,
_severity.ToString()
));
LogDirectory = logDirectory;
LogFilePrefix = logFileNamePrefix;
LogManager.Configuration = new LoggingConfiguration();
}
/// <summary>
/// Initializes a new instance of the <see cref="NlogManager" /> class.
/// </summary>
/// <param name="logDirectory">The log directory.</param>
/// <param name="logFileNamePrefix">The log file name prefix.</param>
public NlogManager(string logDirectory, string logFileNamePrefix, LogSeverity initialSeverity) : this(logDirectory, logFileNamePrefix)
{
_severity = initialSeverity;
DebugFileWriter(
logDirectory, String.Format(
"NlogManager constructor called, logDirectory is [{0}], logFileNamePrefix is [{1}], _severity is [{2}].",
logDirectory,
logFileNamePrefix,
_severity.ToString()
));
}
#endregion
#region Private Methods
/// <summary>
/// Adds the file target.
/// </summary>
/// <param name="path">The path.</param>
/// <param name="level">The level.</param>
private void AddFileTarget(string path, LogSeverity level)
{
DebugFileWriter(
LogDirectory, String.Format(
"AddFileTarget called, path = [{0}], level = [{1}].",
path,
level.ToString()
));
RemoveTarget("ApplicationLogFileWrapper");
// https://github.com/NLog/NLog/wiki/Performance
var wrapper = new AsyncTargetWrapper
{
OverflowAction = AsyncTargetWrapperOverflowAction.Block,
QueueLimit = 10000,
BatchSize = 500,
TimeToSleepBetweenBatches = 50
};
wrapper.Name = "ApplicationLogFileWrapper";
var logFile = new FileTarget
{
FileName = path,
Layout = "${longdate} ${level} ${logger}: ${message}",
KeepFileOpen = true,
ConcurrentWrites = false
};
logFile.Name = "ApplicationLogFile";
wrapper.WrappedTarget = logFile;
AddLogTarget(wrapper, level);
}
/// <summary>
/// Gets the log level.
/// </summary>
/// <param name="severity">The severity.</param>
/// <returns>LogLevel.</returns>
/// <exception cref="System.ArgumentException">Unrecognized LogSeverity</exception>
private LogLevel GetLogLevel(LogSeverity severity)
{
switch (severity)
{
case LogSeverity.Debug:
return LogLevel.Debug;
case LogSeverity.Error:
return LogLevel.Error;
case LogSeverity.Fatal:
return LogLevel.Fatal;
case LogSeverity.Info:
return LogLevel.Info;
case LogSeverity.Warn:
return LogLevel.Warn;
default:
throw new ArgumentException("Unrecognized LogSeverity");
}
}
private void UpdateLogLevel(LogSeverity newLevel)
{
DebugFileWriter(
LogDirectory, String.Format(
"UpdateLogLevel called, newLevel = [{0}].",
newLevel.ToString()
));
var level = GetLogLevel(newLevel);
var rules = LogManager.Configuration.LoggingRules;
foreach (var rule in rules)
{
if (!rule.IsLoggingEnabledForLevel(level))
{
rule.EnableLoggingForLevel(level);
}
foreach (var lev in rule.Levels.ToArray())
{
if (lev < level)
{
rule.DisableLoggingForLevel(lev);
}
}
}
}
private void AddCustomFilters(string defaultLoggerNamePattern, LoggingRule defaultRule)
{
DebugFileWriter(
LogDirectory, String.Format(
"AddCustomFilters called, defaultLoggerNamePattern = [{0}], defaultRule.LoggerNamePattern = [{1}].",
defaultLoggerNamePattern,
defaultRule.LoggerNamePattern
));
try
{
var customConfig = new NLog.Config.XmlLoggingConfiguration(NLogConfigurationFilePath);
DebugFileWriter(
LogDirectory, String.Format(
"Custom Configuration Loaded, Rule Count = [{0}].",
customConfig.LoggingRules.Count.ToString()
));
foreach (var customRule in customConfig.LoggingRules)
{
DebugFileWriter(
LogDirectory, String.Format(
"Read Custom Rule, LoggerNamePattern = [{0}], Targets = [{1}].",
customRule.LoggerNamePattern,
string.Join(",", customRule.Targets.Select(x => x.Name).ToList())
));
if (customRule.LoggerNamePattern.Equals(defaultLoggerNamePattern))
{
if (customRule.Targets.Any((arg) => arg.Name.Equals(defaultRule.Targets.First().Name)))
{
DebugFileWriter(
LogDirectory, String.Format(
"Custom rule filters can be applied to this target, Filter Count = [{0}].",
customRule.Filters.Count.ToString()
));
foreach (ConditionBasedFilter customFilter in customRule.Filters)
{
DebugFileWriter(
LogDirectory, String.Format(
"Read Custom Filter, Filter = [{0}], Action = [{1}], Type = [{2}].",
customFilter.Condition.ToString(),
customFilter.Action.ToString(),
customFilter.GetType().ToString()
));
defaultRule.Filters.Add(customFilter);
}
}
else
{
DebugFileWriter(
LogDirectory, String.Format(
"Ignoring custom rule as [Target] does not match."
));
}
}
else
{
DebugFileWriter(
LogDirectory, String.Format(
"Ignoring custom rule as [LoggerNamePattern] does not match."
));
}
}
}
catch (Exception ex)
{
// Intentionally do nothing, prevent issues affecting normal execution.
DebugFileWriter(
LogDirectory, String.Format(
"Exception in AddCustomFilters, ex.Message = [{0}].",
ex.Message
)
);
}
}
#endregion
#region Public Methods
/// <summary>
/// Gets the logger.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>ILogger.</returns>
public MediaBrowser.Model.Logging.ILogger GetLogger(string name)
{
DebugFileWriter(
LogDirectory, String.Format(
"GetLogger called, name = [{0}].",
name
));
return new NLogger(name, this);
}
/// <summary>
/// Adds the log target.
/// </summary>
/// <param name="target">The target.</param>
/// <param name="level">The level.</param>
public void AddLogTarget(Target target, LogSeverity level)
{
DebugFileWriter(
LogDirectory, String.Format(
"AddLogTarget called, target.Name = [{0}], level = [{1}].",
target.Name,
level.ToString()
));
string loggerNamePattern = "*";
var config = LogManager.Configuration;
var rule = new LoggingRule(loggerNamePattern, GetLogLevel(level), target);
config.AddTarget(target.Name, target);
AddCustomFilters(loggerNamePattern, rule);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
}
/// <summary>
/// Removes the target.
/// </summary>
/// <param name="name">The name.</param>
public void RemoveTarget(string name)
{
DebugFileWriter(
LogDirectory, String.Format(
"RemoveTarget called, name = [{0}].",
name
));
var config = LogManager.Configuration;
var target = config.FindTargetByName(name);
if (target != null)
{
foreach (var rule in config.LoggingRules.ToList())
{
var contains = rule.Targets.Contains(target);
rule.Targets.Remove(target);
if (contains)
{
config.LoggingRules.Remove(rule);
}
}
config.RemoveTarget(name);
LogManager.Configuration = config;
}
}
public void AddConsoleOutput()
{
DebugFileWriter(
LogDirectory, String.Format(
"AddConsoleOutput called."
));
RemoveTarget("ConsoleTargetWrapper");
var wrapper = new AsyncTargetWrapper();
wrapper.Name = "ConsoleTargetWrapper";
var target = new ConsoleTarget()
{
Layout = "${level}, ${logger}, ${message}",
Error = false
};
target.Name = "ConsoleTarget";
wrapper.WrappedTarget = target;
AddLogTarget(wrapper, LogSeverity);
}
public void RemoveConsoleOutput()
{
DebugFileWriter(
LogDirectory, String.Format(
"RemoveConsoleOutput called."
));
RemoveTarget("ConsoleTargetWrapper");
}
/// <summary>
/// Reloads the logger, maintaining the current log level.
/// </summary>
public void ReloadLogger()
{
ReloadLogger(LogSeverity);
}
/// <summary>
/// Reloads the logger, using the specified logging level.
/// </summary>
/// <param name="level">The level.</param>
public void ReloadLogger(LogSeverity level)
{
DebugFileWriter(
LogDirectory, String.Format(
"ReloadLogger called, level = [{0}], LogFilePath (existing) = [{1}].",
level.ToString(),
LogFilePath
));
LogFilePath = Path.Combine(LogDirectory, LogFilePrefix + "-" + decimal.Floor(DateTime.Now.Ticks / 10000000) + ".txt");
Directory.CreateDirectory(Path.GetDirectoryName(LogFilePath));
AddFileTarget(LogFilePath, level);
LogSeverity = level;
if (LoggerLoaded != null)
{
try
{
DebugFileWriter(
LogDirectory, String.Format(
"ReloadLogger called, raised event LoggerLoaded."
));
LoggerLoaded(this, EventArgs.Empty);
}
catch (Exception ex)
{
GetLogger("Logger").ErrorException("Error in LoggerLoaded event", ex);
}
}
}
/// <summary>
/// Flushes this instance.
/// </summary>
public void Flush()
{
DebugFileWriter(
LogDirectory, String.Format(
"Flush called."
));
LogManager.Flush();
}
#endregion
#region Conditional Debug Methods
/// <summary>
/// DEBUG: Standalone method to write out debug to assist with logger development/troubleshooting.
/// <list type="bullet">
/// <item><description>The output file will be written to the server's log directory.</description></item>
/// <item><description>Calls to the method are safe and will never throw any exceptions.</description></item>
/// <item><description>Method calls will be omitted unless the library is compiled with DEBUG defined.</description></item>
/// </list>
/// </summary>
private static void DebugFileWriter(string logDirectory, string message)
{
#if DEBUG
try
{
System.IO.File.AppendAllText(
Path.Combine(logDirectory, "NlogManager.txt"),
String.Format(
"{0} : {1}{2}",
System.DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"),
message,
System.Environment.NewLine
)
);
}
catch (Exception ex)
{
// Intentionally do nothing, prevent issues affecting normal execution.
}
#endif
}
#endregion
}
}

@ -1,34 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Emby.Common.Implementations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Emby.Common.Implementations")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1e37a338-9f57-4b70-bd6d-bb9c591e319b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.4.12" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
</packages>

@ -661,7 +661,7 @@ namespace Emby.Dlna.Didl
return;
}
XmlAttribute secAttribute = null;
MediaBrowser.Model.Dlna.XmlAttribute secAttribute = null;
foreach (var attribute in _profile.XmlRootAttributes)
{
if (string.Equals(attribute.Name, "xmlns:sec", StringComparison.OrdinalIgnoreCase))

@ -158,7 +158,7 @@ namespace Emby.Dlna.Main
{
if (_communicationsServer == null)
{
var enableMultiSocketBinding = _environmentInfo.OperatingSystem == OperatingSystem.Windows;
var enableMultiSocketBinding = _environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows;
_communicationsServer = new SsdpCommunicationsServer(_socketFactory, _networkManager, _logger, enableMultiSocketBinding)
{

@ -32,11 +32,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="TagLib.Portable">
<HintPath>..\ThirdParty\taglib\TagLib.Portable.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>

@ -13,15 +13,12 @@ namespace Emby.Server.Implementations.AppBase
/// <summary>
/// Initializes a new instance of the <see cref="BaseApplicationPaths"/> class.
/// </summary>
protected BaseApplicationPaths(string programDataPath, string appFolderPath, Action<string> createDirectoryFn)
protected BaseApplicationPaths(string programDataPath, string appFolderPath)
{
ProgramDataPath = programDataPath;
ProgramSystemPath = appFolderPath;
CreateDirectoryFn = createDirectoryFn;
}
protected Action<string> CreateDirectoryFn;
public string ProgramDataPath { get; private set; }
/// <summary>
@ -45,7 +42,7 @@ namespace Emby.Server.Implementations.AppBase
{
_dataDirectory = Path.Combine(ProgramDataPath, "data");
CreateDirectoryFn(_dataDirectory);
Directory.CreateDirectory(_dataDirectory);
}
return _dataDirectory;
@ -152,7 +149,7 @@ namespace Emby.Server.Implementations.AppBase
{
_cachePath = Path.Combine(ProgramDataPath, "cache");
CreateDirectoryFn(_cachePath);
Directory.CreateDirectory(_cachePath);
}
return _cachePath;

File diff suppressed because it is too large Load Diff

@ -3,11 +3,10 @@ using MediaBrowser.Model.IO;
using SharpCompress.Archives.Rar;
using SharpCompress.Archives.SevenZip;
using SharpCompress.Archives.Tar;
using SharpCompress.Common;
using SharpCompress.Readers;
using SharpCompress.Readers.Zip;
namespace Emby.Common.Implementations.Archiving
namespace Emby.Server.Implementations.Archiving
{
/// <summary>
/// Class DotNetZipClient

@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Security.Cryptography;
using System.Xml;
namespace Emby.Server.Core.Cryptography
{
@ -27,7 +28,11 @@ namespace Emby.Server.Core.Cryptography
DateTime notAfter = DateTime.Now.AddYears(10);
RSA issuerKey = RSA.Create();
#if NET46
issuerKey.FromXmlString(MonoTestRootAgency);
#else
RSACryptoServiceProviderExtensions.FromXmlString(issuerKey, MonoTestRootAgency);
#endif
RSA subjectKey = RSA.Create();
// serial number MUST be positive
@ -44,7 +49,7 @@ namespace Emby.Server.Core.Cryptography
cb.NotAfter = notAfter;
cb.SubjectName = subject;
cb.SubjectPublicKey = subjectKey;
// signature
cb.Hash = "SHA256";
byte[] rawcert = cb.Sign(issuerKey);
@ -66,4 +71,39 @@ namespace Emby.Server.Core.Cryptography
p12.SaveToFile(fileName);
}
}
public static class RSACryptoServiceProviderExtensions
{
public static void FromXmlString(RSA rsa, string xmlString)
{
RSAParameters parameters = new RSAParameters();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlString);
if (xmlDoc.DocumentElement.Name.Equals("RSAKeyValue"))
{
foreach (XmlNode node in xmlDoc.DocumentElement.ChildNodes)
{
switch (node.Name)
{
case "Modulus": parameters.Modulus = Convert.FromBase64String(node.InnerText); break;
case "Exponent": parameters.Exponent = Convert.FromBase64String(node.InnerText); break;
case "P": parameters.P = Convert.FromBase64String(node.InnerText); break;
case "Q": parameters.Q = Convert.FromBase64String(node.InnerText); break;
case "DP": parameters.DP = Convert.FromBase64String(node.InnerText); break;
case "DQ": parameters.DQ = Convert.FromBase64String(node.InnerText); break;
case "InverseQ": parameters.InverseQ = Convert.FromBase64String(node.InnerText); break;
case "D": parameters.D = Convert.FromBase64String(node.InnerText); break;
}
}
}
else
{
throw new Exception("Invalid XML RSA key.");
}
rsa.ImportParameters(parameters);
}
}
}

@ -4,7 +4,7 @@ using System.Security.Cryptography;
using System.Text;
using MediaBrowser.Model.Cryptography;
namespace Emby.Common.Implementations.Cryptography
namespace Emby.Server.Implementations.Cryptography
{
public class CryptographyProvider : ICryptoProvider
{

@ -7,6 +7,8 @@ using System.Runtime.Serialization;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Emby.Server.Implementations.Devices;
using Emby.Server.Implementations.Playlists;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Collections;
using MediaBrowser.Controller.Configuration;
@ -25,8 +27,6 @@ using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Server.Implementations.Devices;
using MediaBrowser.Server.Implementations.Playlists;
using MediaBrowser.Model.Reflection;
using SQLitePCL.pretty;
using MediaBrowser.Model.System;

@ -10,7 +10,6 @@ using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Server.Implementations.Devices;
namespace Emby.Server.Implementations.Devices
{

@ -1,14 +1,12 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using System;
using System.IO;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Serialization;
namespace MediaBrowser.Server.Implementations.Devices
namespace Emby.Server.Implementations.Devices
{
public class CameraUploadsFolder : BasePluginFolder, ISupportsUserSpecificView
{
@ -30,7 +28,7 @@ namespace MediaBrowser.Server.Implementations.Devices
[IgnoreDataMember]
public override string CollectionType
{
get { return Model.Entities.CollectionType.Photos; }
get { return MediaBrowser.Model.Entities.CollectionType.Photos; }
}
[IgnoreDataMember]

@ -5,7 +5,7 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
namespace Emby.Common.Implementations.Devices
namespace Emby.Server.Implementations.Devices
{
public class DeviceId
{

@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Model.Diagnostics;
namespace Emby.Common.Implementations.Diagnostics
namespace Emby.Server.Implementations.Diagnostics
{
public class CommonProcess : IProcess
{

@ -1,6 +1,6 @@
using MediaBrowser.Model.Diagnostics;
namespace Emby.Common.Implementations.Diagnostics
namespace Emby.Server.Implementations.Diagnostics
{
public class ProcessFactory : IProcessFactory
{

@ -43,7 +43,7 @@
<Compile Include="AppBase\BaseConfigurationManager.cs" />
<Compile Include="AppBase\ConfigurationHelper.cs" />
<Compile Include="ApplicationHost.cs" />
<Compile Include="ApplicationPathHelper.cs" />
<Compile Include="Archiving\ZipClient.cs" />
<Compile Include="Branding\BrandingConfigurationFactory.cs" />
<Compile Include="Browser\BrowserLauncher.cs" />
<Compile Include="Channels\ChannelConfigurations.cs" />
@ -61,6 +61,7 @@
<Compile Include="Cryptography\BitConverterLE.cs" />
<Compile Include="Cryptography\CertificateGenerator.cs" />
<Compile Include="Cryptography\CryptoConvert.cs" />
<Compile Include="Cryptography\CryptographyProvider.cs" />
<Compile Include="Cryptography\PfxGenerator.cs" />
<Compile Include="Cryptography\PKCS1.cs" />
<Compile Include="Cryptography\PKCS12.cs" />
@ -81,8 +82,12 @@
<Compile Include="Data\SqliteUserRepository.cs" />
<Compile Include="Data\TypeMapper.cs" />
<Compile Include="Devices\CameraUploadsDynamicFolder.cs" />
<Compile Include="Devices\CameraUploadsFolder.cs" />
<Compile Include="Devices\DeviceId.cs" />
<Compile Include="Devices\DeviceManager.cs" />
<Compile Include="Devices\DeviceRepository.cs" />
<Compile Include="Diagnostics\CommonProcess.cs" />
<Compile Include="Diagnostics\ProcessFactory.cs" />
<Compile Include="Dto\DtoService.cs" />
<Compile Include="EntryPoints\AutomaticRestartEntryPoint.cs" />
<Compile Include="EntryPoints\ExternalPortForwarding.cs" />
@ -98,9 +103,12 @@
<Compile Include="EntryPoints\UsageEntryPoint.cs" />
<Compile Include="EntryPoints\UsageReporter.cs" />
<Compile Include="EntryPoints\UserDataChangeNotifier.cs" />
<Compile Include="EnvironmentInfo\EnvironmentInfo.cs" />
<Compile Include="FFMpeg\FFMpegInfo.cs" />
<Compile Include="FFMpeg\FFMpegInstallInfo.cs" />
<Compile Include="FFMpeg\FFMpegLoader.cs" />
<Compile Include="HttpClientManager\HttpClientInfo.cs" />
<Compile Include="HttpClientManager\HttpClientManager.cs" />
<Compile Include="HttpServerFactory.cs" />
<Compile Include="HttpServer\FileWriter.cs" />
<Compile Include="HttpServer\HttpListenerHost.cs" />
@ -123,9 +131,237 @@
<Compile Include="Images\BaseDynamicImageProvider.cs" />
<Compile Include="IO\AsyncStreamCopier.cs" />
<Compile Include="IO\FileRefresher.cs" />
<Compile Include="IO\IsoManager.cs" />
<Compile Include="IO\LibraryMonitor.cs" />
<Compile Include="IO\LnkShortcutHandler.cs" />
<Compile Include="IO\ManagedFileSystem.cs" />
<Compile Include="IO\MbLinkShortcutHandler.cs" />
<Compile Include="IO\MemoryStreamProvider.cs" />
<Compile Include="IO\ProgressStream.cs" />
<Compile Include="IO\SharpCifsFileSystem.cs" />
<Compile Include="IO\SharpCifs\Config.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcBind.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcBinding.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcConstants.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcError.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcException.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcMessage.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcPipeHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\DcerpcSecurityProvider.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\LsaPolicyHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Lsarpc.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\LsarSidArrayX.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcDfsRootEnum.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcEnumerateAliasesInDomain.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcGetMembersInAlias.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcLookupSids.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcLsarOpenPolicy2.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcQueryInformationPolicy.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrConnect2.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrConnect4.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrOpenAlias.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcSamrOpenDomain.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcShareEnum.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\MsrpcShareGetInfo.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Netdfs.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Samr.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\SamrAliasHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\SamrDomainHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\SamrPolicyHandle.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Msrpc\Srvsvc.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrBuffer.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrException.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrHyper.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrLong.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrObject.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrShort.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Ndr\NdrSmall.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\Rpc.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\UnicodeString.cs" />
<Compile Include="IO\SharpCifs\Dcerpc\UUID.cs" />
<Compile Include="IO\SharpCifs\Netbios\Lmhosts.cs" />
<Compile Include="IO\SharpCifs\Netbios\Name.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameQueryRequest.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameQueryResponse.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameServiceClient.cs" />
<Compile Include="IO\SharpCifs\Netbios\NameServicePacket.cs" />
<Compile Include="IO\SharpCifs\Netbios\NbtAddress.cs" />
<Compile Include="IO\SharpCifs\Netbios\NbtException.cs" />
<Compile Include="IO\SharpCifs\Netbios\NodeStatusRequest.cs" />
<Compile Include="IO\SharpCifs\Netbios\NodeStatusResponse.cs" />
<Compile Include="IO\SharpCifs\Netbios\SessionRequestPacket.cs" />
<Compile Include="IO\SharpCifs\Netbios\SessionRetargetResponsePacket.cs" />
<Compile Include="IO\SharpCifs\Netbios\SessionServicePacket.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\NtlmFlags.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\NtlmMessage.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\Type1Message.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\Type2Message.cs" />
<Compile Include="IO\SharpCifs\Ntlmssp\Type3Message.cs" />
<Compile Include="IO\SharpCifs\Smb\ACE.cs" />
<Compile Include="IO\SharpCifs\Smb\AllocInfo.cs" />
<Compile Include="IO\SharpCifs\Smb\AndXServerMessageBlock.cs" />
<Compile Include="IO\SharpCifs\Smb\BufferCache.cs" />
<Compile Include="IO\SharpCifs\Smb\Dfs.cs" />
<Compile Include="IO\SharpCifs\Smb\DfsReferral.cs" />
<Compile Include="IO\SharpCifs\Smb\DosError.cs" />
<Compile Include="IO\SharpCifs\Smb\DosFileFilter.cs" />
<Compile Include="IO\SharpCifs\Smb\FileEntry.cs" />
<Compile Include="IO\SharpCifs\Smb\IInfo.cs" />
<Compile Include="IO\SharpCifs\Smb\NetServerEnum2.cs" />
<Compile Include="IO\SharpCifs\Smb\NetServerEnum2Response.cs" />
<Compile Include="IO\SharpCifs\Smb\NetShareEnum.cs" />
<Compile Include="IO\SharpCifs\Smb\NetShareEnumResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmAuthenticator.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmChallenge.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmContext.cs" />
<Compile Include="IO\SharpCifs\Smb\NtlmPasswordAuthentication.cs" />
<Compile Include="IO\SharpCifs\Smb\NtStatus.cs" />
<Compile Include="IO\SharpCifs\Smb\NtTransQuerySecurityDesc.cs" />
<Compile Include="IO\SharpCifs\Smb\NtTransQuerySecurityDescResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Principal.cs" />
<Compile Include="IO\SharpCifs\Smb\SecurityDescriptor.cs" />
<Compile Include="IO\SharpCifs\Smb\ServerMessageBlock.cs" />
<Compile Include="IO\SharpCifs\Smb\SID.cs" />
<Compile Include="IO\SharpCifs\Smb\SigningDigest.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbAuthException.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComBlankResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComClose.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComCreateDirectory.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComDelete.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComDeleteDirectory.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComFindClose2.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComLogoffAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNegotiate.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNegotiateResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNTCreateAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNTCreateAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNtTransaction.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComNtTransactionResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComOpenAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComOpenAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComQueryInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComQueryInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComReadAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComReadAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComRename.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComSessionSetupAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComSessionSetupAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTransaction.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTransactionResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTreeConnectAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTreeConnectAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComTreeDisconnect.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWrite.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWriteAndX.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWriteAndXResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbComWriteResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbConstants.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbException.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFile.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileExtensions.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileFilter.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileInputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFilenameFilter.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbFileOutputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbRandomAccessFile.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbSession.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbShareInfo.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbTransport.cs" />
<Compile Include="IO\SharpCifs\Smb\SmbTree.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2FindFirst2.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2FindFirst2Response.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2FindNext2.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2GetDfsReferral.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2GetDfsReferralResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryFSInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryFSInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryPathInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2QueryPathInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2SetFileInformation.cs" />
<Compile Include="IO\SharpCifs\Smb\Trans2SetFileInformationResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransactNamedPipeInputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\TransactNamedPipeOutputStream.cs" />
<Compile Include="IO\SharpCifs\Smb\TransCallNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransCallNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransPeekNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransPeekNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransTransactNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransTransactNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\TransWaitNamedPipe.cs" />
<Compile Include="IO\SharpCifs\Smb\TransWaitNamedPipeResponse.cs" />
<Compile Include="IO\SharpCifs\Smb\WinError.cs" />
<Compile Include="IO\SharpCifs\UniAddress.cs" />
<Compile Include="IO\SharpCifs\Util\Base64.cs" />
<Compile Include="IO\SharpCifs\Util\DES.cs" />
<Compile Include="IO\SharpCifs\Util\Encdec.cs" />
<Compile Include="IO\SharpCifs\Util\Hexdump.cs" />
<Compile Include="IO\SharpCifs\Util\HMACT64.cs" />
<Compile Include="IO\SharpCifs\Util\LogStream.cs" />
<Compile Include="IO\SharpCifs\Util\MD4.cs" />
<Compile Include="IO\SharpCifs\Util\RC4.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\AbstractMap.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Arrays.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\BufferedReader.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\BufferedWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\CharBuffer.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\CharSequence.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Collections.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ConcurrentHashMap.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\DateFormat.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\EnumeratorWrapper.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Exceptions.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Extensions.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FilePath.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileReader.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FileWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FilterInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\FilterOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Hashtable.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\HttpURLConnection.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ICallable.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IConcurrentMap.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IExecutor.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IFilenameFilter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IFuture.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\InputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\InputStreamReader.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IPrivilegedAction.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\IRunnable.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Iterator.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\LinkageError.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Matcher.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\MD5.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\MD5Managed.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\MessageDigest.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\NetworkStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ObjectInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ObjectOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\OutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\OutputStreamWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\PipedInputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\PipedOutputStream.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\PrintWriter.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Properties.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\RandomAccessFile.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ReentrantLock.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Reference.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Runtime.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\SimpleDateFormat.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\SocketEx.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\StringTokenizer.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\SynchronizedList.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\Thread.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ThreadFactory.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\ThreadPoolExecutor.cs" />
<Compile Include="IO\SharpCifs\Util\Sharpen\WrappedSystemStream.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\Request.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\Response.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\Transport.cs" />
<Compile Include="IO\SharpCifs\Util\Transport\TransportException.cs" />
<Compile Include="IO\ThrottledStream.cs" />
<Compile Include="Library\CoreResolutionIgnoreRule.cs" />
<Compile Include="Library\LibraryManager.cs" />
@ -198,9 +434,16 @@
<Compile Include="Localization\LocalizationManager.cs" />
<Compile Include="Localization\TextLocalizer.cs" />
<Compile Include="Logging\ConsoleLogger.cs" />
<Compile Include="Logging\SimpleLogManager.cs" />
<Compile Include="Logging\UnhandledExceptionWriter.cs" />
<Compile Include="MediaEncoder\EncodingManager.cs" />
<Compile Include="Migrations\IVersionMigration.cs" />
<Compile Include="Networking\NetworkManager.cs" />
<Compile Include="Net\DisposableManagedObjectBase.cs" />
<Compile Include="Net\NetAcceptSocket.cs" />
<Compile Include="Net\SocketAcceptor.cs" />
<Compile Include="Net\SocketFactory.cs" />
<Compile Include="Net\UdpSocket.cs" />
<Compile Include="News\NewsEntryPoint.cs" />
<Compile Include="News\NewsService.cs" />
<Compile Include="Notifications\CoreNotificationTypes.cs" />
@ -215,20 +458,34 @@
<Compile Include="Data\CleanDatabaseScheduledTask.cs" />
<Compile Include="Data\SqliteExtensions.cs" />
<Compile Include="Photos\PhotoAlbumImageProvider.cs" />
<Compile Include="Playlists\ManualPlaylistsFolder.cs" />
<Compile Include="Playlists\PlaylistImageProvider.cs" />
<Compile Include="Playlists\PlaylistManager.cs" />
<Compile Include="Playlists\PlaylistsDynamicFolder.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reflection\AssemblyInfo.cs" />
<Compile Include="ScheduledTasks\ChapterImagesTask.cs" />
<Compile Include="ScheduledTasks\DailyTrigger.cs" />
<Compile Include="ScheduledTasks\IntervalTrigger.cs" />
<Compile Include="ScheduledTasks\PeopleValidationTask.cs" />
<Compile Include="ScheduledTasks\PluginUpdateTask.cs" />
<Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
<Compile Include="ScheduledTasks\ScheduledTaskWorker.cs" />
<Compile Include="ScheduledTasks\StartupTrigger.cs" />
<Compile Include="ScheduledTasks\SystemEventTrigger.cs" />
<Compile Include="ScheduledTasks\SystemUpdateTask.cs" />
<Compile Include="ScheduledTasks\TaskManager.cs" />
<Compile Include="ScheduledTasks\Tasks\DeleteCacheFileTask.cs" />
<Compile Include="ScheduledTasks\Tasks\DeleteLogFileTask.cs" />
<Compile Include="ScheduledTasks\Tasks\ReloadLoggerFileTask.cs" />
<Compile Include="ScheduledTasks\WeeklyTrigger.cs" />
<Compile Include="Security\AuthenticationRepository.cs" />
<Compile Include="Security\EncryptionManager.cs" />
<Compile Include="Security\MBLicenseFile.cs" />
<Compile Include="Security\PluginSecurityManager.cs" />
<Compile Include="Security\RegRecord.cs" />
<Compile Include="Serialization\JsonSerializer.cs" />
<Compile Include="Serialization\XmlSerializer.cs" />
<Compile Include="ServerApplicationPaths.cs" />
<Compile Include="ServerManager\ServerManager.cs" />
<Compile Include="ServerManager\WebSocketConnection.cs" />
@ -277,21 +534,72 @@
<Compile Include="Sorting\StudioComparer.cs" />
<Compile Include="StartupOptions.cs" />
<Compile Include="SystemEvents.cs" />
<Compile Include="TextEncoding\NLangDetect\Detector.cs" />
<Compile Include="TextEncoding\NLangDetect\DetectorFactory.cs" />
<Compile Include="TextEncoding\NLangDetect\ErrorCode.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\CharExtensions.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\RandomExtensions.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\StringExtensions.cs" />
<Compile Include="TextEncoding\NLangDetect\Extensions\UnicodeBlock.cs" />
<Compile Include="TextEncoding\NLangDetect\GenProfile.cs" />
<Compile Include="TextEncoding\NLangDetect\InternalException.cs" />
<Compile Include="TextEncoding\NLangDetect\Language.cs" />
<Compile Include="TextEncoding\NLangDetect\LanguageDetector.cs" />
<Compile Include="TextEncoding\NLangDetect\NLangDetectException.cs" />
<Compile Include="TextEncoding\NLangDetect\ProbVector.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\LangProfile.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\Messages.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\NGram.cs" />
<Compile Include="TextEncoding\NLangDetect\Utils\TagExtractor.cs" />
<Compile Include="TextEncoding\TextEncoding.cs" />
<Compile Include="TextEncoding\TextEncodingDetect.cs" />
<Compile Include="TextEncoding\UniversalDetector\CharsetDetector.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\Big5Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\BitPackage.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\CharDistributionAnalyser.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\CharsetProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\Charsets.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\CodingStateMachine.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EscCharsetProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EscSM.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EUCJPProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EUCKRProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\EUCTWProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\GB18030Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\HebrewProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\JapaneseContextAnalyser.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangBulgarianModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangCyrillicModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangGreekModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangHebrewModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangHungarianModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\LangThaiModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\Latin1Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\MBCSGroupProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\MBCSSM.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SBCharsetProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SBCSGroupProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SequenceModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SJISProber.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\SMModel.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\UniversalDetector.cs" />
<Compile Include="TextEncoding\UniversalDetector\Core\UTF8Prober.cs" />
<Compile Include="TextEncoding\UniversalDetector\DetectionConfidence.cs" />
<Compile Include="TextEncoding\UniversalDetector\ICharsetDetector.cs" />
<Compile Include="Threading\CommonTimer.cs" />
<Compile Include="Threading\TimerFactory.cs" />
<Compile Include="TV\SeriesPostScanTask.cs" />
<Compile Include="TV\TVSeriesManager.cs" />
<Compile Include="Udp\UdpServer.cs" />
<Compile Include="Updates\InstallationManager.cs" />
<Compile Include="UserViews\CollectionFolderImageProvider.cs" />
<Compile Include="UserViews\DynamicImageProvider.cs" />
<Compile Include="Xml\XmlReaderSettingsFactory.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\iso6392.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Emby.Common.Implementations\Emby.Common.Implementations.csproj">
<Project>{1e37a338-9f57-4b70-bd6d-bb9c591e319b}</Project>
<Name>Emby.Common.Implementations</Name>
</ProjectReference>
<ProjectReference Include="..\Emby.Dlna\Emby.Dlna.csproj">
<Project>{805844ab-e92f-45e6-9d99-4f6d48d129a5}</Project>
<Name>Emby.Dlna</Name>
@ -328,10 +636,6 @@
<Project>{442b5058-dcaf-4263-bb6a-f21e31120a1b}</Project>
<Name>MediaBrowser.Providers</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Server.Implementations\MediaBrowser.Server.Implementations.csproj">
<Project>{2e781478-814d-4a48-9d80-bff206441a65}</Project>
<Name>MediaBrowser.Server.Implementations</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.WebDashboard\MediaBrowser.WebDashboard.csproj">
<Project>{5624b7b5-b5a7-41d8-9f10-cc5611109619}</Project>
<Name>MediaBrowser.WebDashboard</Name>
@ -356,20 +660,18 @@
<HintPath>..\ThirdParty\emby\Emby.Server.MediaEncoding.dll</HintPath>
</Reference>
<Reference Include="Emby.XmlTv, Version=1.0.6387.29335, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Emby.XmlTv.1.0.9\lib\portable-net45+win8\Emby.XmlTv.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Emby.XmlTv.1.0.10\lib\portable-net45+netstandard2.0+win8\Emby.XmlTv.dll</HintPath>
</Reference>
<Reference Include="MediaBrowser.Naming, Version=1.0.6279.25941, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Naming.1.0.5\lib\portable-net45+win8\MediaBrowser.Naming.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=1.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.1.2.2\lib\net45\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
<Reference Include="MediaBrowser.Naming, Version=1.0.6437.24226, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MediaBrowser.Naming.1.0.6\lib\portable-net45+netstandard2.0+win8\MediaBrowser.Naming.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SharpCompress, Version=0.14.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.14.0\lib\net45\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector, Version=4.0.8.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.4.0.8\lib\net45\SimpleInjector.dll</HintPath>
</Reference>
@ -436,6 +738,60 @@
<EmbeddedResource Include="Localization\Core\zh-TW.json" />
<EmbeddedResource Include="Localization\countries.json" />
<None Include="packages.config" />
<None Include="TextEncoding\NLangDetect\Profiles\afr" />
<None Include="TextEncoding\NLangDetect\Profiles\ara" />
<None Include="TextEncoding\NLangDetect\Profiles\ben" />
<None Include="TextEncoding\NLangDetect\Profiles\bul" />
<None Include="TextEncoding\NLangDetect\Profiles\ces" />
<None Include="TextEncoding\NLangDetect\Profiles\dan" />
<None Include="TextEncoding\NLangDetect\Profiles\deu" />
<None Include="TextEncoding\NLangDetect\Profiles\ell" />
<None Include="TextEncoding\NLangDetect\Profiles\eng" />
<None Include="TextEncoding\NLangDetect\Profiles\est" />
<None Include="TextEncoding\NLangDetect\Profiles\fas" />
<None Include="TextEncoding\NLangDetect\Profiles\fin" />
<None Include="TextEncoding\NLangDetect\Profiles\fra" />
<None Include="TextEncoding\NLangDetect\Profiles\guj" />
<None Include="TextEncoding\NLangDetect\Profiles\heb" />
<None Include="TextEncoding\NLangDetect\Profiles\hin" />
<None Include="TextEncoding\NLangDetect\Profiles\hrv" />
<None Include="TextEncoding\NLangDetect\Profiles\hun" />
<None Include="TextEncoding\NLangDetect\Profiles\ind" />
<None Include="TextEncoding\NLangDetect\Profiles\ita" />
<None Include="TextEncoding\NLangDetect\Profiles\jpn" />
<None Include="TextEncoding\NLangDetect\Profiles\kan" />
<None Include="TextEncoding\NLangDetect\Profiles\kor" />
<None Include="TextEncoding\NLangDetect\Profiles\lav" />
<None Include="TextEncoding\NLangDetect\Profiles\lit" />
<None Include="TextEncoding\NLangDetect\Profiles\mal" />
<None Include="TextEncoding\NLangDetect\Profiles\mar" />
<None Include="TextEncoding\NLangDetect\Profiles\mkd" />
<None Include="TextEncoding\NLangDetect\Profiles\nep" />
<None Include="TextEncoding\NLangDetect\Profiles\nld" />
<None Include="TextEncoding\NLangDetect\Profiles\nor" />
<None Include="TextEncoding\NLangDetect\Profiles\pan" />
<None Include="TextEncoding\NLangDetect\Profiles\pol" />
<None Include="TextEncoding\NLangDetect\Profiles\por" />
<None Include="TextEncoding\NLangDetect\Profiles\ron" />
<None Include="TextEncoding\NLangDetect\Profiles\rus" />
<None Include="TextEncoding\NLangDetect\Profiles\slk" />
<None Include="TextEncoding\NLangDetect\Profiles\slv" />
<None Include="TextEncoding\NLangDetect\Profiles\som" />
<None Include="TextEncoding\NLangDetect\Profiles\spa" />
<None Include="TextEncoding\NLangDetect\Profiles\sqi" />
<None Include="TextEncoding\NLangDetect\Profiles\swa" />
<None Include="TextEncoding\NLangDetect\Profiles\swe" />
<None Include="TextEncoding\NLangDetect\Profiles\tam" />
<None Include="TextEncoding\NLangDetect\Profiles\tel" />
<None Include="TextEncoding\NLangDetect\Profiles\tgl" />
<None Include="TextEncoding\NLangDetect\Profiles\tha" />
<None Include="TextEncoding\NLangDetect\Profiles\tur" />
<None Include="TextEncoding\NLangDetect\Profiles\ukr" />
<None Include="TextEncoding\NLangDetect\Profiles\urd" />
<None Include="TextEncoding\NLangDetect\Profiles\vie" />
<EmbeddedResource Include="TextEncoding\NLangDetect\Profiles\zh-cn" />
<EmbeddedResource Include="TextEncoding\NLangDetect\Profiles\zh-tw" />
<EmbeddedResource Include="TextEncoding\NLangDetect\Utils\messages.properties" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\Ratings\au.txt" />

@ -1,25 +1,21 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using MediaBrowser.Model.System;
namespace Emby.Common.Implementations.EnvironmentInfo
namespace Emby.Server.Implementations.EnvironmentInfo
{
public class EnvironmentInfo : IEnvironmentInfo
{
public Architecture? CustomArchitecture { get; set; }
public MediaBrowser.Model.System.OperatingSystem? CustomOperatingSystem { get; set; }
private Architecture? _customArchitecture;
private MediaBrowser.Model.System.OperatingSystem? _customOperatingSystem;
public virtual MediaBrowser.Model.System.OperatingSystem OperatingSystem
{
get
{
if (CustomOperatingSystem.HasValue)
if (_customOperatingSystem.HasValue)
{
return CustomOperatingSystem.Value;
return _customOperatingSystem.Value;
}
switch (Environment.OSVersion.Platform)
@ -34,6 +30,10 @@ namespace Emby.Common.Implementations.EnvironmentInfo
return MediaBrowser.Model.System.OperatingSystem.Windows;
}
set
{
_customOperatingSystem = value;
}
}
public string OperatingSystemName
@ -64,13 +64,17 @@ namespace Emby.Common.Implementations.EnvironmentInfo
{
get
{
if (CustomArchitecture.HasValue)
if (_customArchitecture.HasValue)
{
return CustomArchitecture.Value;
return _customArchitecture.Value;
}
return Environment.Is64BitOperatingSystem ? MediaBrowser.Model.System.Architecture.X64 : MediaBrowser.Model.System.Architecture.X86;
}
set
{
_customArchitecture = value;
}
}
public string GetEnvironmentVariable(string name)

@ -1,6 +1,6 @@
using System;
namespace Emby.Common.Implementations.HttpClientManager
namespace Emby.Server.Implementations.HttpClientManager
{
/// <summary>
/// Class HttpClientInfo

@ -1,26 +1,23 @@
using System.Net.Sockets;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Emby.Common.Implementations.HttpClientManager;
using Emby.Common.Implementations.IO;
using Emby.Server.Implementations.IO;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Net;
using MediaBrowser.Model.IO;
using MediaBrowser.Common;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
namespace Emby.Common.Implementations.HttpClientManager
namespace Emby.Server.Implementations.HttpClientManager
{
/// <summary>
/// Class HttpClientManager
@ -69,8 +66,10 @@ namespace Emby.Common.Implementations.HttpClientManager
// http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c
ServicePointManager.Expect100Continue = false;
// Trakt requests sometimes fail without this
#if NET46
// Trakt requests sometimes fail without this
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
#endif
}
/// <summary>
@ -431,7 +430,7 @@ namespace Emby.Common.Implementations.HttpClientManager
try
{
var bytes = options.RequestContentBytes ??
Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty);
Encoding.UTF8.GetBytes(options.RequestContent ?? string.Empty);
httpWebRequest.ContentType = options.RequestContentType ?? "application/x-www-form-urlencoded";
@ -730,7 +729,7 @@ namespace Emby.Common.Implementations.HttpClientManager
}
var webException = ex as WebException
?? ex.InnerException as WebException;
?? ex.InnerException as WebException;
if (webException != null)
{
@ -765,7 +764,7 @@ namespace Emby.Common.Implementations.HttpClientManager
}
var operationCanceledException = ex as OperationCanceledException
?? ex.InnerException as OperationCanceledException;
?? ex.InnerException as OperationCanceledException;
if (operationCanceledException != null)
{

@ -3,8 +3,8 @@ using System.IO;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.Threading.Tasks;
using Emby.Common.Implementations.Net;
using Emby.Server.Implementations.HttpServer;
using Emby.Server.Implementations.Net;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;

@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.IO
RestartTimer();
}
private async void OnTimerCallback(object state)
private void OnTimerCallback(object state)
{
List<string> paths;
@ -137,7 +137,7 @@ namespace Emby.Server.Implementations.IO
try
{
await ProcessPathChanges(paths.ToList()).ConfigureAwait(false);
ProcessPathChanges(paths.ToList());
}
catch (Exception ex)
{
@ -145,7 +145,7 @@ namespace Emby.Server.Implementations.IO
}
}
private async Task ProcessPathChanges(List<string> paths)
private void ProcessPathChanges(List<string> paths)
{
var itemsToRefresh = paths
.Distinct(StringComparer.OrdinalIgnoreCase)

@ -5,7 +5,7 @@ using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.IO;
namespace Emby.Common.Implementations.IO
namespace Emby.Server.Implementations.IO
{
/// <summary>
/// Class IsoManager

@ -2,11 +2,10 @@
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Security;
using System.Text;
using MediaBrowser.Model.IO;
namespace Emby.Common.Implementations.IO
namespace Emby.Server.Implementations.IO
{
public class LnkShortcutHandler :IShortcutHandler
{

@ -7,7 +7,7 @@ using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.System;
namespace Emby.Common.Implementations.IO
namespace Emby.Server.Implementations.IO
{
/// <summary>
/// Class ManagedFileSystem

@ -1,35 +1,8 @@
using System.IO;
using MediaBrowser.Model.IO;
using Microsoft.IO;
namespace Emby.Server.Implementations.IO
{
public class RecyclableMemoryStreamProvider : IMemoryStreamFactory
{
readonly RecyclableMemoryStreamManager _manager = new RecyclableMemoryStreamManager();
public MemoryStream CreateNew()
{
return _manager.GetStream();
}
public MemoryStream CreateNew(int capacity)
{
return _manager.GetStream("RecyclableMemoryStream", capacity);
}
public MemoryStream CreateNew(byte[] buffer)
{
return _manager.GetStream("RecyclableMemoryStream", buffer, 0, buffer.Length);
}
public bool TryGetBuffer(MemoryStream stream, out byte[] buffer)
{
buffer = stream.GetBuffer();
return true;
}
}
public class MemoryStreamProvider : IMemoryStreamFactory
{
public MemoryStream CreateNew()

@ -1,7 +1,7 @@
using System;
using System.IO;
namespace Emby.Common.Implementations.IO
namespace Emby.Server.Implementations.IO
{
/// <summary>
/// Measures progress when reading from a stream or writing to one

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save