Merge pull request #2265 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-11-01 15:08:40 -04:00 committed by GitHub
commit 1d62c4302e
15 changed files with 189 additions and 144 deletions

View File

@ -407,17 +407,17 @@ namespace MediaBrowser.LocalMetadata.Savers
}
}
//if (hasProductionLocations.ProductionLocations.Count > 0)
//{
// builder.Append("<Countries>");
if (item.ProductionLocations.Count > 0)
{
writer.WriteStartElement("Countries");
// foreach (var name in hasProductionLocations.ProductionLocations)
// {
// builder.Append("<Country>" + SecurityElement.Escape(name) + "</Country>");
// }
foreach (var name in item.ProductionLocations)
{
writer.WriteElementString("Country", name);
}
// builder.Append("</Countries>");
//}
writer.WriteEndElement();
}
var hasDisplayOrder = item as IHasDisplayOrder;
if (hasDisplayOrder != null && !string.IsNullOrEmpty(hasDisplayOrder.DisplayOrder))
@ -425,17 +425,17 @@ namespace MediaBrowser.LocalMetadata.Savers
writer.WriteElementString("DisplayOrder", hasDisplayOrder.DisplayOrder);
}
//var hasMetascore = item as IHasMetascore;
//if (hasMetascore != null && hasMetascore.Metascore.HasValue)
//{
// builder.Append("<Metascore>" + SecurityElement.Escape(hasMetascore.Metascore.Value.ToString(UsCulture)) + "</Metascore>");
//}
var hasMetascore = item as IHasMetascore;
if (hasMetascore != null && hasMetascore.Metascore.HasValue)
{
writer.WriteElementString("Metascore", hasMetascore.Metascore.Value.ToString(UsCulture));
}
//var hasAwards = item as IHasAwards;
//if (hasAwards != null && !string.IsNullOrEmpty(hasAwards.AwardSummary))
//{
// builder.Append("<AwardSummary>" + SecurityElement.Escape(hasAwards.AwardSummary) + "</AwardSummary>");
//}
var hasAwards = item as IHasAwards;
if (hasAwards != null && !string.IsNullOrEmpty(hasAwards.AwardSummary))
{
writer.WriteElementString("AwardSummary", hasAwards.AwardSummary);
}
var hasBudget = item as IHasBudget;
if (hasBudget != null)
@ -451,14 +451,14 @@ namespace MediaBrowser.LocalMetadata.Savers
}
}
//if (item.CommunityRating.HasValue)
//{
// builder.Append("<Rating>" + SecurityElement.Escape(item.CommunityRating.Value.ToString(UsCulture)) + "</Rating>");
//}
//if (item.VoteCount.HasValue)
//{
// builder.Append("<VoteCount>" + SecurityElement.Escape(item.VoteCount.Value.ToString(UsCulture)) + "</VoteCount>");
//}
if (item.CommunityRating.HasValue)
{
writer.WriteElementString("Rating", item.CommunityRating.Value.ToString(UsCulture));
}
if (item.VoteCount.HasValue)
{
writer.WriteElementString("VoteCount", item.VoteCount.Value.ToString(UsCulture));
}
if (item.ProductionYear.HasValue && !(item is Person))
{
@ -470,76 +470,76 @@ namespace MediaBrowser.LocalMetadata.Savers
writer.WriteElementString("Website", item.HomePageUrl);
}
//var hasAspectRatio = item as IHasAspectRatio;
//if (hasAspectRatio != null)
//{
// if (!string.IsNullOrEmpty(hasAspectRatio.AspectRatio))
// {
// builder.Append("<AspectRatio>" + SecurityElement.Escape(hasAspectRatio.AspectRatio) + "</AspectRatio>");
// }
//}
var hasAspectRatio = item as IHasAspectRatio;
if (hasAspectRatio != null)
{
if (!string.IsNullOrEmpty(hasAspectRatio.AspectRatio))
{
writer.WriteElementString("AspectRatio", hasAspectRatio.AspectRatio);
}
}
//if (!string.IsNullOrEmpty(item.PreferredMetadataLanguage))
//{
// builder.Append("<Language>" + SecurityElement.Escape(item.PreferredMetadataLanguage) + "</Language>");
//}
//if (!string.IsNullOrEmpty(item.PreferredMetadataCountryCode))
//{
// builder.Append("<CountryCode>" + SecurityElement.Escape(item.PreferredMetadataCountryCode) + "</CountryCode>");
//}
if (!string.IsNullOrEmpty(item.PreferredMetadataLanguage))
{
writer.WriteElementString("Language", item.PreferredMetadataLanguage);
}
if (!string.IsNullOrEmpty(item.PreferredMetadataCountryCode))
{
writer.WriteElementString("CountryCode", item.PreferredMetadataCountryCode);
}
//// Use original runtime here, actual file runtime later in MediaInfo
//var runTimeTicks = item.RunTimeTicks;
// Use original runtime here, actual file runtime later in MediaInfo
var runTimeTicks = item.RunTimeTicks;
//if (runTimeTicks.HasValue)
//{
// var timespan = TimeSpan.FromTicks(runTimeTicks.Value);
if (runTimeTicks.HasValue)
{
var timespan = TimeSpan.FromTicks(runTimeTicks.Value);
// builder.Append("<RunningTime>" + Convert.ToInt32(timespan.TotalMinutes).ToString(UsCulture) + "</RunningTime>");
//}
writer.WriteElementString("RunningTime", Convert.ToInt32(timespan.TotalMinutes).ToString(UsCulture));
}
//if (item.ProviderIds != null)
//{
// foreach (var providerKey in item.ProviderIds.Keys)
// {
// var providerId = item.ProviderIds[providerKey];
// if (!string.IsNullOrEmpty(providerId))
// {
// builder.Append(string.Format("<{0}>{1}</{0}>", providerKey + "Id", SecurityElement.Escape(providerId)));
// }
// }
//}
if (item.ProviderIds != null)
{
foreach (var providerKey in item.ProviderIds.Keys)
{
var providerId = item.ProviderIds[providerKey];
if (!string.IsNullOrEmpty(providerId))
{
writer.WriteElementString(providerKey + "Id", providerId);
}
}
}
//if (!string.IsNullOrWhiteSpace(item.Tagline))
//{
// builder.Append("<Taglines>");
// builder.Append("<Tagline>" + SecurityElement.Escape(item.Tagline) + "</Tagline>");
// builder.Append("</Taglines>");
//}
if (!string.IsNullOrWhiteSpace(item.Tagline))
{
writer.WriteStartElement("Taglines");
writer.WriteElementString("Tagline", item.Tagline);
writer.WriteEndElement();
}
//if (item.Genres.Count > 0)
//{
// builder.Append("<Genres>");
if (item.Genres.Count > 0)
{
writer.WriteStartElement("Genres");
// foreach (var genre in item.Genres)
// {
// builder.Append("<Genre>" + SecurityElement.Escape(genre) + "</Genre>");
// }
foreach (var genre in item.Genres)
{
writer.WriteElementString("Genre", genre);
}
// builder.Append("</Genres>");
//}
writer.WriteEndElement();
}
//if (item.Studios.Count > 0)
//{
// builder.Append("<Studios>");
if (item.Studios.Count > 0)
{
writer.WriteStartElement("Studios");
// foreach (var studio in item.Studios)
// {
// builder.Append("<Studio>" + SecurityElement.Escape(studio) + "</Studio>");
// }
foreach (var studio in item.Studios)
{
writer.WriteElementString("Studio", studio);
}
// builder.Append("</Studios>");
//}
writer.WriteEndElement();
}
if (item.Tags.Count > 0)
{
@ -565,29 +565,29 @@ namespace MediaBrowser.LocalMetadata.Savers
writer.WriteEndElement();
}
//var people = libraryManager.GetPeople(item);
var people = libraryManager.GetPeople(item);
//if (people.Count > 0)
//{
// builder.Append("<Persons>");
if (people.Count > 0)
{
writer.WriteStartElement("Persons");
// foreach (var person in people)
// {
// builder.Append("<Person>");
// builder.Append("<Name>" + SecurityElement.Escape(person.Name) + "</Name>");
// builder.Append("<Type>" + SecurityElement.Escape(person.Type) + "</Type>");
// builder.Append("<Role>" + SecurityElement.Escape(person.Role) + "</Role>");
foreach (var person in people)
{
writer.WriteStartElement("Person");
writer.WriteElementString("Name", person.Name);
writer.WriteElementString("Type", person.Type);
writer.WriteElementString("Role", person.Role);
// if (person.SortOrder.HasValue)
// {
// builder.Append("<SortOrder>" + SecurityElement.Escape(person.SortOrder.Value.ToString(UsCulture)) + "</SortOrder>");
// }
if (person.SortOrder.HasValue)
{
writer.WriteElementString("SortOrder", person.SortOrder.Value.ToString(UsCulture));
}
// builder.Append("</Person>");
// }
writer.WriteEndElement();
}
// builder.Append("</Persons>");
//}
writer.WriteEndElement();
}
var boxset = item as BoxSet;
if (boxset != null)

View File

@ -121,6 +121,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
get
{
if (_hasExternalEncoder)
{
return "External";
}
if (string.IsNullOrWhiteSpace(FFMpegPath))
{
return null;
@ -185,6 +190,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
ConfigureEncoderPaths();
if (_hasExternalEncoder)
{
LogPaths();
return;
}
// If the path was passed in, save it into config now.
var encodingOptions = GetEncodingOptions();
var appPath = encodingOptions.EncoderAppPath;
@ -194,7 +205,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
if (!string.IsNullOrWhiteSpace(valueToSave))
{
// if using system variable, don't save this.
if (IsSystemInstalledPath(valueToSave))
if (IsSystemInstalledPath(valueToSave) || _hasExternalEncoder)
{
valueToSave = null;
}
@ -209,6 +220,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
public async Task UpdateEncoderPath(string path, string pathType)
{
if (_hasExternalEncoder)
{
return;
}
Tuple<string, string> newPaths;
if (string.Equals(pathType, "system", StringComparison.OrdinalIgnoreCase))
@ -265,6 +281,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
private void ConfigureEncoderPaths()
{
if (_hasExternalEncoder)
{
return;
}
var appPath = GetEncodingOptions().EncoderAppPath;
if (string.IsNullOrWhiteSpace(appPath))

View File

@ -781,24 +781,24 @@ namespace MediaBrowser.MediaEncoding.Probing
}
}
var conductor = FFProbeHelpers.GetDictionaryValue(tags, "conductor");
if (!string.IsNullOrWhiteSpace(conductor))
{
foreach (var person in Split(conductor, false))
{
audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Conductor });
}
}
//var conductor = FFProbeHelpers.GetDictionaryValue(tags, "conductor");
//if (!string.IsNullOrWhiteSpace(conductor))
//{
// foreach (var person in Split(conductor, false))
// {
// audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Conductor });
// }
//}
var lyricist = FFProbeHelpers.GetDictionaryValue(tags, "lyricist");
//var lyricist = FFProbeHelpers.GetDictionaryValue(tags, "lyricist");
//if (!string.IsNullOrWhiteSpace(lyricist))
//{
// foreach (var person in Split(lyricist, false))
// {
// audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Lyricist });
// }
//}
if (!string.IsNullOrWhiteSpace(lyricist))
{
foreach (var person in Split(lyricist, false))
{
audio.People.Add(new BaseItemPerson { Name = person, Type = PersonType.Lyricist });
}
}
// Check for writer some music is tagged that way as alternative to composer/lyricist
var writer = FFProbeHelpers.GetDictionaryValue(tags, "writer");

View File

@ -26,16 +26,16 @@ namespace MediaBrowser.Providers.Movies
private readonly ILogger _logger;
private readonly IJsonSerializer _jsonSerializer;
private readonly ILibraryManager _libraryManager;
private readonly IFileSystem _fileSystem;
private readonly IFileSystem _fileSystem;
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
public GenericMovieDbInfo(ILogger logger, IJsonSerializer jsonSerializer, ILibraryManager libraryManager, IFileSystem fileSystem)
public GenericMovieDbInfo(ILogger logger, IJsonSerializer jsonSerializer, ILibraryManager libraryManager, IFileSystem fileSystem)
{
_logger = logger;
_jsonSerializer = jsonSerializer;
_libraryManager = libraryManager;
_fileSystem = fileSystem;
_fileSystem = fileSystem;
}
public async Task<MetadataResult<T>> GetMetadata(ItemLookupInfo itemId, CancellationToken cancellationToken)
@ -271,6 +271,8 @@ namespace MediaBrowser.Providers.Movies
//and the rest from crew
if (movieData.casts != null && movieData.casts.crew != null)
{
var keepTypes = new[] { PersonType.Director, PersonType.Writer, PersonType.Producer };
foreach (var person in movieData.casts.crew)
{
// Normalize this
@ -280,6 +282,12 @@ namespace MediaBrowser.Providers.Movies
type = PersonType.Writer;
}
if (!keepTypes.Contains(type ?? string.Empty, StringComparer.OrdinalIgnoreCase) &&
!keepTypes.Contains(person.job ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
var personInfo = new PersonInfo
{
Name = person.name.Trim(),

View File

@ -1,4 +1,5 @@
using MediaBrowser.Model.IO;
using System;
using MediaBrowser.Model.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
@ -166,9 +167,24 @@ namespace MediaBrowser.Providers.TV
//and the rest from crew
if (credits.crew != null)
{
var keepTypes = new[] { PersonType.Director, PersonType.Writer, PersonType.Producer };
foreach (var person in credits.crew)
{
result.AddPerson(new PersonInfo { Name = person.name.Trim(), Role = person.job, Type = person.department });
// Normalize this
var type = person.department;
if (string.Equals(type, "writing", StringComparison.OrdinalIgnoreCase))
{
type = PersonType.Writer;
}
if (!keepTypes.Contains(type ?? string.Empty, StringComparer.OrdinalIgnoreCase) &&
!keepTypes.Contains(person.job ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
result.AddPerson(new PersonInfo { Name = person.name.Trim(), Role = person.job, Type = type });
}
}
}

View File

@ -64,8 +64,9 @@
<Reference Include="Mono.Nat">
<HintPath>..\ThirdParty\emby\Mono.Nat.dll</HintPath>
</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 Include="Patterns.Logging, Version=1.0.6149.1756, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Patterns.Logging.1.0.0.4\lib\portable-net45+dnxcore50+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Api.Swagger">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Api.Swagger.dll</HintPath>
@ -89,7 +90,6 @@
<Reference Include="System.Net" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="ServiceStack">

View File

@ -4,7 +4,7 @@
<package id="ini-parser" version="2.3.0" targetFramework="net45" />
<package id="MediaBrowser.Naming" version="1.0.0.57" targetFramework="net46" />
<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="Patterns.Logging" version="1.0.0.4" targetFramework="net46" />
<package id="SocketHttpListener" version="1.0.0.40" targetFramework="net45" />
<package id="UniversalDetector" version="1.0.1" targetFramework="net46" />
</packages>

View File

@ -69,9 +69,9 @@
<HintPath>..\packages\NLog.4.4.0-betaV15\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Patterns.Logging, Version=1.0.5494.41209, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Reference Include="Patterns.Logging, Version=1.0.6149.1756, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Patterns.Logging.1.0.0.4\lib\portable-net45+dnxcore50+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="ServiceStack.Interfaces">

View File

@ -2,5 +2,5 @@
<packages>
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
<package id="NLog" version="4.4.0-betaV15" targetFramework="net46" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.4" targetFramework="net46" />
</packages>

View File

@ -42,9 +42,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
</Reference>
<Reference Include="Patterns.Logging, Version=1.0.5494.41209, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Reference Include="Patterns.Logging, Version=1.0.6149.1756, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Patterns.Logging.1.0.0.4\lib\portable-net45+dnxcore50+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RSSDP">
<HintPath>..\ThirdParty\emby\RSSDP.dll</HintPath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.4" targetFramework="net46" />
<package id="SimpleInjector" version="3.2.4" targetFramework="net46" />
</packages>

View File

@ -75,9 +75,9 @@
<HintPath>..\packages\NLog.4.4.0-betaV15\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Patterns.Logging, Version=1.0.5494.41209, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Reference Include="Patterns.Logging, Version=1.0.6149.1756, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Patterns.Logging.1.0.0.4\lib\portable-net45+dnxcore50+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ServiceStack.Interfaces">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath>

View File

@ -2,6 +2,6 @@
<packages>
<package id="ImageMagickSharp" version="1.0.0.18" targetFramework="net45" />
<package id="NLog" version="4.4.0-betaV15" targetFramework="net462" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.4" targetFramework="net462" />
<package id="System.Data.SQLite.Core" version="1.0.103" targetFramework="net462" />
</packages>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.680</version>
<version>3.0.681</version>
<title>Emby.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.680</version>
<version>3.0.681</version>
<title>Emby.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.680" />
<dependency id="MediaBrowser.Common" version="3.0.681" />
</dependencies>
</metadata>
<files>