Merge pull request #2262 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-10-31 13:23:01 -04:00 committed by GitHub
commit e2e70c3539
42 changed files with 4342 additions and 583 deletions

View File

@ -408,13 +408,13 @@ namespace Emby.Common.Implementations.IO
{ {
if (isHidden) if (isHidden)
{ {
FileAttributes attributes = File.GetAttributes(path); File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
attributes = RemoveAttribute(attributes, FileAttributes.Hidden);
File.SetAttributes(path, attributes);
} }
else else
{ {
File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden); FileAttributes attributes = File.GetAttributes(path);
attributes = RemoveAttribute(attributes, FileAttributes.Hidden);
File.SetAttributes(path, attributes);
} }
} }
} }

View File

@ -51,7 +51,6 @@ namespace Emby.Common.Implementations.Serialization
/// <param name="writer">The writer.</param> /// <param name="writer">The writer.</param>
private void SerializeToWriter(object obj, XmlWriter writer) private void SerializeToWriter(object obj, XmlWriter writer)
{ {
//writer.Formatting = Formatting.Indented;
var netSerializer = GetSerializer(obj.GetType()); var netSerializer = GetSerializer(obj.GetType());
netSerializer.Serialize(writer, obj); netSerializer.Serialize(writer, obj);
} }
@ -78,10 +77,18 @@ namespace Emby.Common.Implementations.Serialization
/// <param name="stream">The stream.</param> /// <param name="stream">The stream.</param>
public void SerializeToStream(object obj, Stream stream) public void SerializeToStream(object obj, Stream stream)
{ {
#if NET46
using (var writer = new XmlTextWriter(stream, null))
{
writer.Formatting = System.Xml.Formatting.Indented;
SerializeToWriter(obj, writer);
}
#else
using (var writer = XmlWriter.Create(stream)) using (var writer = XmlWriter.Create(stream))
{ {
SerializeToWriter(obj, writer); SerializeToWriter(obj, writer);
} }
#endif
} }
/// <summary> /// <summary>

View File

@ -44,8 +44,8 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="taglib-sharp"> <Reference Include="TagLib.Portable">
<HintPath>..\ThirdParty\taglib\taglib-sharp.dll</HintPath> <HintPath>..\ThirdParty\taglib\TagLib.Portable.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -21,6 +21,8 @@ using MediaBrowser.Common.IO;
using MediaBrowser.Controller.IO; using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Net; using MediaBrowser.Model.Net;
using TagLib;
using File = System.IO.File;
namespace Emby.Drawing namespace Emby.Drawing
{ {
@ -578,7 +580,7 @@ namespace Emby.Drawing
{ {
try try
{ {
using (var file = TagLib.File.Create(path)) using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(path), _fileSystem.OpenRead(path), null)))
{ {
var image = file as TagLib.Image.File; var image = file as TagLib.Image.File;
@ -780,40 +782,38 @@ namespace Emby.Drawing
// All enhanced images are saved as png to allow transparency // All enhanced images are saved as png to allow transparency
var enhancedImagePath = GetCachePath(EnhancedImageCachePath, cacheGuid + ".png"); var enhancedImagePath = GetCachePath(EnhancedImageCachePath, cacheGuid + ".png");
var semaphore = GetLock(enhancedImagePath);
await semaphore.WaitAsync().ConfigureAwait(false);
// Check again in case of contention // Check again in case of contention
if (_fileSystem.FileExists(enhancedImagePath)) if (_fileSystem.FileExists(enhancedImagePath))
{ {
semaphore.Release();
return enhancedImagePath; return enhancedImagePath;
} }
var imageProcessingLockTaken = false;
try
{
_fileSystem.CreateDirectory(Path.GetDirectoryName(enhancedImagePath)); _fileSystem.CreateDirectory(Path.GetDirectoryName(enhancedImagePath));
var tmpPath = Path.Combine(_appPaths.TempDirectory, Path.ChangeExtension(Guid.NewGuid().ToString(), Path.GetExtension(enhancedImagePath)));
_fileSystem.CreateDirectory(Path.GetDirectoryName(tmpPath));
await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false); await _imageProcessingSemaphore.WaitAsync().ConfigureAwait(false);
imageProcessingLockTaken = true; try
{
await ExecuteImageEnhancers(supportedEnhancers, originalImagePath, tmpPath, item, imageType, imageIndex).ConfigureAwait(false);
await ExecuteImageEnhancers(supportedEnhancers, originalImagePath, enhancedImagePath, item, imageType, imageIndex).ConfigureAwait(false); try
{
File.Copy(tmpPath, enhancedImagePath, true);
}
catch
{
}
} }
finally finally
{
if (imageProcessingLockTaken)
{ {
_imageProcessingSemaphore.Release(); _imageProcessingSemaphore.Release();
} }
semaphore.Release(); return tmpPath;
}
return enhancedImagePath;
} }
/// <summary> /// <summary>
@ -838,21 +838,6 @@ namespace Emby.Drawing
} }
} }
/// <summary>
/// The _semaphoreLocks
/// </summary>
private readonly ConcurrentDictionary<string, SemaphoreSlim> _semaphoreLocks = new ConcurrentDictionary<string, SemaphoreSlim>();
/// <summary>
/// Gets the lock.
/// </summary>
/// <param name="filename">The filename.</param>
/// <returns>System.Object.</returns>
private SemaphoreSlim GetLock(string filename)
{
return _semaphoreLocks.GetOrAdd(filename, key => new SemaphoreSlim(1, 1));
}
/// <summary> /// <summary>
/// Gets the cache path. /// Gets the cache path.
/// </summary> /// </summary>

View File

@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Emby.Photos</RootNamespace> <RootNamespace>Emby.Photos</RootNamespace>
<AssemblyName>Emby.Photos</AssemblyName> <AssemblyName>Emby.Photos</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -31,16 +32,8 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="TagLib.Portable">
<Reference Include="System.Core" /> <HintPath>..\ThirdParty\taglib\TagLib.Portable.dll</HintPath>
<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" />
<Reference Include="taglib-sharp">
<HintPath>..\ThirdParty\taglib\taglib-sharp.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -61,7 +54,7 @@
<Name>MediaBrowser.Model</Name> <Name>MediaBrowser.Model</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="EmitMSBuildWarning" BeforeTargets="Build">
<Warning Text="Packages containing MSBuild targets and props files cannot be fully installed in projects targeting multiple frameworks. The MSBuild targets and props files have been ignored." />
</Target>
</Project>

View File

@ -1,4 +1,5 @@
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -6,6 +7,7 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using TagLib; using TagLib;
using TagLib.IFD; using TagLib.IFD;
@ -17,10 +19,12 @@ namespace Emby.Photos
public class PhotoProvider : ICustomMetadataProvider<Photo>, IHasItemChangeMonitor, IForcedProvider public class PhotoProvider : ICustomMetadataProvider<Photo>, IHasItemChangeMonitor, IForcedProvider
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
public PhotoProvider(ILogger logger) public PhotoProvider(ILogger logger, IFileSystem fileSystem)
{ {
_logger = logger; _logger = logger;
_fileSystem = fileSystem;
} }
public Task<ItemUpdateType> FetchAsync(Photo item, MetadataRefreshOptions options, CancellationToken cancellationToken) public Task<ItemUpdateType> FetchAsync(Photo item, MetadataRefreshOptions options, CancellationToken cancellationToken)
@ -31,7 +35,7 @@ namespace Emby.Photos
try try
{ {
using (var file = TagLib.File.Create(item.Path)) using (var file = TagLib.File.Create(new StreamFileAbstraction(Path.GetFileName(item.Path), _fileSystem.OpenRead(item.Path), null)))
{ {
var image = file as TagLib.Image.File; var image = file as TagLib.Image.File;

17
Emby.Photos/project.json Normal file
View File

@ -0,0 +1,17 @@
{
"frameworks":{
"netstandard1.6":{
"dependencies":{
"NETStandard.Library":"1.6.0",
}
},
".NETPortable,Version=v4.5,Profile=Profile7":{
"buildOptions": {
"define": [ ]
},
"frameworkAssemblies":{
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -40,6 +40,8 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RSSDP", "RSSDP\RSSDP.xproj"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Emby.Dlna", "Emby.Dlna\Emby.Dlna.xproj", "{F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Emby.Dlna", "Emby.Dlna\Emby.Dlna.xproj", "{F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Emby.Photos", "Emby.Photos\Emby.Photos.csproj", "{89AB4548-770D-41FD-A891-8DAFF44F452C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -137,6 +139,12 @@ Global
{F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}.Release Mono|Any CPU.Build.0 = Release|Any CPU {F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}.Release Mono|Any CPU.Build.0 = Release|Any CPU
{F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}.Release|Any CPU.ActiveCfg = Release|Any CPU {F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}.Release|Any CPU.Build.0 = Release|Any CPU {F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5}.Release|Any CPU.Build.0 = Release|Any CPU
{89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89AB4548-770D-41FD-A891-8DAFF44F452C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Any CPU.ActiveCfg = Release|Any CPU
{89AB4548-770D-41FD-A891-8DAFF44F452C}.Release Mono|Any CPU.Build.0 = Release|Any CPU
{89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89AB4548-770D-41FD-A891-8DAFF44F452C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -157,5 +165,6 @@ Global
{0A82260B-4C22-4FD2-869A-E510044E3502} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839} {0A82260B-4C22-4FD2-869A-E510044E3502} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839}
{C227ADB7-E256-4E70-A8B9-22B9E0CF4F55} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839} {C227ADB7-E256-4E70-A8B9-22B9E0CF4F55} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839}
{F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839} {F40E364D-01D9-4BBF-B82C-5D6C55E0A1F5} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839}
{89AB4548-770D-41FD-A891-8DAFF44F452C} = {8ADD772F-F0A4-4A53-9B2F-AF4A4C585839}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -119,6 +119,7 @@ namespace MediaBrowser.Api
config.EnableSimpleArtistDetection = true; config.EnableSimpleArtistDetection = true;
config.SkipDeserializationForBasicTypes = true; config.SkipDeserializationForBasicTypes = true;
config.SkipDeserializationForPrograms = true; config.SkipDeserializationForPrograms = true;
config.SkipDeserializationForAudio = true;
} }
public void Post(UpdateStartupConfiguration request) public void Post(UpdateStartupConfiguration request)

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>7d5d3d18-3b43-43e6-a5a9-ac734430affd</ProjectGuid>
<RootNamespace>MediaBrowser.Common</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -22,14 +22,10 @@ namespace MediaBrowser.Controller.Entities.Audio
IHasArtist, IHasArtist,
IHasMusicGenres, IHasMusicGenres,
IHasLookupInfo<SongInfo>, IHasLookupInfo<SongInfo>,
IHasMediaSources, IHasMediaSources
IThemeMedia
{ {
public List<ChannelMediaInfo> ChannelMediaSources { get; set; } public List<ChannelMediaInfo> ChannelMediaSources { get; set; }
public int? TotalBitrate { get; set; }
public ExtraType? ExtraType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the artist. /// Gets or sets the artist.
/// </summary> /// </summary>
@ -38,15 +34,6 @@ namespace MediaBrowser.Controller.Entities.Audio
public List<string> AlbumArtists { get; set; } public List<string> AlbumArtists { get; set; }
[IgnoreDataMember]
public bool IsThemeMedia
{
get
{
return ExtraType.HasValue && ExtraType.Value == Model.Entities.ExtraType.ThemeSong;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool EnableRefreshOnDateModifiedChange public override bool EnableRefreshOnDateModifiedChange
{ {

View File

@ -203,6 +203,19 @@ namespace MediaBrowser.Controller.Entities
get { return PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; } get { return PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; }
} }
public int? TotalBitrate { get; set; }
public ExtraType? ExtraType { get; set; }
[IgnoreDataMember]
public bool IsThemeMedia
{
get
{
return ExtraType.HasValue && (ExtraType.Value == Model.Entities.ExtraType.ThemeSong || ExtraType.Value == Model.Entities.ExtraType.ThemeVideo);
}
}
[IgnoreDataMember]
public string OriginalTitle { get; set; } public string OriginalTitle { get; set; }
/// <summary> /// <summary>
@ -1035,7 +1048,7 @@ namespace MediaBrowser.Controller.Entities
audio = dbItem; audio = dbItem;
} }
audio.ExtraType = ExtraType.ThemeSong; audio.ExtraType = MediaBrowser.Model.Entities.ExtraType.ThemeSong;
return audio; return audio;
@ -1065,7 +1078,7 @@ namespace MediaBrowser.Controller.Entities
item = dbItem; item = dbItem;
} }
item.ExtraType = ExtraType.ThemeVideo; item.ExtraType = MediaBrowser.Model.Entities.ExtraType.ThemeVideo;
return item; return item;
@ -1215,7 +1228,7 @@ namespace MediaBrowser.Controller.Entities
if (!i.IsThemeMedia) if (!i.IsThemeMedia)
{ {
i.ExtraType = ExtraType.ThemeVideo; i.ExtraType = MediaBrowser.Model.Entities.ExtraType.ThemeVideo;
subOptions.ForceSave = true; subOptions.ForceSave = true;
} }
@ -1245,7 +1258,7 @@ namespace MediaBrowser.Controller.Entities
if (!i.IsThemeMedia) if (!i.IsThemeMedia)
{ {
i.ExtraType = ExtraType.ThemeSong; i.ExtraType = MediaBrowser.Model.Entities.ExtraType.ThemeSong;
subOptions.ForceSave = true; subOptions.ForceSave = true;
} }

View File

@ -1,8 +0,0 @@

namespace MediaBrowser.Controller.Entities
{
public interface IHasOriginalTitle
{
string OriginalTitle { get; set; }
}
}

View File

@ -1,8 +0,0 @@

namespace MediaBrowser.Controller.Entities
{
public interface IThemeMedia
{
bool IsThemeMedia { get; }
}
}

View File

@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <summary> /// <summary>
/// Class Movie /// Class Movie
/// </summary> /// </summary>
public class Movie : Video, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle public class Movie : Video, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping
{ {
public List<Guid> SpecialFeatureIds { get; set; } public List<Guid> SpecialFeatureIds { get; set; }

View File

@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// <summary> /// <summary>
/// Class Series /// Class Series
/// </summary> /// </summary>
public class Series : Folder, IHasTrailers, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>, IMetadataContainer, IHasOriginalTitle public class Series : Folder, IHasTrailers, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>, IMetadataContainer
{ {
public int? AnimeSeriesIndex { get; set; } public int? AnimeSeriesIndex { get; set; }

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary> /// <summary>
/// Class Trailer /// Class Trailer
/// </summary> /// </summary>
public class Trailer : Video, IHasBudget, IHasMetascore, IHasOriginalTitle, IHasLookupInfo<TrailerInfo> public class Trailer : Video, IHasLookupInfo<TrailerInfo>
{ {
public Trailer() public Trailer()
{ {
@ -21,8 +21,6 @@ namespace MediaBrowser.Controller.Entities
public List<TrailerType> TrailerTypes { get; set; } public List<TrailerType> TrailerTypes { get; set; }
public float? Metascore { get; set; }
public List<MediaUrl> RemoteTrailers { get; set; } public List<MediaUrl> RemoteTrailers { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
@ -31,18 +29,6 @@ namespace MediaBrowser.Controller.Entities
get { return TrailerTypes.Contains(TrailerType.LocalTrailer); } get { return TrailerTypes.Contains(TrailerType.LocalTrailer); }
} }
/// <summary>
/// Gets or sets the budget.
/// </summary>
/// <value>The budget.</value>
public double? Budget { get; set; }
/// <summary>
/// Gets or sets the revenue.
/// </summary>
/// <value>The revenue.</value>
public double? Revenue { get; set; }
public override UnratedItem GetBlockUnratedType() public override UnratedItem GetBlockUnratedType()
{ {
return UnratedItem.Trailer; return UnratedItem.Trailer;

View File

@ -25,8 +25,7 @@ namespace MediaBrowser.Controller.Entities
public class Video : BaseItem, public class Video : BaseItem,
IHasAspectRatio, IHasAspectRatio,
ISupportsPlaceHolders, ISupportsPlaceHolders,
IHasMediaSources, IHasMediaSources
IThemeMedia
{ {
[IgnoreDataMember] [IgnoreDataMember]
public string PrimaryVersionId { get; set; } public string PrimaryVersionId { get; set; }
@ -36,15 +35,6 @@ namespace MediaBrowser.Controller.Entities
public List<LinkedChild> LinkedAlternateVersions { get; set; } public List<LinkedChild> LinkedAlternateVersions { get; set; }
public List<ChannelMediaInfo> ChannelMediaSources { get; set; } public List<ChannelMediaInfo> ChannelMediaSources { get; set; }
[IgnoreDataMember]
public bool IsThemeMedia
{
get
{
return ExtraType.HasValue && ExtraType.Value == Model.Entities.ExtraType.ThemeVideo;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus
{ {
@ -88,9 +78,6 @@ namespace MediaBrowser.Controller.Entities
get { return true; } get { return true; }
} }
public int? TotalBitrate { get; set; }
public ExtraType? ExtraType { get; set; }
/// <summary> /// <summary>
/// Gets or sets the timestamp. /// Gets or sets the timestamp.
/// </summary> /// </summary>
@ -113,12 +100,6 @@ namespace MediaBrowser.Controller.Entities
public bool IsShortcut { get; set; } public bool IsShortcut { get; set; }
public string ShortcutPath { get; set; } public string ShortcutPath { get; set; }
/// <summary>
/// Gets or sets the video bit rate.
/// </summary>
/// <value>The video bit rate.</value>
public int? VideoBitRate { get; set; }
/// <summary> /// <summary>
/// Gets or sets the default index of the video stream. /// Gets or sets the default index of the video stream.
/// </summary> /// </summary>

View File

@ -113,7 +113,6 @@
<Compile Include="Entities\KeywordExtensions.cs" /> <Compile Include="Entities\KeywordExtensions.cs" />
<Compile Include="Entities\IHasMediaSources.cs" /> <Compile Include="Entities\IHasMediaSources.cs" />
<Compile Include="Entities\IHasMetascore.cs" /> <Compile Include="Entities\IHasMetascore.cs" />
<Compile Include="Entities\IHasOriginalTitle.cs" />
<Compile Include="Entities\IHasProgramAttributes.cs" /> <Compile Include="Entities\IHasProgramAttributes.cs" />
<Compile Include="Entities\IHasScreenshots.cs" /> <Compile Include="Entities\IHasScreenshots.cs" />
<Compile Include="Entities\IHasSeries.cs" /> <Compile Include="Entities\IHasSeries.cs" />
@ -129,7 +128,6 @@
<Compile Include="Entities\ISupportsBoxSetGrouping.cs" /> <Compile Include="Entities\ISupportsBoxSetGrouping.cs" />
<Compile Include="Entities\ISupportsPlaceHolders.cs" /> <Compile Include="Entities\ISupportsPlaceHolders.cs" />
<Compile Include="Entities\ItemImageInfo.cs" /> <Compile Include="Entities\ItemImageInfo.cs" />
<Compile Include="Entities\IThemeMedia.cs" />
<Compile Include="Entities\LinkedChild.cs" /> <Compile Include="Entities\LinkedChild.cs" />
<Compile Include="Entities\MusicVideo.cs" /> <Compile Include="Entities\MusicVideo.cs" />
<Compile Include="Entities\IHasAwards.cs" /> <Compile Include="Entities\IHasAwards.cs" />

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>f9fe523c-6eb0-4e4d-ae26-de5c7982b063</ProjectGuid>
<RootNamespace>MediaBrowser.Controller</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -96,7 +96,5 @@ namespace MediaBrowser.LocalMetadata
return "Emby Xml"; return "Emby Xml";
} }
} }
internal static readonly SemaphoreSlim XmlParsingResourcePool = new SemaphoreSlim(4, 4);
} }
} }

View File

@ -163,13 +163,9 @@ namespace MediaBrowser.LocalMetadata.Parsers
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
var hasOriginalTitle = item as IHasOriginalTitle; if (!string.IsNullOrEmpty(val))
if (hasOriginalTitle != null)
{ {
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle)) item.OriginalTitle = val;
{
hasOriginalTitle.OriginalTitle = val;
}
} }
break; break;
} }

View File

@ -310,92 +310,86 @@ namespace MediaBrowser.LocalMetadata.Savers
writer.WriteElementString("ContentRating", item.OfficialRating); writer.WriteElementString("ContentRating", item.OfficialRating);
} }
//if (!string.IsNullOrEmpty(item.OfficialRatingDescription)) if (!string.IsNullOrEmpty(item.OfficialRatingDescription))
//{ {
// builder.Append("<MPAADescription>" + SecurityElement.Escape(item.OfficialRatingDescription) + "</MPAADescription>"); writer.WriteElementString("MPAADescription", item.OfficialRatingDescription);
//} }
//builder.Append("<Added>" + SecurityElement.Escape(item.DateCreated.ToLocalTime().ToString("G")) + "</Added>"); writer.WriteElementString("Added", item.DateCreated.ToLocalTime().ToString("G"));
//builder.Append("<LockData>" + item.IsLocked.ToString().ToLower() + "</LockData>"); writer.WriteElementString("LockData", item.IsLocked.ToString().ToLower());
//if (item.LockedFields.Count > 0) if (item.LockedFields.Count > 0)
//{ {
// builder.Append("<LockedFields>" + string.Join("|", item.LockedFields.Select(i => i.ToString()).ToArray()) + "</LockedFields>"); writer.WriteElementString("LockedFields", string.Join("|", item.LockedFields.Select(i => i.ToString()).ToArray()));
//} }
//if (!string.IsNullOrEmpty(item.DisplayMediaType)) if (!string.IsNullOrEmpty(item.DisplayMediaType))
//{ {
// builder.Append("<Type>" + SecurityElement.Escape(item.DisplayMediaType) + "</Type>"); writer.WriteElementString("Type", item.DisplayMediaType);
//} }
//if (item.CriticRating.HasValue) if (item.CriticRating.HasValue)
//{ {
// builder.Append("<CriticRating>" + SecurityElement.Escape(item.CriticRating.Value.ToString(UsCulture)) + "</CriticRating>"); writer.WriteElementString("CriticRating", item.CriticRating.Value.ToString(UsCulture));
//} }
//if (!string.IsNullOrEmpty(item.CriticRatingSummary)) if (!string.IsNullOrEmpty(item.CriticRatingSummary))
//{ {
// builder.Append("<CriticRatingSummary><![CDATA[" + item.CriticRatingSummary + "]]></CriticRatingSummary>"); writer.WriteElementString("CriticRatingSummary", item.CriticRatingSummary);
//} }
//if (!string.IsNullOrEmpty(item.Overview)) if (!string.IsNullOrEmpty(item.Overview))
//{ {
// builder.Append("<Overview><![CDATA[" + item.Overview + "]]></Overview>"); writer.WriteElementString("Overview", item.Overview);
//} }
//var hasOriginalTitle = item as IHasOriginalTitle; if (!string.IsNullOrEmpty(item.OriginalTitle))
//if (hasOriginalTitle != null) {
//{ writer.WriteElementString("OriginalTitle", item.OriginalTitle);
// if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle)) }
// { if (!string.IsNullOrEmpty(item.ShortOverview))
// builder.Append("<OriginalTitle>" + SecurityElement.Escape(hasOriginalTitle.OriginalTitle) + "</OriginalTitle>"); {
// } writer.WriteElementString("ShortOverview", item.ShortOverview);
//} }
if (!string.IsNullOrEmpty(item.CustomRating))
{
writer.WriteElementString("CustomRating", item.CustomRating);
}
//if (!string.IsNullOrEmpty(item.ShortOverview)) if (!string.IsNullOrEmpty(item.Name) && !(item is Episode))
//{ {
// builder.Append("<ShortOverview><![CDATA[" + item.ShortOverview + "]]></ShortOverview>"); writer.WriteElementString("LocalTitle", item.Name);
//} }
//if (!string.IsNullOrEmpty(item.CustomRating)) if (!string.IsNullOrEmpty(item.ForcedSortName))
//{ {
// builder.Append("<CustomRating>" + SecurityElement.Escape(item.CustomRating) + "</CustomRating>"); writer.WriteElementString("SortTitle", item.ForcedSortName);
//} }
//if (!string.IsNullOrEmpty(item.Name) && !(item is Episode)) if (item.PremiereDate.HasValue)
//{ {
// builder.Append("<LocalTitle>" + SecurityElement.Escape(item.Name) + "</LocalTitle>"); if (item is Person)
//} {
writer.WriteElementString("BirthDate", item.PremiereDate.Value.ToLocalTime().ToString("yyyy-MM-dd"));
}
else if (!(item is Episode))
{
writer.WriteElementString("PremiereDate", item.PremiereDate.Value.ToLocalTime().ToString("yyyy-MM-dd"));
}
}
//if (!string.IsNullOrEmpty(item.ForcedSortName)) if (item.EndDate.HasValue)
//{ {
// builder.Append("<SortTitle>" + SecurityElement.Escape(item.ForcedSortName) + "</SortTitle>"); if (item is Person)
//} {
writer.WriteElementString("DeathDate", item.EndDate.Value.ToLocalTime().ToString("yyyy-MM-dd"));
//if (item.PremiereDate.HasValue) }
//{ else if (!(item is Episode))
// if (item is Person) {
// { writer.WriteElementString("EndDate", item.EndDate.Value.ToLocalTime().ToString("yyyy-MM-dd"));
// builder.Append("<BirthDate>" + SecurityElement.Escape(item.PremiereDate.Value.ToLocalTime().ToString("yyyy-MM-dd")) + "</BirthDate>"); }
// } }
// else if (!(item is Episode))
// {
// builder.Append("<PremiereDate>" + SecurityElement.Escape(item.PremiereDate.Value.ToLocalTime().ToString("yyyy-MM-dd")) + "</PremiereDate>");
// }
//}
//if (item.EndDate.HasValue)
//{
// if (item is Person)
// {
// builder.Append("<DeathDate>" + SecurityElement.Escape(item.EndDate.Value.ToString("yyyy-MM-dd")) + "</DeathDate>");
// }
// else if (!(item is Episode))
// {
// builder.Append("<EndDate>" + SecurityElement.Escape(item.EndDate.Value.ToString("yyyy-MM-dd")) + "</EndDate>");
// }
//}
//var hasTrailers = item as IHasTrailers; //var hasTrailers = item as IHasTrailers;
//if (hasTrailers != null) //if (hasTrailers != null)
@ -612,6 +606,8 @@ namespace MediaBrowser.LocalMetadata.Savers
//{ //{
// AddShares(hasShares, builder); // AddShares(hasShares, builder);
//} //}
AddMediaInfo(item, writer);
} }
public static void AddShares(IHasShares item, StringBuilder builder) public static void AddShares(IHasShares item, StringBuilder builder)
@ -635,33 +631,31 @@ namespace MediaBrowser.LocalMetadata.Savers
/// Appends the media info. /// Appends the media info.
/// </summary> /// </summary>
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
public static void AddMediaInfo<T>(T item, StringBuilder builder, IItemRepository itemRepository) public static void AddMediaInfo<T>(T item, XmlWriter writer)
where T : BaseItem where T : BaseItem
{ {
var video = item as Video; var video = item as Video;
if (video != null) if (video != null)
{ {
//AddChapters(video, builder, itemRepository);
if (video.Video3DFormat.HasValue) if (video.Video3DFormat.HasValue)
{ {
switch (video.Video3DFormat.Value) switch (video.Video3DFormat.Value)
{ {
case Video3DFormat.FullSideBySide: case Video3DFormat.FullSideBySide:
builder.Append("<Format3D>FSBS</Format3D>"); writer.WriteElementString("Format3D", "FSBS");
break; break;
case Video3DFormat.FullTopAndBottom: case Video3DFormat.FullTopAndBottom:
builder.Append("<Format3D>FTAB</Format3D>"); writer.WriteElementString("Format3D", "FTAB");
break; break;
case Video3DFormat.HalfSideBySide: case Video3DFormat.HalfSideBySide:
builder.Append("<Format3D>HSBS</Format3D>"); writer.WriteElementString("Format3D", "HSBS");
break; break;
case Video3DFormat.HalfTopAndBottom: case Video3DFormat.HalfTopAndBottom:
builder.Append("<Format3D>HTAB</Format3D>"); writer.WriteElementString("Format3D", "HTAB");
break; break;
case Video3DFormat.MVC: case Video3DFormat.MVC:
builder.Append("<Format3D>MVC</Format3D>"); writer.WriteElementString("Format3D", "MVC");
break; break;
} }
} }

View File

@ -170,6 +170,7 @@ namespace MediaBrowser.Model.Configuration
public bool EnableAutomaticRestart { get; set; } public bool EnableAutomaticRestart { get; set; }
public bool SkipDeserializationForBasicTypes { get; set; } public bool SkipDeserializationForBasicTypes { get; set; }
public bool SkipDeserializationForPrograms { get; set; } public bool SkipDeserializationForPrograms { get; set; }
public bool SkipDeserializationForAudio { get; set; }
public PathSubstitution[] PathSubstitutions { get; set; } public PathSubstitution[] PathSubstitutions { get; set; }

View File

@ -132,6 +132,8 @@ namespace MediaBrowser.Model.Entities
/// <value>The album.</value> /// <value>The album.</value>
public string Album { get; set; } public string Album { get; set; }
public bool IsThemeMedia { get; set; }
/// <summary> /// <summary>
/// Gets or sets the artists. /// Gets or sets the artists.
/// </summary> /// </summary>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>a02a9262-f007-4464-bb32-02f5f2593651</ProjectGuid>
<RootNamespace>MediaBrowser.Model</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>

View File

@ -6,14 +6,11 @@ using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
namespace MediaBrowser.Providers.MediaInfo namespace MediaBrowser.Providers.MediaInfo
@ -23,8 +20,6 @@ namespace MediaBrowser.Providers.MediaInfo
/// </summary> /// </summary>
public class AudioImageProvider : IDynamicImageProvider, IHasItemChangeMonitor public class AudioImageProvider : IDynamicImageProvider, IHasItemChangeMonitor
{ {
private readonly ConcurrentDictionary<string, SemaphoreSlim> _locks = new ConcurrentDictionary<string, SemaphoreSlim>();
private readonly IMediaEncoder _mediaEncoder; private readonly IMediaEncoder _mediaEncoder;
private readonly IServerConfigurationManager _config; private readonly IServerConfigurationManager _config;
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
@ -65,16 +60,6 @@ namespace MediaBrowser.Providers.MediaInfo
{ {
var path = GetAudioImagePath(item); var path = GetAudioImagePath(item);
if (!_fileSystem.FileExists(path))
{
var semaphore = GetLock(path);
// Acquire a lock
await semaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
// Check again in case it was saved while waiting for the lock
if (!_fileSystem.FileExists(path)) if (!_fileSystem.FileExists(path))
{ {
_fileSystem.CreateDirectory(Path.GetDirectoryName(path)); _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
@ -98,12 +83,6 @@ namespace MediaBrowser.Providers.MediaInfo
} }
} }
}
finally
{
semaphore.Release();
}
}
return new DynamicImageResponse return new DynamicImageResponse
{ {
@ -145,16 +124,6 @@ namespace MediaBrowser.Providers.MediaInfo
} }
} }
/// <summary>
/// Gets the lock.
/// </summary>
/// <param name="filename">The filename.</param>
/// <returns>SemaphoreSlim.</returns>
private SemaphoreSlim GetLock(string filename)
{
return _locks.GetOrAdd(filename, key => new SemaphoreSlim(1, 1));
}
public string Name public string Name
{ {
get { return "Image Extractor"; } get { return "Image Extractor"; }

View File

@ -203,7 +203,6 @@ namespace MediaBrowser.Providers.MediaInfo
var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video); var videoStream = mediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);
video.VideoBitRate = videoStream == null ? null : videoStream.BitRate;
video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index; video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index;
video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle); video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle);

View File

@ -13,9 +13,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Providers.MediaInfo namespace MediaBrowser.Providers.MediaInfo
{ {

View File

@ -252,6 +252,42 @@ namespace MediaBrowser.Server.Implementations.Channels
return item; return item;
} }
private List<ChannelMediaInfo> GetSavedMediaSources(BaseItem item)
{
var path = Path.Combine(item.GetInternalMetadataPath(), "channelmediasources.json");
try
{
return _jsonSerializer.DeserializeFromFile<List<ChannelMediaInfo>>(path) ?? new List<ChannelMediaInfo>();
}
catch
{
return new List<ChannelMediaInfo>();
}
}
private void SaveMediaSources(BaseItem item, List<ChannelMediaInfo> mediaSources)
{
var path = Path.Combine(item.GetInternalMetadataPath(), "channelmediasources.json");
if (mediaSources == null || mediaSources.Count == 0)
{
try
{
_fileSystem.DeleteFile(path);
}
catch
{
}
return;
}
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
_jsonSerializer.SerializeToFile(mediaSources, path);
}
public async Task<IEnumerable<MediaSourceInfo>> GetStaticMediaSources(BaseItem item, bool includeCachedVersions, CancellationToken cancellationToken) public async Task<IEnumerable<MediaSourceInfo>> GetStaticMediaSources(BaseItem item, bool includeCachedVersions, CancellationToken cancellationToken)
{ {
IEnumerable<ChannelMediaInfo> results = new List<ChannelMediaInfo>(); IEnumerable<ChannelMediaInfo> results = new List<ChannelMediaInfo>();
@ -263,7 +299,7 @@ namespace MediaBrowser.Server.Implementations.Channels
var audio = item as Audio; var audio = item as Audio;
if (audio != null) if (audio != null)
{ {
results = audio.ChannelMediaSources ?? new List<ChannelMediaInfo>(); results = audio.ChannelMediaSources ?? GetSavedMediaSources(audio);
} }
var sources = SortMediaInfoResults(results) var sources = SortMediaInfoResults(results)
@ -1385,7 +1421,6 @@ namespace MediaBrowser.Server.Implementations.Channels
if (channelAudioItem != null) if (channelAudioItem != null)
{ {
channelAudioItem.ExtraType = info.ExtraType; channelAudioItem.ExtraType = info.ExtraType;
channelAudioItem.ChannelMediaSources = info.MediaSources;
var mediaSource = info.MediaSources.FirstOrDefault(); var mediaSource = info.MediaSources.FirstOrDefault();
item.Path = mediaSource == null ? null : mediaSource.Path; item.Path = mediaSource == null ? null : mediaSource.Path;
@ -1426,6 +1461,8 @@ namespace MediaBrowser.Server.Implementations.Channels
await item.UpdateToRepository(ItemUpdateType.None, cancellationToken).ConfigureAwait(false); await item.UpdateToRepository(ItemUpdateType.None, cancellationToken).ConfigureAwait(false);
} }
SaveMediaSources(item, info.MediaSources);
return item; return item;
} }

View File

@ -123,8 +123,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
return; return;
} }
var themeMedia = item as IThemeMedia; if (item.IsThemeMedia)
if (themeMedia != null && themeMedia.IsThemeMedia)
{ {
// Don't report theme song or local trailer playback // Don't report theme song or local trailer playback
return; return;
@ -156,8 +155,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
return; return;
} }
var themeMedia = item as IThemeMedia; if (item.IsThemeMedia)
if (themeMedia != null && themeMedia.IsThemeMedia)
{ {
// Don't report theme song or local trailer playback // Don't report theme song or local trailer playback
return; return;

View File

@ -256,9 +256,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
} }
var item = e.MediaInfo; var item = e.MediaInfo;
var themeMedia = item as IThemeMedia;
if (themeMedia != null && themeMedia.IsThemeMedia) if ( item.IsThemeMedia)
{ {
// Don't report theme song or local trailer playback // Don't report theme song or local trailer playback
return; return;

View File

@ -367,7 +367,6 @@
<Compile Include="Persistence\SqliteUserDataRepository.cs" /> <Compile Include="Persistence\SqliteUserDataRepository.cs" />
<Compile Include="Persistence\SqliteUserRepository.cs" /> <Compile Include="Persistence\SqliteUserRepository.cs" />
<Compile Include="Sorting\StudioComparer.cs" /> <Compile Include="Sorting\StudioComparer.cs" />
<Compile Include="Sorting\VideoBitRateComparer.cs" />
<Compile Include="Sync\AppSyncProvider.cs" /> <Compile Include="Sync\AppSyncProvider.cs" />
<Compile Include="Sync\CloudSyncProfile.cs" /> <Compile Include="Sync\CloudSyncProfile.cs" />
<Compile Include="Sync\IHasSyncQuality.cs" /> <Compile Include="Sync\IHasSyncQuality.cs" />

View File

@ -285,6 +285,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(Logger, "TypedBaseItems", "ProductionLocations", "Text"); _connection.AddColumn(Logger, "TypedBaseItems", "ProductionLocations", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "ThemeSongIds", "Text"); _connection.AddColumn(Logger, "TypedBaseItems", "ThemeSongIds", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "ThemeVideoIds", "Text"); _connection.AddColumn(Logger, "TypedBaseItems", "ThemeVideoIds", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "TotalBitrate", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "ExtraType", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "Artists", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "AlbumArtists", "Text");
_connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text"); _connection.AddColumn(Logger, "ItemValues", "CleanValue", "Text");
@ -435,7 +439,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
"Images", "Images",
"ProductionLocations", "ProductionLocations",
"ThemeSongIds", "ThemeSongIds",
"ThemeVideoIds" "ThemeVideoIds",
"TotalBitrate",
"ExtraType",
"Artists",
"AlbumArtists"
}; };
private readonly string[] _mediaStreamSaveColumns = private readonly string[] _mediaStreamSaveColumns =
@ -566,7 +574,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
"Images", "Images",
"ProductionLocations", "ProductionLocations",
"ThemeSongIds", "ThemeSongIds",
"ThemeVideoIds" "ThemeVideoIds",
"TotalBitrate",
"ExtraType",
"Artists",
"AlbumArtists"
}; };
_saveItemCommand = _connection.CreateCommand(); _saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values ("; _saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
@ -1046,6 +1058,35 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = null; _saveItemCommand.GetParameter(index++).Value = null;
} }
_saveItemCommand.GetParameter(index++).Value = item.TotalBitrate;
_saveItemCommand.GetParameter(index++).Value = item.ExtraType;
var hasArtists = item as IHasArtist;
if (hasArtists != null)
{
if (hasArtists.Artists.Count > 0)
{
_saveItemCommand.GetParameter(index++).Value = string.Join("|", hasArtists.Artists.ToArray());
}
else
{
_saveItemCommand.GetParameter(index++).Value = null;
}
}
var hasAlbumArtists = item as IHasAlbumArtist;
if (hasAlbumArtists != null)
{
if (hasAlbumArtists.AlbumArtists.Count > 0)
{
_saveItemCommand.GetParameter(index++).Value = string.Join("|", hasAlbumArtists.AlbumArtists.ToArray());
}
else
{
_saveItemCommand.GetParameter(index++).Value = null;
}
}
_saveItemCommand.Transaction = transaction; _saveItemCommand.Transaction = transaction;
_saveItemCommand.ExecuteNonQuery(); _saveItemCommand.ExecuteNonQuery();
@ -1305,6 +1346,25 @@ namespace MediaBrowser.Server.Implementations.Persistence
return false; return false;
} }
} }
if (_config.Configuration.SkipDeserializationForAudio)
{
if (type == typeof(Audio))
{
return false;
}
if (type == typeof(LiveTvAudioRecording))
{
return false;
}
if (type == typeof(AudioPodcast))
{
return false;
}
if (type == typeof(MusicAlbum))
{
return false;
}
}
return true; return true;
} }
@ -1884,6 +1944,32 @@ namespace MediaBrowser.Server.Implementations.Persistence
index++; index++;
} }
if (!reader.IsDBNull(index))
{
item.TotalBitrate = reader.GetInt32(index);
}
index++;
if (!reader.IsDBNull(index))
{
item.ExtraType = (ExtraType)Enum.Parse(typeof(ExtraType), reader.GetString(index), true);
}
index++;
var hasArtists = item as IHasArtist;
if (hasArtists != null && !reader.IsDBNull(index))
{
hasArtists.Artists = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
}
index++;
var hasAlbumArtists = item as IHasAlbumArtist;
if (hasAlbumArtists != null && !reader.IsDBNull(index))
{
hasAlbumArtists.AlbumArtists = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
}
index++;
if (string.IsNullOrWhiteSpace(item.Tagline)) if (string.IsNullOrWhiteSpace(item.Tagline))
{ {
var movie = item as Movie; var movie = item as Movie;

View File

@ -1611,7 +1611,8 @@ namespace MediaBrowser.Server.Implementations.Session
IndexNumber = item.IndexNumber, IndexNumber = item.IndexNumber,
ParentIndexNumber = item.ParentIndexNumber, ParentIndexNumber = item.ParentIndexNumber,
PremiereDate = item.PremiereDate, PremiereDate = item.PremiereDate,
ProductionYear = item.ProductionYear ProductionYear = item.ProductionYear,
IsThemeMedia = item.IsThemeMedia
}; };
info.PrimaryImageTag = GetImageCacheTag(item, ImageType.Primary); info.PrimaryImageTag = GetImageCacheTag(item, ImageType.Primary);

View File

@ -1,41 +0,0 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Server.Implementations.Sorting
{
class VideoBitRateComparer : IBaseItemComparer
{
/// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
/// <param name="y">The y.</param>
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
return GetValue(x).CompareTo(GetValue(y));
}
private int GetValue(BaseItem item)
{
var video = item as Video;
if (video != null)
{
return video.VideoBitRate ?? 0;
}
return 0;
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public string Name
{
get { return ItemSortBy.VideoBitRate; }
}
}
}

View File

@ -690,9 +690,6 @@
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\wizardlivetvtuner.html"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\wizardlivetvtuner.html">
<Link>Resources\dashboard-ui\wizardlivetvtuner.html</Link> <Link>Resources\dashboard-ui\wizardlivetvtuner.html</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\wizardservice.html">
<Link>Resources\dashboard-ui\wizardservice.html</Link>
</BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\wizardsettings.html"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\wizardsettings.html">
<Link>Resources\dashboard-ui\wizardsettings.html</Link> <Link>Resources\dashboard-ui\wizardsettings.html</Link>
</BundleResource> </BundleResource>
@ -1692,6 +1689,12 @@
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\emby-webcomponents\refreshdialog\refreshdialog.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\emby-webcomponents\refreshdialog\refreshdialog.js">
<Link>Resources\dashboard-ui\bower_components\emby-webcomponents\refreshdialog\refreshdialog.js</Link> <Link>Resources\dashboard-ui\bower_components\emby-webcomponents\refreshdialog\refreshdialog.js</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\emby-webcomponents\registrationservices\registrationservices.js">
<Link>Resources\dashboard-ui\bower_components\emby-webcomponents\registrationservices\registrationservices.js</Link>
</BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\emby-webcomponents\registrationservices\style.css">
<Link>Resources\dashboard-ui\bower_components\emby-webcomponents\registrationservices\style.css</Link>
</BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\emby-webcomponents\require\requirecss.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\emby-webcomponents\require\requirecss.js">
<Link>Resources\dashboard-ui\bower_components\emby-webcomponents\require\requirecss.js</Link> <Link>Resources\dashboard-ui\bower_components\emby-webcomponents\require\requirecss.js</Link>
</BundleResource> </BundleResource>
@ -2607,8 +2610,8 @@
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\vibrant\website.coffee"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\vibrant\website.coffee">
<Link>Resources\dashboard-ui\bower_components\vibrant\website.coffee</Link> <Link>Resources\dashboard-ui\bower_components\vibrant\website.coffee</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\vibrant\dist\Vibrant.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\vibrant\dist\vibrant.js">
<Link>Resources\dashboard-ui\bower_components\vibrant\dist\Vibrant.js</Link> <Link>Resources\dashboard-ui\bower_components\vibrant\dist\vibrant.js</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\vibrant\dist\vibrant.min.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\bower_components\vibrant\dist\vibrant.min.js">
<Link>Resources\dashboard-ui\bower_components\vibrant\dist\vibrant.min.js</Link> <Link>Resources\dashboard-ui\bower_components\vibrant\dist\vibrant.min.js</Link>
@ -2673,6 +2676,9 @@
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\components\humanedate.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\components\humanedate.js">
<Link>Resources\dashboard-ui\components\humanedate.js</Link> <Link>Resources\dashboard-ui\components\humanedate.js</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\components\iap.js">
<Link>Resources\dashboard-ui\components\iap.js</Link>
</BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\components\remotecontrol.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\components\remotecontrol.js">
<Link>Resources\dashboard-ui\components\remotecontrol.js</Link> <Link>Resources\dashboard-ui\components\remotecontrol.js</Link>
</BundleResource> </BundleResource>
@ -3396,9 +3402,6 @@
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\pluginspage.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\pluginspage.js">
<Link>Resources\dashboard-ui\scripts\pluginspage.js</Link> <Link>Resources\dashboard-ui\scripts\pluginspage.js</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\registrationservices.js">
<Link>Resources\dashboard-ui\scripts\registrationservices.js</Link>
</BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\remotecontrol.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\remotecontrol.js">
<Link>Resources\dashboard-ui\scripts\remotecontrol.js</Link> <Link>Resources\dashboard-ui\scripts\remotecontrol.js</Link>
</BundleResource> </BundleResource>
@ -3504,9 +3507,6 @@
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\wizardlivetvtuner.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\wizardlivetvtuner.js">
<Link>Resources\dashboard-ui\scripts\wizardlivetvtuner.js</Link> <Link>Resources\dashboard-ui\scripts\wizardlivetvtuner.js</Link>
</BundleResource> </BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\wizardservice.js">
<Link>Resources\dashboard-ui\scripts\wizardservice.js</Link>
</BundleResource>
<BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\wizardsettings.js"> <BundleResource Include="..\MediaBrowser.WebDashboard\dashboard-ui\scripts\wizardsettings.js">
<Link>Resources\dashboard-ui\scripts\wizardsettings.js</Link> <Link>Resources\dashboard-ui\scripts\wizardsettings.js</Link>
</BundleResource> </BundleResource>

View File

@ -434,187 +434,40 @@ namespace MediaBrowser.Server.Startup.Common
var result = new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer")); var result = new JsonSerializer(FileSystemManager, LogManager.GetLogger("JsonSerializer"));
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ShortOverview" }; ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "Taglines" }; ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "Keywords" }; ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ShortOverview" }; ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "Artists", "AlbumArtists", "ChannelMediaSources", "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ShortOverview" }; ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "PlaceOfBirth" }; ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "Artists", "AlbumArtists", "ChannelMediaSources", "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "Artists", "AlbumArtists", "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "Artists", "AlbumArtists", "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "Artists", "AlbumArtists", "ChannelMediaSources", "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "PlaceOfBirth", "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ProviderIds" }; ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ProviderIds", "ImageInfos", "ProductionLocations", "ThemeSongIds", "ThemeVideoIds", "TotalBitrate", "ShortOverview", "Taglines", "Keywords", "ExtraType" };
ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ProviderIds" };
ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ImageInfos" };
ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ProductionLocations" };
ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ThemeSongIds" };
ServiceStack.Text.JsConfig<LiveTvProgram>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<LiveTvChannel>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<LiveTvVideoRecording>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<LiveTvAudioRecording>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Series>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Audio>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<MusicAlbum>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<MusicArtist>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<MusicGenre>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<MusicVideo>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Movie>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Playlist>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<AudioPodcast>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Trailer>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<BoxSet>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Episode>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Season>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Book>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<CollectionFolder>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Folder>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Game>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<GameGenre>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<GameSystem>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Genre>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Person>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Photo>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<PhotoAlbum>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Studio>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<UserRootFolder>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<UserView>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Video>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Year>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<Channel>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
ServiceStack.Text.JsConfig<AggregateFolder>.ExcludePropertyNames = new[] { "ThemeVideoIds" };
return result; return result;
} }

View File

@ -278,13 +278,9 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
var hasOriginalTitle = item as IHasOriginalTitle; if (!string.IsNullOrEmpty(val))
if (hasOriginalTitle != null)
{ {
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle)) item.OriginalTitle = val;
{
hasOriginalTitle.OriginalTitle = val;
}
} }
break; break;
} }

View File

@ -485,13 +485,9 @@ namespace MediaBrowser.XbmcMetadata.Savers
writer.WriteElementString("title", item.Name ?? string.Empty); writer.WriteElementString("title", item.Name ?? string.Empty);
var hasOriginalTitle = item as IHasOriginalTitle; if (!string.IsNullOrWhiteSpace(item.OriginalTitle))
if (hasOriginalTitle != null)
{ {
if (!string.IsNullOrEmpty(hasOriginalTitle.OriginalTitle)) writer.WriteElementString("originaltitle", item.OriginalTitle);
{
writer.WriteElementString("originaltitle", hasOriginalTitle.OriginalTitle ?? string.Empty);
}
} }
var people = libraryManager.GetPeople(item); var people = libraryManager.GetPeople(item);