The Free Software Media System - Server Backend & API
added headroom scrolling
Luke Pulverentia38f04b1b95a
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.csindex 7da11a405c..639c1f54b0 100644--- a/MediaBrowser.Api/Images/ImageService.cs+++ b/MediaBrowser.Api/Images/ImageService.cs@@ -648,10 +648,8 @@ namespace MediaBrowser.Api.Imagesvar 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.csindex f89a703406..269f4cb201 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.csindex 100633d7ff..623329ca66 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.csindex dc3f13b01d..c060f53a69 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.Audioreturn 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.csindex 3313f45fd1..bbc3b6fd31 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.csindex c8408365d3..8f5b8f6cff 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.csindex a99b8c659a..cfd6b46e0f 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.TVget { 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 sameprotected override IEnumerable<string> GetIndexByOptions(){diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.csindex 4696afeb62..2663d19e8f 100644--- a/MediaBrowser.Controller/Entities/TV/Series.cs+++ b/MediaBrowser.Controller/Entities/TV/Series.cs@@ -94,19 +94,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>diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.csindex 71f8772325..78e90af26e 100644--- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs+++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs@@ -293,6 +293,12 @@ namespace MediaBrowser.Dlna.ProfilesCondition = 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.csindex 0b157ae336..b435c63642 100644--- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs+++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs@@ -310,6 +310,12 @@ namespace MediaBrowser.Dlna.ProfilesCondition = 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.csindex 0d974cbc0e..b0cbb0970d 100644--- a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs+++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs@@ -250,6 +250,12 @@ namespace MediaBrowser.Dlna.ProfilesCondition = 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.csindex ac4cb21312..ca4e802a16 100644--- a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs+++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs@@ -284,6 +284,12 @@ namespace MediaBrowser.Dlna.ProfilesCondition = 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.csindex 99be102f85..bd83862a8a 100644--- a/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs+++ b/MediaBrowser.Providers/MediaInfo/AudioImageProvider.cs@@ -93,7 +93,7 @@ namespace MediaBrowser.Providers.MediaInfoprivate 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.csindex 402bd4d985..1b55f47d5e 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.csindex d501d1210b..5f63a8d08a 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.csindex 112778ec8a..757e6938ad 100644--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs@@ -1550,7 +1550,7 @@ namespace MediaBrowser.Server.Implementations.Sessionif (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.csindex 93a9bc8f6f..8bbc746cb3 100644--- a/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs+++ b/MediaBrowser.Server.Implementations/UserViews/DynamicImageProvider.cs@@ -122,7 +122,7 @@ namespace MediaBrowser.Server.Implementations.UserViewsvar 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.csindex 26f2f8babd..6c812acce0 100644--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs@@ -281,6 +281,8 @@ namespace MediaBrowser.WebDashboard.Apiawait 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.csprojindex 5c4aab1e4f..0da2d56606 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>