diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 9c50ad5da..c2cefe754 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -1396,7 +1396,7 @@ namespace Emby.Server.Implementations.Dto } catch (Exception ex) { - + } } } @@ -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 diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 4cc6a7c7e..59b5a3869 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -46,6 +46,11 @@ namespace MediaBrowser.Controller.Entities.Audio AlbumArtists = new List(); } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return 1; + } + [IgnoreDataMember] public override bool SupportsPlayedStatus { diff --git a/MediaBrowser.Controller/Entities/Audio/AudioPodcast.cs b/MediaBrowser.Controller/Entities/Audio/AudioPodcast.cs index 8c820d367..cdb6f3f61 100644 --- a/MediaBrowser.Controller/Entities/Audio/AudioPodcast.cs +++ b/MediaBrowser.Controller/Entities/Audio/AudioPodcast.cs @@ -12,5 +12,10 @@ namespace MediaBrowser.Controller.Entities.Audio return true; } } + + public override double? GetDefaultPrimaryImageAspectRatio() + { + return null; + } } } diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index ffdbba6f2..6ad38033a 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -119,6 +119,11 @@ namespace MediaBrowser.Controller.Entities.Audio return Tracks; } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return 1; + } + public override List GetUserDataKeys() { var list = base.GetUserDataKeys(); diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index 37631bbe8..20b2529c0 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -68,6 +68,11 @@ namespace MediaBrowser.Controller.Entities.Audio } } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return 1; + } + public override bool CanDelete() { return !IsAccessedByName; diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs index bbe1a54a4..74679b474 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs @@ -63,6 +63,11 @@ namespace MediaBrowser.Controller.Entities.Audio } } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return 1; + } + public override bool CanDelete() { return false; diff --git a/MediaBrowser.Controller/Entities/AudioBook.cs b/MediaBrowser.Controller/Entities/AudioBook.cs index c15cae8b1..8b1c338f1 100644 --- a/MediaBrowser.Controller/Entities/AudioBook.cs +++ b/MediaBrowser.Controller/Entities/AudioBook.cs @@ -47,6 +47,11 @@ namespace MediaBrowser.Controller.Entities return SeriesPresentationUniqueKey; } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return null; + } + [IgnoreDataMember] public override bool EnableRefreshOnDateModifiedChange { diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index cab7588f0..0efb7ade8 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -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"); diff --git a/MediaBrowser.Controller/Entities/IHasImages.cs b/MediaBrowser.Controller/Entities/IHasImages.cs index 888e2080d..4c033dc00 100644 --- a/MediaBrowser.Controller/Entities/IHasImages.cs +++ b/MediaBrowser.Controller/Entities/IHasImages.cs @@ -204,6 +204,8 @@ namespace MediaBrowser.Controller.Entities /// The image. /// The index. void SetImage(ItemImageInfo image, int index); + + double? GetDefaultPrimaryImageAspectRatio(); } public static class HasImagesExtensions diff --git a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs index 3e6c88a85..030831717 100644 --- a/MediaBrowser.Controller/Entities/Movies/BoxSet.cs +++ b/MediaBrowser.Controller/Entities/Movies/BoxSet.cs @@ -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; diff --git a/MediaBrowser.Controller/Entities/Movies/Movie.cs b/MediaBrowser.Controller/Entities/Movies/Movie.cs index ec04879b5..de465b2f5 100644 --- a/MediaBrowser.Controller/Entities/Movies/Movie.cs +++ b/MediaBrowser.Controller/Entities/Movies/Movie.cs @@ -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 { diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index 0c36442af..ee1aea938 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -38,6 +38,14 @@ namespace MediaBrowser.Controller.Entities return GetItemLookupInfo(); } + public override double? GetDefaultPrimaryImageAspectRatio() + { + double value = 2; + value /= 3; + + return value; + } + public IEnumerable GetTaggedItems(InternalItemsQuery query) { query.PersonIds = new[] { Id.ToString("N") }; diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs index dbd9d1cef..b8ad691a9 100644 --- a/MediaBrowser.Controller/Entities/Studio.cs +++ b/MediaBrowser.Controller/Entities/Studio.cs @@ -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; diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index e6ebcb7fd..d2ea8d315 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -114,6 +114,14 @@ namespace MediaBrowser.Controller.Entities.TV { return false; } + } + + public override double? GetDefaultPrimaryImageAspectRatio() + { + double value = 16; + value /= 9; + + return value; } public override List GetUserDataKeys() diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index f2a6586e2..2ff7e4ce5 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -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; diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index eea11b167..9388160bd 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -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) diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index dd6d8a999..b4a142a8e 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -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; diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index e67fc5759..8501f1580 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -91,6 +91,11 @@ namespace MediaBrowser.Controller.LiveTv } } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return null; + } + public override string GetClientTypeName() { return "Recording"; diff --git a/MediaBrowser.Controller/Playlists/Playlist.cs b/MediaBrowser.Controller/Playlists/Playlist.cs index 9087a6e1d..0eb435375 100644 --- a/MediaBrowser.Controller/Playlists/Playlist.cs +++ b/MediaBrowser.Controller/Playlists/Playlist.cs @@ -58,6 +58,11 @@ namespace MediaBrowser.Controller.Playlists } } + public override double? GetDefaultPrimaryImageAspectRatio() + { + return 1; + } + public override bool IsAuthorizedToDelete(User user) { return true; diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index 2c059c860..902253e80 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -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")) diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs index 99136cd85..46be61486 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs @@ -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); } } diff --git a/SharedVersion.cs b/SharedVersion.cs index 7a98bd22e..f53a0a746 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.1.100")] +[assembly: AssemblyVersion("3.2.1.102")]