update details

pull/702/head
Luke Pulverenti 8 years ago
parent 4a9c77c327
commit 68772e7d9b

@ -148,7 +148,7 @@ namespace Emby.Drawing.ImageMagick
{ {
using (var originalImage = new MagickWand(inputPath)) using (var originalImage = new MagickWand(inputPath))
{ {
ScaleImage(originalImage, width, height); ScaleImage(originalImage, width, height, options.Blur ?? 0);
if (autoOrient) if (autoOrient)
{ {
@ -170,7 +170,7 @@ namespace Emby.Drawing.ImageMagick
{ {
using (var originalImage = new MagickWand(inputPath)) using (var originalImage = new MagickWand(inputPath))
{ {
ScaleImage(originalImage, width, height); ScaleImage(originalImage, width, height, options.Blur ?? 0);
if (autoOrient) if (autoOrient)
{ {
@ -221,13 +221,13 @@ namespace Emby.Drawing.ImageMagick
} }
} }
private void ScaleImage(MagickWand wand, int width, int height) private void ScaleImage(MagickWand wand, int width, int height, int blur)
{ {
var highQuality = false; var useResize = blur > 1;
if (highQuality) if (useResize)
{ {
wand.CurrentImage.ResizeImage(width, height); wand.CurrentImage.ResizeImage(width, height, FilterTypes.GaussianFilter, blur);
} }
else else
{ {

@ -236,7 +236,7 @@ namespace Emby.Drawing
var quality = options.Quality; var quality = options.Quality;
var outputFormat = GetOutputFormat(options.SupportedOutputFormats[0]); var outputFormat = GetOutputFormat(options.SupportedOutputFormats[0]);
var cacheFilePath = GetCacheFilePath(originalImagePath, newSize, quality, dateModified, outputFormat, options.AddPlayedIndicator, options.PercentPlayed, options.UnplayedCount, options.BackgroundColor, options.ForegroundLayer); var cacheFilePath = GetCacheFilePath(originalImagePath, newSize, quality, dateModified, outputFormat, options.AddPlayedIndicator, options.PercentPlayed, options.UnplayedCount, options.Blur, options.BackgroundColor, options.ForegroundLayer);
var imageProcessingLockTaken = false; var imageProcessingLockTaken = false;
@ -469,7 +469,7 @@ namespace Emby.Drawing
/// <summary> /// <summary>
/// Gets the cache file path based on a set of parameters /// Gets the cache file path based on a set of parameters
/// </summary> /// </summary>
private string GetCacheFilePath(string originalPath, ImageSize outputSize, int quality, DateTime dateModified, ImageFormat format, bool addPlayedIndicator, double percentPlayed, int? unwatchedCount, string backgroundColor, string foregroundLayer) private string GetCacheFilePath(string originalPath, ImageSize outputSize, int quality, DateTime dateModified, ImageFormat format, bool addPlayedIndicator, double percentPlayed, int? unwatchedCount, int? blur, string backgroundColor, string foregroundLayer)
{ {
var filename = originalPath; var filename = originalPath;
@ -498,6 +498,11 @@ namespace Emby.Drawing
filename += "p=" + unwatchedCount.Value; filename += "p=" + unwatchedCount.Value;
} }
if (blur.HasValue)
{
filename += "blur=" + blur.Value;
}
if (!string.IsNullOrEmpty(backgroundColor)) if (!string.IsNullOrEmpty(backgroundColor))
{ {
filename += "b=" + backgroundColor; filename += "b=" + backgroundColor;

@ -47,36 +47,6 @@ namespace Emby.Server.Implementations.Library.Validators
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
private bool DownloadMetadata(PersonInfo i, PeopleMetadataOptions options)
{
if (i.IsType(PersonType.Actor))
{
return options.DownloadActorMetadata;
}
if (i.IsType(PersonType.Director))
{
return options.DownloadDirectorMetadata;
}
if (i.IsType(PersonType.Composer))
{
return options.DownloadComposerMetadata;
}
if (i.IsType(PersonType.Writer))
{
return options.DownloadWriterMetadata;
}
if (i.IsType(PersonType.Producer))
{
return options.DownloadProducerMetadata;
}
if (i.IsType(PersonType.GuestStar))
{
return options.DownloadGuestStarMetadata;
}
return options.DownloadOtherPeopleMetadata;
}
/// <summary> /// <summary>
/// Validates the people. /// Validates the people.
/// </summary> /// </summary>
@ -89,28 +59,13 @@ namespace Emby.Server.Implementations.Library.Validators
innerProgress.RegisterAction(pct => progress.Report(pct * .15)); innerProgress.RegisterAction(pct => progress.Report(pct * .15));
var peopleOptions = _config.Configuration.PeopleMetadataOptions;
var people = _libraryManager.GetPeople(new InternalPeopleQuery()); var people = _libraryManager.GetPeople(new InternalPeopleQuery());
var dict = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase); var dict = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
foreach (var person in people) foreach (var person in people)
{ {
var isMetadataEnabled = DownloadMetadata(person, peopleOptions); dict[person.Name] = true;
bool currentValue;
if (dict.TryGetValue(person.Name, out currentValue))
{
if (!currentValue && isMetadataEnabled)
{
dict[person.Name] = true;
}
}
else
{
dict[person.Name] = isMetadataEnabled;
}
} }
var numComplete = 0; var numComplete = 0;

@ -64,6 +64,8 @@ namespace MediaBrowser.Api.Images
[ApiMember(Name = "UnplayedCount", Description = "Optional unplayed count overlay to render", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "UnplayedCount", Description = "Optional unplayed count overlay to render", IsRequired = false, DataType = "int", ParameterType = "query", Verb = "GET")]
public int? UnplayedCount { get; set; } public int? UnplayedCount { get; set; }
public int? Blur { get; set; }
[ApiMember(Name = "BackgroundColor", Description = "Optional. Apply a background color for transparent images.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "BackgroundColor", Description = "Optional. Apply a background color for transparent images.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public string BackgroundColor { get; set; } public string BackgroundColor { get; set; }

@ -624,6 +624,7 @@ namespace MediaBrowser.Api.Images
AddPlayedIndicator = request.AddPlayedIndicator, AddPlayedIndicator = request.AddPlayedIndicator,
PercentPlayed = request.PercentPlayed ?? 0, PercentPlayed = request.PercentPlayed ?? 0,
UnplayedCount = request.UnplayedCount, UnplayedCount = request.UnplayedCount,
Blur = request.Blur,
BackgroundColor = request.BackgroundColor, BackgroundColor = request.BackgroundColor,
ForegroundLayer = request.ForegroundLayer, ForegroundLayer = request.ForegroundLayer,
SupportedOutputFormats = supportedFormats SupportedOutputFormats = supportedFormats

@ -35,6 +35,7 @@ namespace MediaBrowser.Controller.Drawing
public bool AddPlayedIndicator { get; set; } public bool AddPlayedIndicator { get; set; }
public int? UnplayedCount { get; set; } public int? UnplayedCount { get; set; }
public int? Blur { get; set; }
public double PercentPlayed { get; set; } public double PercentPlayed { get; set; }
@ -84,6 +85,7 @@ namespace MediaBrowser.Controller.Drawing
!AddPlayedIndicator && !AddPlayedIndicator &&
PercentPlayed.Equals(0) && PercentPlayed.Equals(0) &&
!UnplayedCount.HasValue && !UnplayedCount.HasValue &&
!Blur.HasValue &&
string.IsNullOrEmpty(BackgroundColor) && string.IsNullOrEmpty(BackgroundColor) &&
string.IsNullOrEmpty(ForegroundLayer); string.IsNullOrEmpty(ForegroundLayer);
} }

@ -1,19 +0,0 @@
namespace MediaBrowser.Model.Configuration
{
public class PeopleMetadataOptions
{
public bool DownloadActorMetadata { get; set; }
public bool DownloadDirectorMetadata { get; set; }
public bool DownloadProducerMetadata { get; set; }
public bool DownloadWriterMetadata { get; set; }
public bool DownloadComposerMetadata { get; set; }
public bool DownloadOtherPeopleMetadata { get; set; }
public bool DownloadGuestStarMetadata { get; set; }
public PeopleMetadataOptions()
{
DownloadActorMetadata = true;
DownloadDirectorMetadata = true;
}
}
}

@ -181,8 +181,6 @@ namespace MediaBrowser.Model.Configuration
public string UICulture { get; set; } public string UICulture { get; set; }
public PeopleMetadataOptions PeopleMetadataOptions { get; set; }
public bool SaveMetadataHidden { get; set; } public bool SaveMetadataHidden { get; set; }
public NameValuePair[] ContentTypes { get; set; } public NameValuePair[] ContentTypes { get; set; }
@ -260,8 +258,6 @@ namespace MediaBrowser.Model.Configuration
UICulture = "en-us"; UICulture = "en-us";
PeopleMetadataOptions = new PeopleMetadataOptions();
MetadataOptions = new[] MetadataOptions = new[]
{ {
new MetadataOptions(1, 1280) {ItemType = "Book"}, new MetadataOptions(1, 1280) {ItemType = "Book"},

@ -118,7 +118,9 @@ namespace MediaBrowser.Model.Entities
private string AddLanguageIfNeeded(string title) private string AddLanguageIfNeeded(string title)
{ {
if (!string.IsNullOrEmpty(Language) && !string.Equals(Language, "und", StringComparison.OrdinalIgnoreCase) && title.IndexOf(Language, StringComparison.OrdinalIgnoreCase) == -1) if (!string.IsNullOrEmpty(Language) &&
!string.Equals(Language, "und", StringComparison.OrdinalIgnoreCase) &&
!IsLanguageInTitle(title, Language))
{ {
title = StringHelper.FirstToUpper(Language) + " " + title; title = StringHelper.FirstToUpper(Language) + " " + title;
} }
@ -126,6 +128,16 @@ namespace MediaBrowser.Model.Entities
return title; return title;
} }
private bool IsLanguageInTitle(string title, string language)
{
if (title.IndexOf(Language, StringComparison.OrdinalIgnoreCase) != -1)
{
return true;
}
return false;
}
public string NalLengthSize { get; set; } public string NalLengthSize { get; set; }
/// <summary> /// <summary>

@ -84,7 +84,6 @@
<Compile Include="Configuration\FanartOptions.cs" /> <Compile Include="Configuration\FanartOptions.cs" />
<Compile Include="Configuration\LibraryOptions.cs" /> <Compile Include="Configuration\LibraryOptions.cs" />
<Compile Include="Configuration\MetadataConfiguration.cs" /> <Compile Include="Configuration\MetadataConfiguration.cs" />
<Compile Include="Configuration\PeopleMetadataOptions.cs" />
<Compile Include="Configuration\XbmcMetadataOptions.cs" /> <Compile Include="Configuration\XbmcMetadataOptions.cs" />
<Compile Include="Configuration\SubtitlePlaybackMode.cs" /> <Compile Include="Configuration\SubtitlePlaybackMode.cs" />
<Compile Include="Connect\ConnectAuthenticationExchangeResult.cs" /> <Compile Include="Connect\ConnectAuthenticationExchangeResult.cs" />

Loading…
Cancel
Save