added headroom scrolling

pull/702/head
Luke Pulverenti 10 years ago
parent d34ddf3ebd
commit a38f04b1b9

@ -648,10 +648,8 @@ namespace MediaBrowser.Api.Images
var serverFormats = _imageProcessor.GetSupportedImageOutputFormats(); var serverFormats = _imageProcessor.GetSupportedImageOutputFormats();
var clientFormats = GetClientSupportedFormats();
if (serverFormats.Contains(ImageFormat.Webp) && if (serverFormats.Contains(ImageFormat.Webp) &&
clientFormats.Contains(ImageFormat.Webp)) GetClientSupportedFormats().Contains(ImageFormat.Webp))
{ {
return ImageFormat.Webp; return ImageFormat.Webp;
} }

@ -617,36 +617,14 @@ namespace MediaBrowser.Api.Library
: (Folder)_libraryManager.RootFolder) : (Folder)_libraryManager.RootFolder)
: _libraryManager.GetItemById(request.Id); : _libraryManager.GetItemById(request.Id);
var originalItem = item;
while (GetThemeSongIds(item).Count == 0 && request.InheritFromParent && item.Parent != null) while (GetThemeSongIds(item).Count == 0 && request.InheritFromParent && item.Parent != null)
{ {
item = item.Parent; 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 dtoOptions = GetDtoOptions(request);
var dtos = themeSongIds.Select(_libraryManager.GetItemById) var dtos = GetThemeSongIds(item).Select(_libraryManager.GetItemById)
.OrderBy(i => i.SortName) .OrderBy(i => i.SortName)
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item));
@ -682,41 +660,14 @@ namespace MediaBrowser.Api.Library
: (Folder)_libraryManager.RootFolder) : (Folder)_libraryManager.RootFolder)
: _libraryManager.GetItemById(request.Id); : _libraryManager.GetItemById(request.Id);
var originalItem = item;
while (GetThemeVideoIds(item).Count == 0 && request.InheritFromParent && item.Parent != null) while (GetThemeVideoIds(item).Count == 0 && request.InheritFromParent && item.Parent != null)
{ {
item = item.Parent; 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 dtoOptions = GetDtoOptions(request);
var dtos = themeVideoIds.Select(_libraryManager.GetItemById) var dtos = GetThemeVideoIds(item).Select(_libraryManager.GetItemById)
.OrderBy(i => i.SortName) .OrderBy(i => i.SortName)
.Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item)); .Select(i => _dtoService.GetBaseItemDto(i, dtoOptions, user, item));

@ -52,34 +52,6 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <value><c>true</c> if this instance has embedded image; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance has embedded image; otherwise, <c>false</c>.</value>
public bool HasEmbeddedImage { get; set; } 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] [IgnoreDataMember]
protected override bool SupportsOwnedItems protected override bool SupportsOwnedItems
{ {
@ -94,7 +66,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{ {
get get
{ {
return Parents.OfType<MusicAlbum>().FirstOrDefault(); return AlbumEntity;
} }
} }
@ -148,6 +120,12 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <value>The album.</value> /// <value>The album.</value>
public string Album { get; set; } public string Album { get; set; }
[IgnoreDataMember]
public MusicAlbum AlbumEntity
{
get { return FindParent<MusicAlbum>(); }
}
/// <summary> /// <summary>
/// Gets the type of the media. /// Gets the type of the media.
/// </summary> /// </summary>
@ -177,7 +155,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
protected override string CreateUserDataKey() protected override string CreateUserDataKey()
{ {
var parent = FindParent<MusicAlbum>(); var parent = AlbumEntity;
if (parent != null) if (parent != null)
{ {

@ -2,7 +2,6 @@
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Users; using MediaBrowser.Model.Users;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
@ -14,11 +13,8 @@ namespace MediaBrowser.Controller.Entities.Audio
/// </summary> /// </summary>
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo> public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<AlbumInfo>
{ {
public List<Guid> SoundtrackIds { get; set; }
public MusicAlbum() public MusicAlbum()
{ {
SoundtrackIds = new List<Guid>();
Artists = new List<string>(); Artists = new List<string>();
AlbumArtists = new List<string>(); AlbumArtists = new List<string>();
} }
@ -77,49 +73,6 @@ namespace MediaBrowser.Controller.Entities.Audio
return Tracks; 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; } public List<string> Artists { get; set; }
/// <summary> /// <summary>

@ -496,7 +496,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
/// <returns>``0.</returns> /// <returns>``0.</returns>
public T FindParent<T>() protected T FindParent<T>()
where T : Folder where T : Folder
{ {
return Parents.OfType<T>().FirstOrDefault(); return Parents.OfType<T>().FirstOrDefault();
@ -906,38 +906,6 @@ namespace MediaBrowser.Controller.Entities
/// <value>The provider ids.</value> /// <value>The provider ids.</value>
public Dictionary<string, string> ProviderIds { get; set; } 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] [IgnoreDataMember]
public virtual Folder LatestItemsIndexContainer public virtual Folder LatestItemsIndexContainer
{ {

@ -45,16 +45,6 @@ namespace MediaBrowser.Controller.Entities.TV
/// <value>The index number.</value> /// <value>The index number.</value>
public int? IndexNumberEnd { get; set; } 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] [IgnoreDataMember]
protected override bool SupportsOwnedItems 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] [IgnoreDataMember]
public override Folder LatestItemsIndexContainer public override Folder LatestItemsIndexContainer
{ {

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Users; using MediaBrowser.Model.Users;
@ -15,20 +14,6 @@ namespace MediaBrowser.Controller.Entities.TV
/// </summary> /// </summary>
public class Season : Folder, IHasSeries, IHasLookupInfo<SeasonInfo> 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] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist
{ {
@ -50,33 +35,6 @@ namespace MediaBrowser.Controller.Entities.TV
get { return Series ?? Parent; } 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 // Genre, Rating and Stuido will all be the same
protected override IEnumerable<string> GetIndexByOptions() protected override IEnumerable<string> GetIndexByOptions()
{ {

@ -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> /// <summary>
/// Gets the user data key. /// Gets the user data key.
/// </summary> /// </summary>

@ -293,6 +293,12 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual, Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height, Property = ProfileConditionValue.Height,
Value = "1080" Value = "1080"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoFramerate,
Value = "30"
} }
} }
}, },

@ -310,6 +310,12 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual, Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height, Property = ProfileConditionValue.Height,
Value = "1080" Value = "1080"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoFramerate,
Value = "30"
} }
} }
}, },

@ -250,6 +250,12 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual, Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height, Property = ProfileConditionValue.Height,
Value = "1080" Value = "1080"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoFramerate,
Value = "30"
} }
} }
}, },

@ -284,6 +284,12 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual, Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height, Property = ProfileConditionValue.Height,
Value = "1080" Value = "1080"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoFramerate,
Value = "30"
} }
} }
} }

@ -93,7 +93,7 @@ namespace MediaBrowser.Providers.MediaInfo
private string GetAudioImagePath(Audio item) private string GetAudioImagePath(Audio item)
{ {
var album = item.Parent as MusicAlbum; var album = item.AlbumEntity;
var filename = item.Album ?? string.Empty; var filename = item.Album ?? string.Empty;
filename += string.Join(",", item.Artists.ToArray()); filename += string.Join(",", item.Artists.ToArray());

@ -1193,7 +1193,7 @@ namespace MediaBrowser.Server.Implementations.Dto
{ {
dto.Album = audio.Album; dto.Album = audio.Album;
var albumParent = audio.FindParent<MusicAlbum>(); var albumParent = audio.AlbumEntity;
if (albumParent != null) 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; var hasArtist = item as IHasArtist;
if (hasArtist != null) if (hasArtist != null)
{ {

@ -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. // 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 long delays in some situations, especially over the network.
// Seeing delays up to 40 seconds, but not going to ignore changes for that long. // 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; string val;
_tempIgnoredPaths.TryRemove(path, out val); _tempIgnoredPaths.TryRemove(path, out val);

@ -1550,7 +1550,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (info.PrimaryImageTag == null) if (info.PrimaryImageTag == null)
{ {
var album = audio.Parents.OfType<MusicAlbum>().FirstOrDefault(); var album = audio.AlbumEntity;
if (album != null && album.HasImage(ImageType.Primary)) if (album != null && album.HasImage(ImageType.Primary))
{ {

@ -122,7 +122,7 @@ namespace MediaBrowser.Server.Implementations.UserViews
var audio = i as Audio; var audio = i as Audio;
if (audio != null) if (audio != null)
{ {
var album = audio.FindParent<MusicAlbum>(); var album = audio.AlbumEntity;
if (album != null && album.HasImage(ImageType.Primary)) if (album != null && album.HasImage(ImageType.Primary))
{ {
return album; return album;

@ -281,6 +281,8 @@ namespace MediaBrowser.WebDashboard.Api
await AppendResource(memoryStream, "thirdparty/jstree3.0.8/jstree.js", newLineBytes).ConfigureAwait(false); 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 AppendLocalization(memoryStream, culture).ConfigureAwait(false);
await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false); await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);

@ -999,6 +999,9 @@
<Content Include="dashboard-ui\thirdparty\fontawesome\fonts\fontawesome-webfont.svg"> <Content Include="dashboard-ui\thirdparty\fontawesome\fonts\fontawesome-webfont.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\thirdparty\headroom.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\thirdparty\jquery-2.1.1.min.js"> <Content Include="dashboard-ui\thirdparty\jquery-2.1.1.min.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

Loading…
Cancel
Save