mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 22:38:30 +01:00
merge branch master into media-attachments
This commit is contained in:
@@ -1152,6 +1152,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public List<BaseItem> GetChildren(User user, bool includeLinkedChildren)
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(user));
|
||||
}
|
||||
|
||||
return GetChildren(user, includeLinkedChildren, null);
|
||||
}
|
||||
|
||||
@@ -1163,7 +1168,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
|
||||
//the true root should return our users root folder children
|
||||
if (IsPhysicalRoot) return LibraryManager.GetUserRootFolder().GetChildren(user, includeLinkedChildren);
|
||||
if (IsPhysicalRoot)
|
||||
{
|
||||
return LibraryManager.GetUserRootFolder().GetChildren(user, includeLinkedChildren);
|
||||
}
|
||||
|
||||
var result = new Dictionary<Guid, BaseItem>();
|
||||
|
||||
|
||||
@@ -8,8 +8,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
public interface ICollectionFolder : IHasCollectionType
|
||||
{
|
||||
string Path { get; }
|
||||
|
||||
string Name { get; }
|
||||
|
||||
Guid Id { get; }
|
||||
|
||||
string[] PhysicalLocations { get; }
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
public bool EnableGroupByMetadataKey { get; set; }
|
||||
public bool? HasChapterImages { get; set; }
|
||||
|
||||
public ValueTuple<string, SortOrder>[] OrderBy { get; set; }
|
||||
public IReadOnlyList<(string, SortOrder)> OrderBy { get; set; }
|
||||
|
||||
public DateTime? MinDateCreated { get; set; }
|
||||
public DateTime? MinDateLastSaved { get; set; }
|
||||
|
||||
@@ -226,14 +226,16 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
query.AncestorWithPresentationUniqueKey = null;
|
||||
query.SeriesPresentationUniqueKey = seriesKey;
|
||||
if (query.OrderBy.Length == 0)
|
||||
if (query.OrderBy.Count == 0)
|
||||
{
|
||||
query.OrderBy = new[] { ItemSortBy.SortName }.Select(i => new ValueTuple<string, SortOrder>(i, SortOrder.Ascending)).ToArray();
|
||||
}
|
||||
|
||||
if (query.IncludeItemTypes.Length == 0)
|
||||
{
|
||||
query.IncludeItemTypes = new[] { typeof(Episode).Name, typeof(Season).Name };
|
||||
}
|
||||
|
||||
query.IsVirtualItem = false;
|
||||
return LibraryManager.GetItemsResult(query);
|
||||
}
|
||||
|
||||
@@ -10,34 +10,36 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public class UserView : Folder, IHasCollectionType
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public string ViewType { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public new Guid DisplayParentId { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
public static ITVSeriesManager TVSeriesManager;
|
||||
|
||||
/// <inheritdoc />
|
||||
[JsonIgnore]
|
||||
public string CollectionType => ViewType;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override IEnumerable<Guid> GetIdsForAncestorQuery()
|
||||
{
|
||||
var list = new List<Guid>();
|
||||
|
||||
if (!DisplayParentId.Equals(Guid.Empty))
|
||||
{
|
||||
list.Add(DisplayParentId);
|
||||
yield return DisplayParentId;
|
||||
}
|
||||
else if (!ParentId.Equals(Guid.Empty))
|
||||
{
|
||||
list.Add(ParentId);
|
||||
yield return ParentId;
|
||||
}
|
||||
else
|
||||
{
|
||||
list.Add(Id);
|
||||
yield return Id;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
@@ -450,14 +450,16 @@ namespace MediaBrowser.Controller.Entities
|
||||
return SortAndPage(items, totalRecordLimit, query, libraryManager, true);
|
||||
}
|
||||
|
||||
public static QueryResult<BaseItem> SortAndPage(IEnumerable<BaseItem> items,
|
||||
public static QueryResult<BaseItem> SortAndPage(
|
||||
IEnumerable<BaseItem> items,
|
||||
int? totalRecordLimit,
|
||||
InternalItemsQuery query,
|
||||
ILibraryManager libraryManager, bool enableSorting)
|
||||
ILibraryManager libraryManager,
|
||||
bool enableSorting)
|
||||
{
|
||||
if (enableSorting)
|
||||
{
|
||||
if (query.OrderBy.Length > 0)
|
||||
if (query.OrderBy.Count > 0)
|
||||
{
|
||||
items = libraryManager.Sort(items, query.User, query.OrderBy);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value>The video3 D format.</value>
|
||||
public Video3DFormat? Video3DFormat { get; set; }
|
||||
|
||||
public string[] GetPlayableStreamFileNames(IMediaEncoder mediaEncoder)
|
||||
public string[] GetPlayableStreamFileNames()
|
||||
{
|
||||
var videoType = VideoType;
|
||||
|
||||
@@ -153,7 +153,8 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
return mediaEncoder.GetPlayableStreamFileNames(Path, videoType);
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user