Merge pull request #2463 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-02-10 15:08:01 -05:00 committed by GitHub
commit da89dceba0
22 changed files with 132 additions and 7 deletions

View File

@ -1630,8 +1630,20 @@ namespace Emby.Server.Implementations.Dto
return null;
}
var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary).ToList();
ImageSize size;
if (supportedEnhancers.Count == 0)
{
var defaultAspectRatio = item.GetDefaultPrimaryImageAspectRatio();
if (defaultAspectRatio.HasValue)
{
return defaultAspectRatio.Value;
}
}
try
{
size = _imageProcessor.GetImageSize(imageInfo);
@ -1642,8 +1654,6 @@ namespace Emby.Server.Implementations.Dto
return null;
}
var supportedEnhancers = _imageProcessor.GetSupportedEnhancers(item, ImageType.Primary).ToList();
foreach (var enhancer in supportedEnhancers)
{
try

View File

@ -46,6 +46,11 @@ namespace MediaBrowser.Controller.Entities.Audio
AlbumArtists = new List<string>();
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return 1;
}
[IgnoreDataMember]
public override bool SupportsPlayedStatus
{

View File

@ -12,5 +12,10 @@ namespace MediaBrowser.Controller.Entities.Audio
return true;
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return null;
}
}
}

View File

@ -119,6 +119,11 @@ namespace MediaBrowser.Controller.Entities.Audio
return Tracks;
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return 1;
}
public override List<string> GetUserDataKeys()
{
var list = base.GetUserDataKeys();

View File

@ -68,6 +68,11 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return 1;
}
public override bool CanDelete()
{
return !IsAccessedByName;

View File

@ -63,6 +63,11 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return 1;
}
public override bool CanDelete()
{
return false;

View File

@ -47,6 +47,11 @@ namespace MediaBrowser.Controller.Entities
return SeriesPresentationUniqueKey;
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return null;
}
[IgnoreDataMember]
public override bool EnableRefreshOnDateModifiedChange
{

View File

@ -1260,6 +1260,11 @@ namespace MediaBrowser.Controller.Entities
get { return null; }
}
public virtual double? GetDefaultPrimaryImageAspectRatio()
{
return null;
}
public virtual string CreatePresentationUniqueKey()
{
return Id.ToString("N");

View File

@ -204,6 +204,8 @@ namespace MediaBrowser.Controller.Entities
/// <param name="image">The image.</param>
/// <param name="index">The index.</param>
void SetImage(ItemImageInfo image, int index);
double? GetDefaultPrimaryImageAspectRatio();
}
public static class HasImagesExtensions

View File

@ -57,6 +57,14 @@ namespace MediaBrowser.Controller.Entities.Movies
return config.BlockUnratedItems.Contains(UnratedItem.Movie);
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 2;
value /= 3;
return value;
}
public override UnratedItem GetBlockUnratedType()
{
return UnratedItem.Movie;

View File

@ -70,6 +70,14 @@ namespace MediaBrowser.Controller.Entities.Movies
set { TmdbCollectionName = value; }
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 2;
value /= 3;
return value;
}
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{

View File

@ -38,6 +38,14 @@ namespace MediaBrowser.Controller.Entities
return GetItemLookupInfo<PersonLookupInfo>();
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 2;
value /= 3;
return value;
}
public IEnumerable<BaseItem> GetTaggedItems(InternalItemsQuery query)
{
query.PersonIds = new[] { Id.ToString("N") };

View File

@ -57,6 +57,14 @@ namespace MediaBrowser.Controller.Entities
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 16;
value /= 9;
return value;
}
public override bool CanDelete()
{
return false;

View File

@ -116,6 +116,14 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 16;
value /= 9;
return value;
}
public override List<string> GetUserDataKeys()
{
var list = base.GetUserDataKeys();

View File

@ -54,6 +54,14 @@ namespace MediaBrowser.Controller.Entities.TV
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 2;
value /= 3;
return value;
}
public string FindSeriesSortName()
{
var series = Series;

View File

@ -93,6 +93,14 @@ namespace MediaBrowser.Controller.Entities.TV
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 2;
value /= 3;
return value;
}
public override string CreatePresentationUniqueKey()
{
if (LibraryManager.GetLibraryOptions(this).EnableAutomaticSeriesGrouping)

View File

@ -29,6 +29,14 @@ namespace MediaBrowser.Controller.Entities
get { return TrailerTypes.Contains(TrailerType.LocalTrailer); }
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
double value = 2;
value /= 3;
return value;
}
public override UnratedItem GetBlockUnratedType()
{
return UnratedItem.Trailer;

View File

@ -91,6 +91,11 @@ namespace MediaBrowser.Controller.LiveTv
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return null;
}
public override string GetClientTypeName()
{
return "Recording";

View File

@ -58,6 +58,11 @@ namespace MediaBrowser.Controller.Playlists
}
}
public override double? GetDefaultPrimaryImageAspectRatio()
{
return 1;
}
public override bool IsAuthorizedToDelete(User user)
{
return true;

View File

@ -243,7 +243,11 @@ namespace MediaBrowser.Model.Net
if (StringHelper.EqualsIgnoreCase(ext, ".opus"))
{
return "audio/ogg";
}
}
if (StringHelper.EqualsIgnoreCase(ext, ".ac3"))
{
return "audio/ac3";
}
// Playlists
if (StringHelper.EqualsIgnoreCase(ext, ".m3u8"))

View File

@ -742,7 +742,7 @@ namespace MediaBrowser.Providers.TV
{
if (!item.LockedFields.Contains(MetadataFields.Cast))
{
AddPeople(result, val, PersonType.Writer);
//AddPeople(result, val, PersonType.Writer);
}
}
@ -894,7 +894,7 @@ namespace MediaBrowser.Providers.TV
{
if (!item.LockedFields.Contains(MetadataFields.Cast))
{
AddPeople(result, val, PersonType.Writer);
//AddPeople(result, val, PersonType.Writer);
}
}

View File

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.1.100")]
[assembly: AssemblyVersion("3.2.1.102")]