update components

This commit is contained in:
Luke Pulverenti 2016-10-28 14:35:17 -04:00
parent f6acc5fbff
commit 89ff1f2af6
18 changed files with 553 additions and 728 deletions

View File

@ -62,11 +62,6 @@
<Compile Include="TSStreamFile.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if $(ConfigurationName) == Release (
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i
)</PostBuildEvent>
</PropertyGroup>
<!-- 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">

View File

@ -61,11 +61,6 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>if $(ConfigurationName) == Release (
xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i
)</PostBuildEvent>
</PropertyGroup>
<!-- 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">

View File

@ -1,6 +1,5 @@
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Implementations.Archiving;
using MediaBrowser.Common.Implementations.Devices;
using MediaBrowser.Common.Implementations.IO;
using MediaBrowser.Common.Implementations.ScheduledTasks;
@ -158,12 +157,6 @@ namespace MediaBrowser.Common.Implementations
protected IFileSystem FileSystemManager { get; private set; }
/// <summary>
/// Gets or sets the zip client.
/// </summary>
/// <value>The zip client.</value>
protected IZipClient ZipClient { get; private set; }
protected IIsoManager IsoManager { get; private set; }
/// <summary>
@ -243,14 +236,7 @@ namespace MediaBrowser.Common.Implementations
JsonSerializer = CreateJsonSerializer();
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
MemoryStreamProvider = new RecyclableMemoryStreamProvider();
}
else
{
MemoryStreamProvider = new MemoryStreamProvider();
}
MemoryStreamProvider = CreateMemoryStreamProvider();
OnLoggerLoaded(true);
LogManager.LoggerLoaded += (s, e) => OnLoggerLoaded(false);
@ -283,6 +269,8 @@ namespace MediaBrowser.Common.Implementations
progress.Report(100);
}
protected abstract IMemoryStreamProvider CreateMemoryStreamProvider();
protected virtual void OnLoggerLoaded(bool isFirstLoad)
{
Logger.Info("Application version: {0}", ApplicationVersion);
@ -531,9 +519,6 @@ namespace MediaBrowser.Common.Implementations
InstallationManager = new InstallationManager(LogManager.GetLogger("InstallationManager"), this, ApplicationPaths, HttpClient, JsonSerializer, SecurityManager, ConfigurationManager, FileSystemManager);
RegisterSingleInstance(InstallationManager);
ZipClient = new ZipClient(FileSystemManager);
RegisterSingleInstance(ZipClient);
IsoManager = new IsoManager();
RegisterSingleInstance(IsoManager);

View File

@ -45,30 +45,21 @@
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.1.1.0.0\lib\net45\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.8\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.3.10\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Patterns.Logging">
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.10.2.0, Culture=neutral, PublicKeyToken=beaf6f427e128133, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\SharpCompress\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector, Version=3.2.2.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.3.2.2\lib\net45\SimpleInjector.dll</HintPath>
<Reference Include="SimpleInjector, Version=3.2.4.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.3.2.4\lib\net45\SimpleInjector.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net" />
<Reference Include="System.Xml" />
<Reference Include="ServiceStack.Text">
@ -79,7 +70,6 @@
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="Archiving\ZipClient.cs" />
<Compile Include="BaseApplicationHost.cs" />
<Compile Include="BaseApplicationPaths.cs" />
<Compile Include="Configuration\BaseConfigurationManager.cs" />
@ -91,7 +81,6 @@
<Compile Include="IO\IsoManager.cs" />
<Compile Include="IO\LnkShortcutHandler.cs" />
<Compile Include="IO\ManagedFileSystem.cs" />
<Compile Include="IO\MemoryStreamProvider.cs" />
<Compile Include="IO\WindowsFileSystem.cs" />
<Compile Include="Logging\LogHelper.cs" />
<Compile Include="Logging\NLogger.cs" />

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.IO.RecyclableMemoryStream" version="1.1.0.0" targetFramework="net45" />
<package id="NLog" version="4.3.8" targetFramework="net45" />
<package id="NLog" version="4.3.10" targetFramework="net46" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
<package id="SimpleInjector" version="3.2.2" targetFramework="net45" />
<package id="SimpleInjector" version="3.2.4" targetFramework="net46" />
</packages>

View File

@ -39,8 +39,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Rssdp.NetFx40">
<HintPath>..\ThirdParty\rssdp\Rssdp.NetFx40.dll</HintPath>
<Reference Include="Rssdp.Native">
<HintPath>..\ThirdParty\rssdp\Rssdp.Native.dll</HintPath>
</Reference>
<Reference Include="Rssdp.Portable">
<HintPath>..\ThirdParty\rssdp\Rssdp.Portable.dll</HintPath>

View File

@ -26,7 +26,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
return new Tuple<List<string>, List<string>>(decoders, encoders);
}
public bool ValidateVersion(string encoderAppPath)
public bool ValidateVersion(string encoderAppPath, bool logOutput)
{
string output = string.Empty;
try
@ -37,6 +37,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
}
if (logOutput)
{
_logger.Info("ffmpeg info: {0}", output ?? string.Empty);
}
if (string.IsNullOrWhiteSpace(output))
{
return false;

View File

@ -241,7 +241,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
path = newPaths.Item1;
if (!ValidateVersion(path))
if (!ValidateVersion(path, true))
{
throw new ResourceNotFoundException("ffmpeg version 3.0 or greater is required.");
}
@ -253,9 +253,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
Init();
}
private bool ValidateVersion(string path)
private bool ValidateVersion(string path, bool logOutput)
{
return new EncoderValidator(_logger).ValidateVersion(path);
return new EncoderValidator(_logger).ValidateVersion(path, logOutput);
}
private void ConfigureEncoderPaths()
@ -307,7 +307,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
string encoderPath = null;
string probePath = null;
if (_hasExternalEncoder && ValidateVersion(_originalFFMpegPath))
if (_hasExternalEncoder && ValidateVersion(_originalFFMpegPath, true))
{
encoderPath = _originalFFMpegPath;
probePath = _originalFFProbePath;
@ -315,7 +315,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
if (string.IsNullOrWhiteSpace(encoderPath))
{
if (ValidateVersion("ffmpeg") && ValidateVersion("ffprobe"))
if (ValidateVersion("ffmpeg", true) && ValidateVersion("ffprobe", false))
{
encoderPath = "ffmpeg";
probePath = "ffprobe";

View File

@ -160,5 +160,17 @@ namespace MediaBrowser.Model.Services
//}
}
}
private string GetQueryStringValue(NameValuePair pair)
{
return pair.Name + "=" + pair.Value;
}
public override String ToString()
{
var vals = this.Select(GetQueryStringValue).ToArray();
return string.Join("&", vals);
}
}
}

View File

@ -1,13 +1,13 @@
using MediaBrowser.Model.IO;
using System.IO;
using MediaBrowser.Model.IO;
using SharpCompress.Archive.Rar;
using SharpCompress.Archive.SevenZip;
using SharpCompress.Archive.Tar;
using SharpCompress.Common;
using SharpCompress.Reader;
using SharpCompress.Reader.Zip;
using System.IO;
namespace MediaBrowser.Common.Implementations.Archiving
namespace MediaBrowser.Server.Implementations.Archiving
{
/// <summary>
/// Class DotNetZipClient

View File

@ -1,9 +1,8 @@
using System.IO;
using MediaBrowser.Common.IO;
using MediaBrowser.Model.IO;
using Microsoft.IO;
namespace MediaBrowser.Common.Implementations.IO
namespace MediaBrowser.Server.Implementations.IO
{
public class RecyclableMemoryStreamProvider : IMemoryStreamProvider
{

View File

@ -205,7 +205,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
private bool EncodeVideo(MediaSourceInfo mediaSource)
{
if (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings)
if (_liveTvOptions.EnableOriginalVideoWithEncodedRecordings)
{
return false;
}

View File

@ -57,14 +57,22 @@
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.55\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.1.1.0.0\lib\net45\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Patterns.Logging">
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Api.Swagger">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Api.Swagger.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector, Version=3.2.2.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.3.2.2\lib\net45\SimpleInjector.dll</HintPath>
<Reference Include="SharpCompress, Version=0.10.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\SharpCompress\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="SimpleInjector, Version=3.2.4.0, Culture=neutral, PublicKeyToken=984cb50dea722e99, processorArchitecture=MSIL">
<HintPath>..\packages\SimpleInjector.3.2.4\lib\net45\SimpleInjector.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SocketHttpListener, Version=1.0.6109.26162, Culture=neutral, processorArchitecture=MSIL">
@ -103,6 +111,7 @@
</Compile>
<Compile Include="Activity\ActivityManager.cs" />
<Compile Include="Activity\ActivityRepository.cs" />
<Compile Include="Archiving\ZipClient.cs" />
<Compile Include="Branding\BrandingConfigurationFactory.cs" />
<Compile Include="Channels\ChannelConfigurations.cs" />
<Compile Include="Channels\ChannelDynamicMediaSourceProvider.cs" />
@ -170,6 +179,7 @@
<Compile Include="Intros\DefaultIntroProvider.cs" />
<Compile Include="IO\FileRefresher.cs" />
<Compile Include="IO\LibraryMonitor.cs" />
<Compile Include="IO\MemoryStreamProvider.cs" />
<Compile Include="IO\ThrottledStream.cs" />
<Compile Include="Library\CoreResolutionIgnoreRule.cs" />
<Compile Include="Library\LibraryManager.cs" />

View File

@ -87,9 +87,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _deleteAncestorsCommand;
private IDbCommand _saveAncestorCommand;
private IDbCommand _deleteUserDataKeysCommand;
private IDbCommand _saveUserDataKeysCommand;
private IDbCommand _deleteItemValuesCommand;
private IDbCommand _saveItemValuesCommand;
@ -169,8 +166,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
"create index if not exists idx_AncestorIds2 on AncestorIds(AncestorIdText)",
"create table if not exists UserDataKeys (ItemId GUID, UserDataKey TEXT Priority INT, PRIMARY KEY (ItemId, UserDataKey))",
"create table if not exists ItemValues (ItemId GUID, Type INT, Value TEXT, CleanValue TEXT)",
"create table if not exists ProviderIds (ItemId GUID, Name TEXT, Value TEXT, PRIMARY KEY (ItemId, Name))",
@ -192,6 +187,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"create index if not exists idx_mediastreams1 on mediastreams(ItemId)",
//"drop table if exists UserDataKeys"
};
_connection.RunQueries(queries, Logger);
@ -289,7 +286,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(Logger, "TypedBaseItems", "ThemeSongIds", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "ThemeVideoIds", "Text");
_connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT");
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
_connection.AddColumn(Logger, ChaptersTableName, "ImageDateModified", "DATETIME");
@ -316,6 +312,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"drop index if exists idx_ItemValues3",
"drop index if exists idx_ItemValues4",
"drop index if exists idx_ItemValues5",
"drop index if exists idx_UserDataKeys3",
"drop table if exists UserDataKeys",
"create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)",
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
@ -347,10 +345,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
// items by name
"create index if not exists idx_ItemValues6 on ItemValues(ItemId,Type,CleanValue)",
"create index if not exists idx_ItemValues7 on ItemValues(Type,CleanValue,ItemId)",
// covering index
"create index if not exists idx_UserDataKeys3 on UserDataKeys(ItemId,Priority,UserDataKey)"
"create index if not exists idx_ItemValues7 on ItemValues(Type,CleanValue,ItemId)"
};
_connection.RunQueries(postQueries, Logger);
@ -653,17 +648,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
_updateInheritedTagsCommand.Parameters.Add(_updateInheritedTagsCommand, "@Guid");
_updateInheritedTagsCommand.Parameters.Add(_updateInheritedTagsCommand, "@InheritedTags");
// user data
_deleteUserDataKeysCommand = _connection.CreateCommand();
_deleteUserDataKeysCommand.CommandText = "delete from UserDataKeys where ItemId=@Id";
_deleteUserDataKeysCommand.Parameters.Add(_deleteUserDataKeysCommand, "@Id");
_saveUserDataKeysCommand = _connection.CreateCommand();
_saveUserDataKeysCommand.CommandText = "insert into UserDataKeys (ItemId, UserDataKey, Priority) values (@ItemId, @UserDataKey, @Priority)";
_saveUserDataKeysCommand.Parameters.Add(_saveUserDataKeysCommand, "@ItemId");
_saveUserDataKeysCommand.Parameters.Add(_saveUserDataKeysCommand, "@UserDataKey");
_saveUserDataKeysCommand.Parameters.Add(_saveUserDataKeysCommand, "@Priority");
// item values
_deleteItemValuesCommand = _connection.CreateCommand();
_deleteItemValuesCommand.CommandText = "delete from ItemValues where ItemId=@Id";
@ -1071,7 +1055,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
UpdateAncestors(item.Id, item.GetAncestorIds().Distinct().ToList(), transaction);
}
UpdateUserDataKeys(item.Id, item.GetUserDataKeys().Distinct(StringComparer.OrdinalIgnoreCase).ToList(), transaction);
UpdateImages(item.Id, item.ImageInfos, transaction);
UpdateProviderIds(item.Id, item.ProviderIds, transaction);
UpdateItemValues(item.Id, GetItemValuesToSave(item), transaction);
@ -2343,12 +2326,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
return string.Empty;
}
if (_config.Configuration.SchemaVersion >= 96)
{
return " left join UserDataDb.UserData on UserDataKey=UserDataDb.UserData.Key And (UserId=@UserId)";
}
return " left join UserDataDb.UserData on (select UserDataKey from UserDataKeys where ItemId=Guid order by Priority LIMIT 1)=UserDataDb.UserData.Key And (UserId=@UserId)";
return " left join UserDataDb.UserData on UserDataKey=UserDataDb.UserData.Key And (UserId=@UserId)";
}
private string GetGroupBy(InternalItemsQuery query)
@ -4176,11 +4154,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
_deleteAncestorsCommand.Transaction = transaction;
_deleteAncestorsCommand.ExecuteNonQuery();
// Delete user data keys
_deleteUserDataKeysCommand.GetParameter(0).Value = id;
_deleteUserDataKeysCommand.Transaction = transaction;
_deleteUserDataKeysCommand.ExecuteNonQuery();
// Delete item values
_deleteItemValuesCommand.GetParameter(0).Value = id;
_deleteItemValuesCommand.Transaction = transaction;
@ -4949,39 +4922,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
private void UpdateUserDataKeys(Guid itemId, List<string> keys, IDbTransaction transaction)
{
if (itemId == Guid.Empty)
{
throw new ArgumentNullException("itemId");
}
if (keys == null)
{
throw new ArgumentNullException("keys");
}
CheckDisposed();
// First delete
_deleteUserDataKeysCommand.GetParameter(0).Value = itemId;
_deleteUserDataKeysCommand.Transaction = transaction;
_deleteUserDataKeysCommand.ExecuteNonQuery();
var index = 0;
foreach (var key in keys)
{
_saveUserDataKeysCommand.GetParameter(0).Value = itemId;
_saveUserDataKeysCommand.GetParameter(1).Value = key;
_saveUserDataKeysCommand.GetParameter(2).Value = index;
index++;
_saveUserDataKeysCommand.Transaction = transaction;
_saveUserDataKeysCommand.ExecuteNonQuery();
}
}
public async Task UpdatePeople(Guid itemId, List<PersonInfo> people)
{
if (itemId == Guid.Empty)

View File

@ -4,7 +4,8 @@
<package id="ini-parser" version="2.3.0" targetFramework="net45" />
<package id="Interfaces.IO" version="1.0.0.5" targetFramework="net45" />
<package id="MediaBrowser.Naming" version="1.0.0.55" targetFramework="net45" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="1.1.0.0" targetFramework="net46" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
<package id="SimpleInjector" version="3.2.2" targetFramework="net45" />
<package id="SimpleInjector" version="3.2.4" targetFramework="net46" />
<package id="SocketHttpListener" version="1.0.0.40" targetFramework="net45" />
</packages>

View File

@ -117,6 +117,7 @@ using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Services;
using MediaBrowser.Model.Social;
using MediaBrowser.Model.Xml;
using MediaBrowser.Server.Implementations.Archiving;
using MediaBrowser.Server.Implementations.Reflection;
using MediaBrowser.Server.Implementations.Xml;
using OpenSubtitlesHandler;
@ -222,6 +223,12 @@ namespace MediaBrowser.Server.Startup.Common
private IMediaSourceManager MediaSourceManager { get; set; }
private IPlaylistManager PlaylistManager { get; set; }
/// <summary>
/// Gets or sets the zip client.
/// </summary>
/// <value>The zip client.</value>
protected IZipClient ZipClient { get; private set; }
private readonly StartupOptions _startupOptions;
private readonly string _releaseAssetFilename;
@ -380,6 +387,16 @@ namespace MediaBrowser.Server.Startup.Common
LogManager.RemoveConsoleOutput();
}
protected override IMemoryStreamProvider CreateMemoryStreamProvider()
{
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
return new RecyclableMemoryStreamProvider();
}
return new MemoryStreamProvider();
}
protected override IJsonSerializer CreateJsonSerializer()
{
var result = base.CreateJsonSerializer();
@ -625,6 +642,9 @@ namespace MediaBrowser.Server.Startup.Common
{
await base.RegisterResources(progress).ConfigureAwait(false);
ZipClient = new ZipClient(FileSystemManager);
RegisterSingleInstance(ZipClient);
RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory(LogManager, FileSystemManager, JsonSerializer));
RegisterSingleInstance<IServerApplicationHost>(this);

View File

@ -1,11 +1,11 @@
{
{
"supports": {
"net46.app": {},
"dnxcore50.app": {}
},
"dependencies": {
"Microsoft.NETCore": "5.0.0",
"Microsoft.NETCore.Portable.Compatibility": "1.0.0"
"Microsoft.NETCore.Portable.Compatibility": "1.0.1"
},
"frameworks": {
"dotnet": {

File diff suppressed because it is too large Load Diff