restore episode pooling
This commit is contained in:
parent
afe918b962
commit
b320d57409
|
@ -113,7 +113,7 @@ namespace MediaBrowser.Api
|
|||
config.EnableCustomPathSubFolders = true;
|
||||
config.EnableStandaloneMusicKeys = true;
|
||||
config.EnableCaseSensitiveItemIds = true;
|
||||
config.SchemaVersion = 87;
|
||||
config.SchemaVersion = 89;
|
||||
}
|
||||
|
||||
public void Post(UpdateStartupConfiguration request)
|
||||
|
|
|
@ -107,9 +107,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
{
|
||||
get
|
||||
{
|
||||
if (EnablePooling())
|
||||
var userdatakeys = GetUserDataKeys();
|
||||
|
||||
if (userdatakeys.Count > 1)
|
||||
{
|
||||
return GetUserDataKeys().First();
|
||||
return userdatakeys[0];
|
||||
}
|
||||
return base.PresentationUniqueKey;
|
||||
}
|
||||
|
@ -207,33 +209,13 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
{
|
||||
IEnumerable<Season> seasons;
|
||||
|
||||
if (EnablePooling())
|
||||
seasons = LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||
{
|
||||
var seriesIds = LibraryManager.GetItemIds(new InternalItemsQuery(user)
|
||||
{
|
||||
PresentationUniqueKey = PresentationUniqueKey,
|
||||
IncludeItemTypes = new[] { typeof(Series).Name }
|
||||
});
|
||||
AncestorWithPresentationUniqueKey = PresentationUniqueKey,
|
||||
IncludeItemTypes = new[] { typeof(Season).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName }
|
||||
|
||||
if (seriesIds.Count > 1)
|
||||
{
|
||||
seasons = LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorIds = seriesIds.Select(i => i.ToString("N")).ToArray(),
|
||||
IncludeItemTypes = new[] { typeof(Season).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName }
|
||||
|
||||
}).Cast<Season>();
|
||||
}
|
||||
else
|
||||
{
|
||||
seasons = LibraryManager.Sort(base.GetChildren(user, true), user, new[] { ItemSortBy.SortName }, SortOrder.Ascending).OfType<Season>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
seasons = LibraryManager.Sort(base.GetChildren(user, true), user, new[] { ItemSortBy.SortName }, SortOrder.Ascending).OfType<Season>();
|
||||
}
|
||||
}).Cast<Season>();
|
||||
|
||||
if (!includeMissingSeasons)
|
||||
{
|
||||
|
@ -343,50 +325,15 @@ namespace MediaBrowser.Controller.Entities.TV
|
|||
return GetEpisodes(user, season, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
|
||||
}
|
||||
|
||||
private bool EnablePooling()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private IEnumerable<Episode> GetAllEpisodes(User user)
|
||||
{
|
||||
IEnumerable<Episode> episodes;
|
||||
|
||||
if (EnablePooling())
|
||||
return LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||
{
|
||||
var seriesIds = LibraryManager.GetItemIds(new InternalItemsQuery(user)
|
||||
{
|
||||
PresentationUniqueKey = PresentationUniqueKey,
|
||||
IncludeItemTypes = new[] { typeof(Series).Name }
|
||||
});
|
||||
AncestorWithPresentationUniqueKey = PresentationUniqueKey,
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName }
|
||||
|
||||
if (seriesIds.Count > 1)
|
||||
{
|
||||
episodes = LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorIds = seriesIds.Select(i => i.ToString("N")).ToArray(),
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName }
|
||||
|
||||
}).Cast<Episode>();
|
||||
}
|
||||
else
|
||||
{
|
||||
episodes = GetRecursiveChildren(user, new InternalItemsQuery(user)
|
||||
{
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name }
|
||||
}).Cast<Episode>();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
episodes = GetRecursiveChildren(user, new InternalItemsQuery(user)
|
||||
{
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name }
|
||||
}).Cast<Episode>();
|
||||
}
|
||||
|
||||
return episodes;
|
||||
}).Cast<Episode>();
|
||||
}
|
||||
|
||||
public IEnumerable<Episode> GetEpisodes(User user, Season parentSeason, bool includeMissingEpisodes, bool includeVirtualUnairedEpisodes)
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
private IDbCommand _updateInheritedRatingCommand;
|
||||
private IDbCommand _updateInheritedTagsCommand;
|
||||
|
||||
public const int LatestSchemaVersion = 87;
|
||||
public const int LatestSchemaVersion = 89;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
||||
|
@ -137,6 +137,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB, ParentId GUID, Path TEXT)",
|
||||
"create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)",
|
||||
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
|
||||
"create index if not exists idx_TypedBaseItems2 on TypedBaseItems(Type,Guid)",
|
||||
|
||||
"create table if not exists AncestorIds (ItemId GUID, AncestorId GUID, AncestorIdText TEXT, PRIMARY KEY (ItemId, AncestorId))",
|
||||
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
|
||||
|
|
Loading…
Reference in New Issue
Block a user