mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-14 14:16:35 +00:00
update main projects
This commit is contained in:
@@ -39,10 +39,6 @@ using MediaBrowser.Model.System;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
using MediaBrowser.Model.Threading;
|
||||
|
||||
#if NETSTANDARD1_6
|
||||
using System.Runtime.Loader;
|
||||
#endif
|
||||
|
||||
namespace Emby.Common.Implementations
|
||||
{
|
||||
/// <summary>
|
||||
@@ -306,7 +302,6 @@ namespace Emby.Common.Implementations
|
||||
|
||||
builder.AppendLine(string.Format("Command line: {0}", string.Join(" ", Environment.GetCommandLineArgs())));
|
||||
|
||||
#if NET46
|
||||
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));
|
||||
@@ -320,7 +315,6 @@ namespace Emby.Common.Implementations
|
||||
builder.AppendLine("Mono: " + displayName.Invoke(null, null));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
builder.AppendLine(string.Format("Processor count: {0}", Environment.ProcessorCount));
|
||||
builder.AppendLine(string.Format("Program data path: {0}", appPaths.ProgramDataPath));
|
||||
@@ -336,9 +330,7 @@ namespace Emby.Common.Implementations
|
||||
try
|
||||
{
|
||||
// Increase the max http request limit
|
||||
#if NET46
|
||||
ServicePointManager.DefaultConnectionLimit = Math.Max(96, ServicePointManager.DefaultConnectionLimit);
|
||||
#endif
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -436,7 +428,6 @@ namespace Emby.Common.Implementations
|
||||
|
||||
if (assemblyPlugin != null)
|
||||
{
|
||||
#if NET46
|
||||
var assembly = plugin.GetType().Assembly;
|
||||
var assemblyName = assembly.GetName();
|
||||
|
||||
@@ -447,21 +438,7 @@ namespace Emby.Common.Implementations
|
||||
var assemblyFilePath = Path.Combine(ApplicationPaths.PluginsPath, assemblyFileName);
|
||||
|
||||
assemblyPlugin.SetAttributes(assemblyFilePath, assemblyFileName, assemblyName.Version, assemblyId);
|
||||
#elif NETSTANDARD1_6
|
||||
var typeInfo = plugin.GetType().GetTypeInfo();
|
||||
var assembly = typeInfo.Assembly;
|
||||
var assemblyName = assembly.GetName();
|
||||
|
||||
var attribute = (GuidAttribute)assembly.GetCustomAttribute(typeof(GuidAttribute));
|
||||
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);
|
||||
#else
|
||||
return null;
|
||||
#endif
|
||||
return null;
|
||||
}
|
||||
|
||||
var isFirstRun = !File.Exists(plugin.ConfigurationFilePath);
|
||||
@@ -492,17 +469,7 @@ return null;
|
||||
|
||||
AllConcreteTypes = assemblies
|
||||
.SelectMany(GetTypes)
|
||||
.Where(t =>
|
||||
{
|
||||
#if NET46
|
||||
return t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType;
|
||||
#endif
|
||||
#if NETSTANDARD1_6
|
||||
var typeInfo = t.GetTypeInfo();
|
||||
return typeInfo.IsClass && !typeInfo.IsAbstract && !typeInfo.IsInterface && !typeInfo.IsGenericType;
|
||||
#endif
|
||||
return false;
|
||||
})
|
||||
.Where(t => t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
@@ -717,13 +684,7 @@ return null;
|
||||
{
|
||||
try
|
||||
{
|
||||
#if NET46
|
||||
return Assembly.Load(File.ReadAllBytes(file));
|
||||
#elif NETSTANDARD1_6
|
||||
|
||||
return AssemblyLoadContext.Default.LoadFromStream(new MemoryStream(File.ReadAllBytes(file)));
|
||||
#endif
|
||||
return null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -742,14 +703,7 @@ return null;
|
||||
{
|
||||
var currentType = typeof(T);
|
||||
|
||||
#if NET46
|
||||
return AllConcreteTypes.Where(currentType.IsAssignableFrom);
|
||||
#elif NETSTANDARD1_6
|
||||
var currentTypeInfo = currentType.GetTypeInfo();
|
||||
|
||||
return AllConcreteTypes.Where(currentTypeInfo.IsAssignableFrom);
|
||||
#endif
|
||||
return new List<Type>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -31,14 +31,12 @@ namespace Emby.Common.Implementations.Diagnostics
|
||||
RedirectStandardOutput = options.RedirectStandardOutput
|
||||
};
|
||||
|
||||
#if NET46
|
||||
startInfo.ErrorDialog = options.ErrorDialog;
|
||||
|
||||
if (options.IsHidden)
|
||||
{
|
||||
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
}
|
||||
#endif
|
||||
|
||||
_process = new Process
|
||||
{
|
||||
|
||||
381
Emby.Common.Implementations/Emby.Common.Implementations.csproj
Normal file
381
Emby.Common.Implementations/Emby.Common.Implementations.csproj
Normal file
@@ -0,0 +1,381 @@
|
||||
<?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.2</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.3\lib\net45\NLog.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</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.7.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SimpleInjector.4.0.7\lib\net45\SimpleInjector.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</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\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\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" />
|
||||
</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,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>5a27010a-09c6-4e86-93ea-437484c10917</ProjectGuid>
|
||||
<RootNamespace>Emby.Common.Implementations</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
@@ -10,7 +10,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
{
|
||||
public class EnvironmentInfo : IEnvironmentInfo
|
||||
{
|
||||
public MediaBrowser.Model.System.Architecture? CustomArchitecture { get; set; }
|
||||
public Architecture? CustomArchitecture { get; set; }
|
||||
public MediaBrowser.Model.System.OperatingSystem? CustomOperatingSystem { get; set; }
|
||||
|
||||
public virtual MediaBrowser.Model.System.OperatingSystem OperatingSystem
|
||||
@@ -22,7 +22,6 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
return CustomOperatingSystem.Value;
|
||||
}
|
||||
|
||||
#if NET46
|
||||
switch (Environment.OSVersion.Platform)
|
||||
{
|
||||
case PlatformID.MacOSX:
|
||||
@@ -32,20 +31,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
case PlatformID.Unix:
|
||||
return MediaBrowser.Model.System.OperatingSystem.Linux;
|
||||
}
|
||||
#elif NETSTANDARD1_6
|
||||
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
return OperatingSystem.OSX;
|
||||
}
|
||||
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
return OperatingSystem.Windows;
|
||||
}
|
||||
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
return OperatingSystem.Linux;
|
||||
}
|
||||
#endif
|
||||
|
||||
return MediaBrowser.Model.System.OperatingSystem.Windows;
|
||||
}
|
||||
}
|
||||
@@ -54,12 +40,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
#if NET46
|
||||
return Environment.OSVersion.Platform.ToString();
|
||||
#elif NETSTANDARD1_6
|
||||
return System.Runtime.InteropServices.RuntimeInformation.OSDescription;
|
||||
#endif
|
||||
return "Operating System";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,12 +48,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
#if NET46
|
||||
return Environment.OSVersion.Version.ToString() + " " + Environment.OSVersion.ServicePack.ToString();
|
||||
#elif NETSTANDARD1_6
|
||||
return System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
|
||||
#endif
|
||||
return "1.0";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +60,7 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
}
|
||||
}
|
||||
|
||||
public MediaBrowser.Model.System.Architecture SystemArchitecture
|
||||
public Architecture SystemArchitecture
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -92,22 +68,8 @@ namespace Emby.Common.Implementations.EnvironmentInfo
|
||||
{
|
||||
return CustomArchitecture.Value;
|
||||
}
|
||||
#if NET46
|
||||
|
||||
return Environment.Is64BitOperatingSystem ? MediaBrowser.Model.System.Architecture.X64 : MediaBrowser.Model.System.Architecture.X86;
|
||||
#elif NETSTANDARD1_6
|
||||
switch(System.Runtime.InteropServices.RuntimeInformation.OSArchitecture)
|
||||
{
|
||||
case System.Runtime.InteropServices.Architecture.Arm:
|
||||
return MediaBrowser.Model.System.Architecture.Arm;
|
||||
case System.Runtime.InteropServices.Architecture.Arm64:
|
||||
return MediaBrowser.Model.System.Architecture.Arm64;
|
||||
case System.Runtime.InteropServices.Architecture.X64:
|
||||
return MediaBrowser.Model.System.Architecture.X64;
|
||||
case System.Runtime.InteropServices.Architecture.X86:
|
||||
return MediaBrowser.Model.System.Architecture.X86;
|
||||
}
|
||||
#endif
|
||||
return MediaBrowser.Model.System.Architecture.X64;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,13 +66,11 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
_appPaths = appPaths;
|
||||
_defaultUserAgentFn = defaultUserAgentFn;
|
||||
|
||||
#if NET46
|
||||
// http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c
|
||||
ServicePointManager.Expect100Continue = false;
|
||||
|
||||
// Trakt requests sometimes fail without this
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -129,7 +127,6 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
|
||||
private void AddIpv4Option(HttpWebRequest request, HttpRequestOptions options)
|
||||
{
|
||||
#if NET46
|
||||
request.ServicePoint.BindIPEndPointDelegate = (servicePount, remoteEndPoint, retryCount) =>
|
||||
{
|
||||
if (remoteEndPoint.AddressFamily == AddressFamily.InterNetwork)
|
||||
@@ -138,7 +135,6 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
}
|
||||
throw new InvalidOperationException("no IPv4 address");
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
private WebRequest GetRequest(HttpRequestOptions options, string method)
|
||||
@@ -165,7 +161,6 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
|
||||
AddRequestHeaders(httpWebRequest, options);
|
||||
|
||||
#if NET46
|
||||
if (options.EnableHttpCompression)
|
||||
{
|
||||
if (options.DecompressionMethod.HasValue)
|
||||
@@ -183,48 +178,33 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
{
|
||||
httpWebRequest.AutomaticDecompression = DecompressionMethods.None;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if NET46
|
||||
request.CachePolicy = new System.Net.Cache.RequestCachePolicy(System.Net.Cache.RequestCacheLevel.BypassCache);
|
||||
#endif
|
||||
|
||||
if (httpWebRequest != null)
|
||||
{
|
||||
if (options.EnableKeepAlive)
|
||||
{
|
||||
#if NET46
|
||||
httpWebRequest.KeepAlive = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
request.Method = method;
|
||||
#if NET46
|
||||
request.Timeout = options.TimeoutMs;
|
||||
#endif
|
||||
|
||||
if (httpWebRequest != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(options.Host))
|
||||
{
|
||||
#if NET46
|
||||
httpWebRequest.Host = options.Host;
|
||||
#elif NETSTANDARD1_6
|
||||
httpWebRequest.Headers["Host"] = options.Host;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(options.Referer))
|
||||
{
|
||||
#if NET46
|
||||
httpWebRequest.Referer = options.Referer;
|
||||
#elif NETSTANDARD1_6
|
||||
httpWebRequest.Headers["Referer"] = options.Referer;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,9 +215,7 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
{
|
||||
request.Credentials = GetCredential(url, parts[0], parts[1]);
|
||||
// TODO: .net core ??
|
||||
#if NET46
|
||||
request.PreAuthenticate = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,11 +247,7 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
}
|
||||
else
|
||||
{
|
||||
#if NET46
|
||||
request.Headers.Set(header.Key, header.Value);
|
||||
#elif NETSTANDARD1_6
|
||||
request.Headers[header.Key] = header.Value;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,11 +259,7 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
|
||||
private void SetUserAgent(HttpWebRequest request, string userAgent)
|
||||
{
|
||||
#if NET46
|
||||
request.UserAgent = userAgent;
|
||||
#elif NETSTANDARD1_6
|
||||
request.Headers["User-Agent"] = userAgent;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -465,9 +435,7 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
|
||||
httpWebRequest.ContentType = options.RequestContentType ?? "application/x-www-form-urlencoded";
|
||||
|
||||
#if NET46
|
||||
httpWebRequest.ContentLength = bytes.Length;
|
||||
#endif
|
||||
(await httpWebRequest.GetRequestStreamAsync().ConfigureAwait(false)).Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -950,7 +918,6 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
|
||||
private Task<WebResponse> GetResponseAsync(WebRequest request, TimeSpan timeout)
|
||||
{
|
||||
#if NET46
|
||||
var taskCompletion = new TaskCompletionSource<WebResponse>();
|
||||
|
||||
Task<WebResponse> asyncTask = Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null);
|
||||
@@ -963,9 +930,6 @@ namespace Emby.Common.Implementations.HttpClientManager
|
||||
asyncTask.ContinueWith(callback.OnError, TaskContinuationOptions.OnlyOnFaulted);
|
||||
|
||||
return taskCompletion.Task;
|
||||
#endif
|
||||
|
||||
return request.GetResponseAsync();
|
||||
}
|
||||
|
||||
private static void TimeoutCallback(object state, bool timedOut)
|
||||
|
||||
@@ -188,16 +188,7 @@ namespace Emby.Common.Implementations.Net
|
||||
|
||||
try
|
||||
{
|
||||
#if NET46
|
||||
retVal.ExclusiveAddressUse = false;
|
||||
#else
|
||||
// The ExclusiveAddressUse acceptSocket option is a Windows-specific option that, when set to "true," tells Windows not to allow another acceptSocket to use the same local address as this acceptSocket
|
||||
// See https://github.com/dotnet/corefx/pull/11509 for more details
|
||||
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows))
|
||||
{
|
||||
retVal.ExclusiveAddressUse = false;
|
||||
}
|
||||
#endif
|
||||
retVal.ExclusiveAddressUse = false;
|
||||
//retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
|
||||
retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
|
||||
retVal.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastTimeToLive, multicastTimeToLive);
|
||||
|
||||
@@ -116,129 +116,64 @@ namespace Emby.Common.Implementations.Net
|
||||
private set;
|
||||
}
|
||||
|
||||
public Task<SocketReceiveResult> ReceiveAsync(CancellationToken cancellationToken)
|
||||
private readonly AsyncCallback _defaultAsyncCallback = (i) => { };
|
||||
|
||||
public IAsyncResult BeginReceive(byte[] buffer, int offset, int count, AsyncCallback callback)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
var tcs = new TaskCompletionSource<SocketReceiveResult>();
|
||||
EndPoint receivedFromEndPoint = new IPEndPoint(IPAddress.Any, 0);
|
||||
|
||||
var state = new AsyncReceiveState(_Socket, receivedFromEndPoint);
|
||||
state.TaskCompletionSource = tcs;
|
||||
|
||||
cancellationToken.Register(() => tcs.TrySetCanceled());
|
||||
|
||||
_receiveSocketAsyncEventArgs.RemoteEndPoint = receivedFromEndPoint;
|
||||
_currentReceiveTaskCompletionSource = tcs;
|
||||
|
||||
try
|
||||
{
|
||||
var willRaiseEvent = _Socket.ReceiveFromAsync(_receiveSocketAsyncEventArgs);
|
||||
|
||||
if (!willRaiseEvent)
|
||||
{
|
||||
_receiveSocketAsyncEventArgs_Completed(this, _receiveSocketAsyncEventArgs);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
|
||||
return tcs.Task;
|
||||
return _Socket.BeginReceiveFrom(buffer, offset, count, SocketFlags.None, ref receivedFromEndPoint, callback, buffer);
|
||||
}
|
||||
|
||||
public Task SendAsync(byte[] buffer, int size, IpEndPointInfo endPoint, CancellationToken cancellationToken)
|
||||
public SocketReceiveResult EndReceive(IAsyncResult result)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0);
|
||||
EndPoint remoteEndPoint = (EndPoint)sender;
|
||||
|
||||
if (buffer == null) throw new ArgumentNullException("messageData");
|
||||
if (endPoint == null) throw new ArgumentNullException("endPoint");
|
||||
var receivedBytes = _Socket.EndReceiveFrom(result, ref remoteEndPoint);
|
||||
|
||||
var buffer = (byte[]) result.AsyncState;
|
||||
|
||||
return new SocketReceiveResult
|
||||
{
|
||||
ReceivedBytes = receivedBytes,
|
||||
RemoteEndPoint = ToIpEndPointInfo((IPEndPoint)remoteEndPoint),
|
||||
Buffer = buffer,
|
||||
LocalIPAddress = LocalIPAddress
|
||||
};
|
||||
}
|
||||
|
||||
public Task<SocketReceiveResult> ReceiveAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
|
||||
{
|
||||
var result = BeginReceive(buffer, offset, count, _defaultAsyncCallback);
|
||||
|
||||
return Task.Factory.FromAsync(result, EndReceive);
|
||||
}
|
||||
|
||||
public Task<SocketReceiveResult> ReceiveAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var buffer = new byte[8192];
|
||||
|
||||
return ReceiveAsync(buffer, 0, buffer.Length, cancellationToken);
|
||||
}
|
||||
|
||||
public Task SendToAsync(byte[] buffer, int offset, int size, IpEndPointInfo endPoint, CancellationToken cancellationToken)
|
||||
{
|
||||
var result = BeginSendTo(buffer, offset, size, endPoint, _defaultAsyncCallback, null);
|
||||
|
||||
return Task.Factory.FromAsync(result, EndSendTo);
|
||||
}
|
||||
|
||||
public IAsyncResult BeginSendTo(byte[] buffer, int offset, int size, IpEndPointInfo endPoint, AsyncCallback callback, object state)
|
||||
{
|
||||
var ipEndPoint = NetworkManager.ToIPEndPoint(endPoint);
|
||||
|
||||
#if NETSTANDARD1_6
|
||||
|
||||
if (size != buffer.Length)
|
||||
{
|
||||
byte[] copy = new byte[size];
|
||||
Buffer.BlockCopy(buffer, 0, copy, 0, size);
|
||||
buffer = copy;
|
||||
}
|
||||
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
_Socket.SendTo(buffer, ipEndPoint);
|
||||
return Task.FromResult(true);
|
||||
#else
|
||||
var taskSource = new TaskCompletionSource<bool>();
|
||||
|
||||
try
|
||||
{
|
||||
_Socket.BeginSendTo(buffer, 0, size, SocketFlags.None, ipEndPoint, result =>
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
taskSource.TrySetCanceled();
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
_Socket.EndSend(result);
|
||||
taskSource.TrySetResult(true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
taskSource.TrySetException(ex);
|
||||
}
|
||||
|
||||
}, null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
taskSource.TrySetException(ex);
|
||||
}
|
||||
|
||||
return taskSource.Task;
|
||||
#endif
|
||||
//ThrowIfDisposed();
|
||||
|
||||
//if (buffer == null) throw new ArgumentNullException("messageData");
|
||||
//if (endPoint == null) throw new ArgumentNullException("endPoint");
|
||||
|
||||
//cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
//var tcs = new TaskCompletionSource<int>();
|
||||
|
||||
//cancellationToken.Register(() => tcs.TrySetCanceled());
|
||||
|
||||
//_sendSocketAsyncEventArgs.SetBuffer(buffer, 0, size);
|
||||
//_sendSocketAsyncEventArgs.RemoteEndPoint = NetworkManager.ToIPEndPoint(endPoint);
|
||||
//_currentSendTaskCompletionSource = tcs;
|
||||
|
||||
//var willRaiseEvent = _Socket.SendAsync(_sendSocketAsyncEventArgs);
|
||||
|
||||
//if (!willRaiseEvent)
|
||||
//{
|
||||
// _sendSocketAsyncEventArgs_Completed(this, _sendSocketAsyncEventArgs);
|
||||
//}
|
||||
|
||||
//return tcs.Task;
|
||||
return _Socket.BeginSendTo(buffer, offset, size, SocketFlags.None, ipEndPoint, callback, state);
|
||||
}
|
||||
|
||||
public async Task SendWithLockAsync(byte[] buffer, int size, IpEndPointInfo endPoint, CancellationToken cancellationToken)
|
||||
public int EndSendTo(IAsyncResult result)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
//await _sendLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
try
|
||||
{
|
||||
await SendAsync(buffer, size, endPoint, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
finally
|
||||
{
|
||||
//_sendLock.Release();
|
||||
}
|
||||
return _Socket.EndSendTo(result);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
@@ -274,36 +209,6 @@ namespace Emby.Common.Implementations.Net
|
||||
return NetworkManager.ToIpEndPointInfo(endpoint);
|
||||
}
|
||||
|
||||
private void ProcessResponse(IAsyncResult asyncResult)
|
||||
{
|
||||
#if NET46
|
||||
var state = asyncResult.AsyncState as AsyncReceiveState;
|
||||
try
|
||||
{
|
||||
var bytesRead = state.Socket.EndReceiveFrom(asyncResult, ref state.RemoteEndPoint);
|
||||
|
||||
var ipEndPoint = state.RemoteEndPoint as IPEndPoint;
|
||||
state.TaskCompletionSource.SetResult(
|
||||
new SocketReceiveResult
|
||||
{
|
||||
Buffer = state.Buffer,
|
||||
ReceivedBytes = bytesRead,
|
||||
RemoteEndPoint = ToIpEndPointInfo(ipEndPoint),
|
||||
LocalIPAddress = LocalIPAddress
|
||||
}
|
||||
);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
state.TaskCompletionSource.SetCanceled();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
state.TaskCompletionSource.SetException(ex);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private class AsyncReceiveState
|
||||
{
|
||||
public AsyncReceiveState(Socket socket, EndPoint remoteEndPoint)
|
||||
|
||||
@@ -2,18 +2,33 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// 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
|
||||
// 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("5a27010a-09c6-4e86-93ea-437484c10917")]
|
||||
[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.*")]
|
||||
@@ -9,18 +9,12 @@ namespace Emby.Common.Implementations.Reflection
|
||||
{
|
||||
public Stream GetManifestResourceStream(Type type, string resource)
|
||||
{
|
||||
#if NET46
|
||||
return type.Assembly.GetManifestResourceStream(resource);
|
||||
#endif
|
||||
return type.GetTypeInfo().Assembly.GetManifestResourceStream(resource);
|
||||
}
|
||||
|
||||
public string[] GetManifestResourceNames(Type type)
|
||||
{
|
||||
#if NET46
|
||||
return type.Assembly.GetManifestResourceNames();
|
||||
#endif
|
||||
return type.GetTypeInfo().Assembly.GetManifestResourceNames();
|
||||
}
|
||||
|
||||
public Assembly[] GetCurrentAssemblies()
|
||||
|
||||
@@ -78,18 +78,11 @@ namespace Emby.Common.Implementations.Serialization
|
||||
/// <param name="stream">The stream.</param>
|
||||
public void SerializeToStream(object obj, Stream stream)
|
||||
{
|
||||
#if NET46
|
||||
using (var writer = new XmlTextWriter(stream, null))
|
||||
using (var writer = new XmlTextWriter(stream, null))
|
||||
{
|
||||
writer.Formatting = Formatting.Indented;
|
||||
SerializeToWriter(obj, writer);
|
||||
}
|
||||
#else
|
||||
using (var writer = XmlWriter.Create(stream))
|
||||
{
|
||||
SerializeToWriter(obj, writer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,9 +11,7 @@ namespace Emby.Common.Implementations.Xml
|
||||
|
||||
if (!enableValidation)
|
||||
{
|
||||
#if NET46
|
||||
settings.ValidationType = ValidationType.None;
|
||||
#endif
|
||||
}
|
||||
|
||||
return settings;
|
||||
|
||||
7
Emby.Common.Implementations/packages.config
Normal file
7
Emby.Common.Implementations/packages.config
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="NLog" version="4.4.3" targetFramework="net462" />
|
||||
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net462" />
|
||||
<package id="SharpCompress" version="0.14.0" targetFramework="net462" />
|
||||
<package id="SimpleInjector" version="4.0.7" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,71 +0,0 @@
|
||||
{
|
||||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
"net46": {
|
||||
"frameworkAssemblies": {
|
||||
"System.Collections": "4.0.0.0",
|
||||
"System.IO": "4.0.0.0",
|
||||
"System.Net": "4.0.0.0",
|
||||
"System.Net.Http": "4.0.0.0",
|
||||
"System.Net.Primitives": "4.0.0.0",
|
||||
"System.Net.Http.WebRequest": "4.0.0.0",
|
||||
"System.Reflection": "4.0.0.0",
|
||||
"System.Runtime": "4.0.0.0",
|
||||
"System.Runtime.Extensions": "4.0.0.0",
|
||||
"System.Text.Encoding": "4.0.0.0",
|
||||
"System.Threading": "4.0.0.0",
|
||||
"System.Threading.Tasks": "4.0.0.0",
|
||||
"System.Xml.ReaderWriter": "4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"SimpleInjector": "3.2.4",
|
||||
"ServiceStack.Text": "4.5.4",
|
||||
"NLog": "4.4.0-betaV15",
|
||||
"sharpcompress": "0.14.0",
|
||||
"MediaBrowser.Model": {
|
||||
"target": "project"
|
||||
},
|
||||
"MediaBrowser.Common": {
|
||||
"target": "project"
|
||||
}
|
||||
}
|
||||
},
|
||||
"netstandard1.6": {
|
||||
"imports": "dnxcore50",
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.6.1",
|
||||
"System.IO.FileSystem.DriveInfo": "4.3.0",
|
||||
"System.Diagnostics.Process": "4.3.0",
|
||||
"System.Threading.Timer": "4.3.0",
|
||||
"System.Net.Requests": "4.3.0",
|
||||
"System.Xml.ReaderWriter": "4.3.0",
|
||||
"System.Xml.XmlSerializer": "4.3.0",
|
||||
"System.Net.Http": "4.3.2",
|
||||
"System.Net.Primitives": "4.3.0",
|
||||
"System.Net.Sockets": "4.3.0",
|
||||
"System.Net.NetworkInformation": "4.3.0",
|
||||
"System.Net.NameResolution": "4.3.0",
|
||||
"System.Runtime.InteropServices.RuntimeInformation": "4.3.0",
|
||||
"System.Reflection": "4.3.0",
|
||||
"System.Reflection.Primitives": "4.3.0",
|
||||
"System.Runtime.Loader": "4.3.0",
|
||||
"SimpleInjector": "3.2.4",
|
||||
"ServiceStack.Text.Core": "1.0.27",
|
||||
"NLog": "4.4.0-betaV15",
|
||||
"sharpcompress": "0.14.0",
|
||||
"System.AppDomain": "2.0.11",
|
||||
"MediaBrowser.Model": {
|
||||
"target": "project"
|
||||
},
|
||||
"MediaBrowser.Common": {
|
||||
"target": "project"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user