mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 05:30:46 +02:00
restore episode pooling
This commit is contained in:
parent
afe918b962
commit
b320d57409
|
@ -113,7 +113,7 @@ namespace MediaBrowser.Api
|
||||||
config.EnableCustomPathSubFolders = true;
|
config.EnableCustomPathSubFolders = true;
|
||||||
config.EnableStandaloneMusicKeys = true;
|
config.EnableStandaloneMusicKeys = true;
|
||||||
config.EnableCaseSensitiveItemIds = true;
|
config.EnableCaseSensitiveItemIds = true;
|
||||||
config.SchemaVersion = 87;
|
config.SchemaVersion = 89;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Post(UpdateStartupConfiguration request)
|
public void Post(UpdateStartupConfiguration request)
|
||||||
|
|
|
@ -107,9 +107,11 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (EnablePooling())
|
var userdatakeys = GetUserDataKeys();
|
||||||
|
|
||||||
|
if (userdatakeys.Count > 1)
|
||||||
{
|
{
|
||||||
return GetUserDataKeys().First();
|
return userdatakeys[0];
|
||||||
}
|
}
|
||||||
return base.PresentationUniqueKey;
|
return base.PresentationUniqueKey;
|
||||||
}
|
}
|
||||||
|
@ -207,33 +209,13 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
{
|
{
|
||||||
IEnumerable<Season> seasons;
|
IEnumerable<Season> seasons;
|
||||||
|
|
||||||
if (EnablePooling())
|
seasons = LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
var seriesIds = LibraryManager.GetItemIds(new InternalItemsQuery(user)
|
AncestorWithPresentationUniqueKey = PresentationUniqueKey,
|
||||||
{
|
IncludeItemTypes = new[] { typeof(Season).Name },
|
||||||
PresentationUniqueKey = PresentationUniqueKey,
|
SortBy = new[] { ItemSortBy.SortName }
|
||||||
IncludeItemTypes = new[] { typeof(Series).Name }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (seriesIds.Count > 1)
|
}).Cast<Season>();
|
||||||
{
|
|
||||||
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>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!includeMissingSeasons)
|
if (!includeMissingSeasons)
|
||||||
{
|
{
|
||||||
|
@ -343,50 +325,15 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
return GetEpisodes(user, season, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
|
return GetEpisodes(user, season, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool EnablePooling()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerable<Episode> GetAllEpisodes(User user)
|
private IEnumerable<Episode> GetAllEpisodes(User user)
|
||||||
{
|
{
|
||||||
IEnumerable<Episode> episodes;
|
return LibraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
|
|
||||||
if (EnablePooling())
|
|
||||||
{
|
{
|
||||||
var seriesIds = LibraryManager.GetItemIds(new InternalItemsQuery(user)
|
AncestorWithPresentationUniqueKey = PresentationUniqueKey,
|
||||||
{
|
IncludeItemTypes = new[] { typeof(Episode).Name },
|
||||||
PresentationUniqueKey = PresentationUniqueKey,
|
SortBy = new[] { ItemSortBy.SortName }
|
||||||
IncludeItemTypes = new[] { typeof(Series).Name }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (seriesIds.Count > 1)
|
}).Cast<Episode>();
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<Episode> GetEpisodes(User user, Season parentSeason, bool includeMissingEpisodes, bool includeVirtualUnairedEpisodes)
|
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 _updateInheritedRatingCommand;
|
||||||
private IDbCommand _updateInheritedTagsCommand;
|
private IDbCommand _updateInheritedTagsCommand;
|
||||||
|
|
||||||
public const int LatestSchemaVersion = 87;
|
public const int LatestSchemaVersion = 89;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
/// 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 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_PathTypedBaseItems on TypedBaseItems(Path)",
|
||||||
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
|
"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 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)",
|
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
|
||||||
|
|
Loading…
Reference in a new issue