diff options
19 files changed, 47 insertions, 257 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 7da11a405..639c1f54b 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -648,10 +648,8 @@ namespace MediaBrowser.Api.Images var serverFormats = _imageProcessor.GetSupportedImageOutputFormats(); - var clientFormats = GetClientSupportedFormats(); - if (serverFormats.Contains(ImageFormat.Webp) && - clientFormats.Contains(ImageFormat.Webp)) + GetClientSupportedFormats().Contains(ImageFormat.Webp)) { return ImageFormat.Webp; } diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index f89a70340..269f4cb20 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -617,36 +617,14 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); - var originalItem = item; - while (GetThemeSongIds(item).Count == 0 && request.InheritFromParent && item.Parent != null) { item = item.Parent; } - var themeSongIds = GetThemeSongIds(item); - - if (themeSongIds.Count == 0 && request.InheritFromParent) - { - var album = originalItem as MusicAlbum; - - if (album != null) - { - var linkedItemWithThemes = album.SoundtrackIds - .Select(i => _libraryManager.GetItemById(i)) - .FirstOrDefault(i => GetThemeSongIds(i).Count > 0); - - if (linkedItemWithThemes != null) - { - themeSongIds = GetThemeSongIds(linkedItemWithThemes); - item = linkedItemWithThemes; - } - } - } - var dtoOptions = GetDtoOptions(request); - var dtos = themeSongIds.Select(_libraryManager.GetItemById) + var dtos = GetThemeSongIds(item).Select(_libraryManager.GetItemById) .OrderBy(i => i.SortName) .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); @@ -682,41 +660,14 @@ namespace MediaBrowser.Api.Library : (Folder)_libraryManager.RootFolder) : _libraryManager.GetItemById(request.Id); - var originalItem = item; - while (GetThemeVideoIds(item).Count == 0 && request.InheritFromParent && item.Parent != null) { item = item.Parent; } - var themeVideoIds = GetThemeVideoIds(item); - - if (themeVideoIds.Count == 0 && request.InheritFromParent) - { - var album = originalItem as MusicAlbum; - - if (album == null) - { - album = originalItem.Parents.OfType<MusicAlbum>().FirstOrDefault(); - } - - if (album != null) - { - var linkedItemWithThemes = album.SoundtrackIds - .Select(i => _libraryManager.GetItemById(i)) - .FirstOrDefault(i => GetThemeVideoIds(i).Count > 0); - - if (linkedItemWithThemes != null) - { - themeVideoIds = GetThemeVideoIds(linkedItemWithThemes); - item = linkedItemWithThemes; - } - } - } - var dtoOptions = GetDtoOptions(request); - var dtos = themeVideoIds.Select(_libraryManager.GetItemById) + var dtos = GetThemeVideoIds(item).Select(_libraryManager.GetItemById) .OrderBy(i => i.SortName) .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index 100633d7f..623329ca6 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -52,34 +52,6 @@ namespace MediaBrowser.Controller.Entities.Audio /// <value><c>true</c> if this instance has embedded image; otherwise, <c>false</c>.</value> public bool HasEmbeddedImage { get; set; } - /// <summary> - /// Override this to true if class should be grouped under a container in indicies - /// The container class should be defined via IndexContainer - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool GroupInIndex - { - get - { - return true; - } - } - - /// <summary> - /// Override this to return the folder that should be used to construct a container - /// for this item in an index. GroupInIndex should be true as well. - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public override Folder IndexContainer - { - get - { - return LatestItemsIndexContainer ?? new MusicAlbum { Name = "Unknown Album" }; - } - } - [IgnoreDataMember] protected override bool SupportsOwnedItems { @@ -94,7 +66,7 @@ namespace MediaBrowser.Controller.Entities.Audio { get { - return Parents.OfType<MusicAlbum>().FirstOrDefault(); + return AlbumEntity; } } @@ -148,6 +120,12 @@ namespace MediaBrowser.Controller.Entities.Audio /// <value>The album.</value> public string Album { get; set; } + [IgnoreDataMember] + public MusicAlbum AlbumEntity + { + get { return FindParent<MusicAlbum>(); } + } + /// <summary> /// Gets the type of the media. /// </summary> @@ -177,7 +155,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// <returns>System.String.</returns> protected override string CreateUserDataKey() { - var parent = FindParent<MusicAlbum>(); + var parent = AlbumEntity; if (parent != null) { diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs index dc3f13b01..c060f53a6 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs @@ -2,7 +2,6 @@ using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Users; -using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; @@ -14,11 +13,8 @@ namespace MediaBrowser.Controller.Entities.Audio /// </summary> public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo> { - public List<Guid> SoundtrackIds { get; set; } - public MusicAlbum() { - SoundtrackIds = new List<Guid>(); Artists = new List<string>(); AlbumArtists = new List<string>(); } @@ -77,49 +73,6 @@ namespace MediaBrowser.Controller.Entities.Audio return Tracks; } - /// <summary> - /// Songs will group into us so don't also include us in the index - /// </summary> - /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool IncludeInIndex - { - get - { - return false; - } - } - - /// <summary> - /// Override this to true if class should be grouped under a container in indicies - /// The container class should be defined via IndexContainer - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool GroupInIndex - { - get - { - return true; - } - } - - /// <summary> - /// The unknwon artist - /// </summary> - private static readonly MusicArtist UnknwonArtist = new MusicArtist { Name = "<Unknown>" }; - - /// <summary> - /// Override this to return the folder that should be used to construct a container - /// for this item in an index. GroupInIndex should be true as well. - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public override Folder IndexContainer - { - get { return Parent as MusicArtist ?? UnknwonArtist; } - } - public List<string> Artists { get; set; } /// <summary> diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 3313f45fd..bbc3b6fd3 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -496,7 +496,7 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <typeparam name="T"></typeparam> /// <returns>``0.</returns> - public T FindParent<T>() + protected T FindParent<T>() where T : Folder { return Parents.OfType<T>().FirstOrDefault(); @@ -906,38 +906,6 @@ namespace MediaBrowser.Controller.Entities /// <value>The provider ids.</value> public Dictionary<string, string> ProviderIds { get; set; } - /// <summary> - /// Override this to false if class should be ignored for indexing purposes - /// </summary> - /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public virtual bool IncludeInIndex - { - get { return true; } - } - - /// <summary> - /// Override this to true if class should be grouped under a container in indicies - /// The container class should be defined via IndexContainer - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public virtual bool GroupInIndex - { - get { return false; } - } - - /// <summary> - /// Override this to return the folder that should be used to construct a container - /// for this item in an index. GroupInIndex should be true as well. - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public virtual Folder IndexContainer - { - get { return null; } - } - [IgnoreDataMember] public virtual Folder LatestItemsIndexContainer { diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs index c8408365d..8f5b8f6cf 100644 --- a/MediaBrowser.Controller/Entities/TV/Episode.cs +++ b/MediaBrowser.Controller/Entities/TV/Episode.cs @@ -45,16 +45,6 @@ namespace MediaBrowser.Controller.Entities.TV /// <value>The index number.</value> public int? IndexNumberEnd { get; set; } - /// <summary> - /// We want to group into series not show individually in an index - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool GroupInIndex - { - get { return true; } - } - [IgnoreDataMember] protected override bool SupportsOwnedItems { @@ -91,19 +81,6 @@ namespace MediaBrowser.Controller.Entities.TV } } - /// <summary> - /// We roll up into series - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public override Folder IndexContainer - { - get - { - return Season; - } - } - [IgnoreDataMember] public override Folder LatestItemsIndexContainer { diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index a99b8c659..cfd6b46e0 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Localization; -using MediaBrowser.Controller.Providers; +using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; using MediaBrowser.Model.Users; @@ -15,20 +14,6 @@ namespace MediaBrowser.Controller.Entities.TV /// </summary> public class Season : Folder, IHasSeries, IHasLookupInfo<SeasonInfo> { - - /// <summary> - /// Seasons are just containers - /// </summary> - /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool IncludeInIndex - { - get - { - return false; - } - } - [IgnoreDataMember] public override bool SupportsAddingToPlaylist { @@ -50,33 +35,6 @@ namespace MediaBrowser.Controller.Entities.TV get { return Series ?? Parent; } } - /// <summary> - /// We want to group into our Series - /// </summary> - /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool GroupInIndex - { - get - { - return true; - } - } - - /// <summary> - /// Override this to return the folder that should be used to construct a container - /// for this item in an index. GroupInIndex should be true as well. - /// </summary> - /// <value>The index container.</value> - [IgnoreDataMember] - public override Folder IndexContainer - { - get - { - return Series; - } - } - // Genre, Rating and Stuido will all be the same protected override IEnumerable<string> GetIndexByOptions() { diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 4696afeb6..2663d19e8 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -95,19 +95,6 @@ namespace MediaBrowser.Controller.Entities.TV } /// <summary> - /// Series aren't included directly in indices - Their Episodes will roll up to them - /// </summary> - /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value> - [IgnoreDataMember] - public override bool IncludeInIndex - { - get - { - return false; - } - } - - /// <summary> /// Gets the user data key. /// </summary> /// <returns>System.String.</returns> diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs index 71f877232..78e90af26 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -293,6 +293,12 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" } } }, diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs index 0b157ae33..b435c6364 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs @@ -310,6 +310,12 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" } } }, diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs index 0d974cbc0..b0cbb0970 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs @@ -250,6 +250,12 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" } } }, diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs index ac4cb2131..ca4e802a1 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs @@ -284,6 +284,12 @@ namespace MediaBrowser.Dlna.Profiles Condition = ProfileConditionType.LessThanEqual, Property = ProfileConditionValue.Height, Value = "1080" + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoFramerate, + Value = "30" } } } diff --git a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs index 99be102f8..bd83862a8 100644 --- a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs @@ -93,7 +93,7 @@ namespace MediaBrowser.Providers.MediaInfo private string GetAudioImagePath(Audio item) { - var album = item.Parent as MusicAlbum; + var album = item.AlbumEntity; var filename = item.Album ?? string.Empty; filename += string.Join(",", item.Artists.ToArray()); diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 402bd4d98..1b55f47d5 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -1193,7 +1193,7 @@ namespace MediaBrowser.Server.Implementations.Dto { dto.Album = audio.Album; - var albumParent = audio.FindParent<MusicAlbum>(); + var albumParent = audio.AlbumEntity; if (albumParent != null) { @@ -1208,15 +1208,6 @@ namespace MediaBrowser.Server.Implementations.Dto //} } - var album = item as MusicAlbum; - - if (album != null) - { - dto.SoundtrackIds = album.SoundtrackIds - .Select(i => i.ToString("N")) - .ToArray(); - } - var hasArtist = item as IHasArtist; if (hasArtist != null) { diff --git a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs index d501d1210..5f63a8d08 100644 --- a/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs +++ b/MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs @@ -84,7 +84,7 @@ namespace MediaBrowser.Server.Implementations.IO // This is an arbitraty amount of time, but delay it because file system writes often trigger events after RemoveTempIgnore has been called. // Seeing long delays in some situations, especially over the network. // Seeing delays up to 40 seconds, but not going to ignore changes for that long. - await Task.Delay(1500).ConfigureAwait(false); + await Task.Delay(5000).ConfigureAwait(false); string val; _tempIgnoredPaths.TryRemove(path, out val); diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 112778ec8..757e6938a 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -1550,7 +1550,7 @@ namespace MediaBrowser.Server.Implementations.Session if (info.PrimaryImageTag == null) { - var album = audio.Parents.OfType<MusicAlbum>().FirstOrDefault(); + var album = audio.AlbumEntity; if (album != null && album.HasImage(ImageType.Primary)) { diff --git a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs index 93a9bc8f6..8bbc746cb 100644 --- a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs +++ b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs @@ -122,7 +122,7 @@ namespace MediaBrowser.Server.Implementations.UserViews var audio = i as Audio; if (audio != null) { - var album = audio.FindParent<MusicAlbum>(); + var album = audio.AlbumEntity; if (album != null && album.HasImage(ImageType.Primary)) { return album; diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 26f2f8bab..6c812acce 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -281,6 +281,8 @@ namespace MediaBrowser.WebDashboard.Api await AppendResource(memoryStream, "thirdparty/jstree3.0.8/jstree.js", newLineBytes).ConfigureAwait(false); + await AppendResource(memoryStream, "thirdparty/headroom.js", newLineBytes).ConfigureAwait(false); + await AppendLocalization(memoryStream, culture).ConfigureAwait(false); await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false); diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 5c4aab1e4..0da2d5660 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -999,6 +999,9 @@ <Content Include="dashboard-ui\thirdparty\fontawesome\fonts\fontawesome-webfont.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\thirdparty\headroom.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\thirdparty\jquery-2.1.1.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
|
