commit
259c5b9d44
|
@ -275,8 +275,6 @@ namespace MediaBrowser.Api.Reports
|
|||
case ItemFilter.IsPlayed:
|
||||
query.IsPlayed = true;
|
||||
break;
|
||||
case ItemFilter.IsRecentlyAdded:
|
||||
break;
|
||||
case ItemFilter.IsResumable:
|
||||
query.IsResumable = true;
|
||||
break;
|
||||
|
|
|
@ -164,8 +164,6 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
case ItemFilter.IsPlayed:
|
||||
query.IsPlayed = true;
|
||||
break;
|
||||
case ItemFilter.IsRecentlyAdded:
|
||||
break;
|
||||
case ItemFilter.IsResumable:
|
||||
query.IsResumable = true;
|
||||
break;
|
||||
|
|
|
@ -149,24 +149,6 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
item = user == null ? _libraryManager.RootFolder : user.RootFolder;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(request.Ids))
|
||||
{
|
||||
var query = GetItemsQuery(request, user);
|
||||
var specificItems = _libraryManager.GetItemList(query).ToArray();
|
||||
if (query.SortBy.Length == 0)
|
||||
{
|
||||
var ids = query.ItemIds.ToList();
|
||||
|
||||
// Try to preserve order
|
||||
specificItems = specificItems.OrderBy(i => ids.IndexOf(i.Id.ToString("N"))).ToArray();
|
||||
}
|
||||
return new QueryResult<BaseItem>
|
||||
{
|
||||
Items = specificItems.ToArray(),
|
||||
TotalRecordCount = specificItems.Length
|
||||
};
|
||||
}
|
||||
|
||||
// Default list type = children
|
||||
|
||||
var folder = item as Folder;
|
||||
|
@ -289,8 +271,6 @@ namespace MediaBrowser.Api.UserLibrary
|
|||
case ItemFilter.IsPlayed:
|
||||
query.IsPlayed = true;
|
||||
break;
|
||||
case ItemFilter.IsRecentlyAdded:
|
||||
break;
|
||||
case ItemFilter.IsResumable:
|
||||
query.IsResumable = true;
|
||||
break;
|
||||
|
|
|
@ -891,16 +891,16 @@ namespace MediaBrowser.Controller.Entities
|
|||
{
|
||||
if (query.ItemIds.Length > 0)
|
||||
{
|
||||
var specificItems = query.ItemIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
|
||||
var result = LibraryManager.GetItemsResult(query);
|
||||
|
||||
if (query.SortBy.Length == 0)
|
||||
{
|
||||
var ids = query.ItemIds.ToList();
|
||||
|
||||
// Try to preserve order
|
||||
specificItems = specificItems.OrderBy(i => ids.IndexOf(i.Id.ToString("N"))).ToList();
|
||||
result.Items = result.Items.OrderBy(i => ids.IndexOf(i.Id.ToString("N"))).ToArray();
|
||||
}
|
||||
return Task.FromResult(PostFilterAndSort(specificItems, query, true, true));
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
|
||||
return GetItemsInternal(query);
|
||||
|
|
|
@ -135,7 +135,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
[IgnoreDataMember]
|
||||
public Series Series
|
||||
{
|
||||
get { return FindParent<Series>(); }
|
||||
get
|
||||
{
|
||||
var seriesId = SeriesId ?? FindSeriesId();
|
||||
return seriesId.HasValue ? (LibraryManager.GetItemById(seriesId.Value) as Series) : null;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
@ -143,24 +147,8 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
{
|
||||
get
|
||||
{
|
||||
var season = FindParent<Season>();
|
||||
|
||||
// Episodes directly in series folder
|
||||
if (season == null)
|
||||
{
|
||||
var series = Series;
|
||||
|
||||
if (series != null && ParentIndexNumber.HasValue)
|
||||
{
|
||||
var findNumber = ParentIndexNumber.Value;
|
||||
|
||||
season = series.Children
|
||||
.OfType<Season>()
|
||||
.FirstOrDefault(i => i.IndexNumber.HasValue && i.IndexNumber.Value == findNumber);
|
||||
}
|
||||
}
|
||||
|
||||
return season;
|
||||
var seasonId = SeasonId ?? FindSeasonId();
|
||||
return seasonId.HasValue ? (LibraryManager.GetItemById(seasonId.Value) as Season) : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,7 +181,23 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
|
||||
public Guid? FindSeasonId()
|
||||
{
|
||||
var season = Season;
|
||||
var season = FindParent<Season>();
|
||||
|
||||
// Episodes directly in series folder
|
||||
if (season == null)
|
||||
{
|
||||
var series = Series;
|
||||
|
||||
if (series != null && ParentIndexNumber.HasValue)
|
||||
{
|
||||
var findNumber = ParentIndexNumber.Value;
|
||||
|
||||
season = series.Children
|
||||
.OfType<Season>()
|
||||
.FirstOrDefault(i => i.IndexNumber.HasValue && i.IndexNumber.Value == findNumber);
|
||||
}
|
||||
}
|
||||
|
||||
return season == null ? (Guid?)null : season.Id;
|
||||
}
|
||||
|
||||
|
@ -263,7 +267,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
|
||||
public Guid? FindSeriesId()
|
||||
{
|
||||
var series = Series;
|
||||
var series = FindParent<Series>();
|
||||
return series == null ? (Guid?)null : series.Id;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
[IgnoreDataMember]
|
||||
public Series Series
|
||||
{
|
||||
get { return FindParent<Series>(); }
|
||||
get
|
||||
{
|
||||
var seriesId = SeriesId ?? FindSeriesId();
|
||||
return seriesId.HasValue ? (LibraryManager.GetItemById(seriesId.Value) as Series) : null;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
|
@ -241,7 +245,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
|
||||
public Guid? FindSeriesId()
|
||||
{
|
||||
var series = Series;
|
||||
var series = FindParent<Series>();
|
||||
return series == null ? (Guid?)null : series.Id;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,6 @@ namespace MediaBrowser.Model.Querying
|
|||
/// </summary>
|
||||
IsFavorite = 5,
|
||||
/// <summary>
|
||||
/// The is recently added
|
||||
/// </summary>
|
||||
IsRecentlyAdded = 6,
|
||||
/// <summary>
|
||||
/// The item is resumable
|
||||
/// </summary>
|
||||
IsResumable = 7,
|
||||
|
|
|
@ -203,12 +203,6 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|||
/// <returns>Video.</returns>
|
||||
protected override Video Resolve(ItemResolveArgs args)
|
||||
{
|
||||
if (args.Path != null && args.Path.IndexOf("disney", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
var b = true;
|
||||
var a = b;
|
||||
}
|
||||
|
||||
var collectionType = args.GetCollectionType();
|
||||
|
||||
if (IsInvalid(args.Parent, collectionType))
|
||||
|
|
Loading…
Reference in New Issue
Block a user