update indexes
This commit is contained in:
parent
e69f7b757f
commit
624ac450c2
|
@ -140,10 +140,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||||
|
|
||||||
|
var topFolder = await GetInternalLiveTvFolder(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var channels = _libraryManager.GetItemList(new InternalItemsQuery
|
var channels = _libraryManager.GetItemList(new InternalItemsQuery
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { typeof(LiveTvChannel).Name },
|
IncludeItemTypes = new[] { typeof(LiveTvChannel).Name },
|
||||||
SortBy = new[] { ItemSortBy.SortName }
|
SortBy = new[] { ItemSortBy.SortName },
|
||||||
|
TopParentIds = new[] { topFolder.Id.ToString("N") }
|
||||||
|
|
||||||
}).Cast<LiveTvChannel>();
|
}).Cast<LiveTvChannel>();
|
||||||
|
|
||||||
|
@ -891,6 +894,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||||
|
|
||||||
|
var topFolder = await GetInternalLiveTvFolder(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var internalQuery = new InternalItemsQuery(user)
|
var internalQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { typeof(LiveTvProgram).Name },
|
IncludeItemTypes = new[] { typeof(LiveTvProgram).Name },
|
||||||
|
@ -907,7 +912,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
Limit = query.Limit,
|
Limit = query.Limit,
|
||||||
SortBy = query.SortBy,
|
SortBy = query.SortBy,
|
||||||
SortOrder = query.SortOrder ?? SortOrder.Ascending,
|
SortOrder = query.SortOrder ?? SortOrder.Ascending,
|
||||||
EnableTotalRecordCount = query.EnableTotalRecordCount
|
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||||
|
TopParentIds = new[] { topFolder.Id.ToString("N") }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (query.HasAired.HasValue)
|
if (query.HasAired.HasValue)
|
||||||
|
@ -939,6 +945,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
var user = _userManager.GetUserById(query.UserId);
|
var user = _userManager.GetUserById(query.UserId);
|
||||||
|
|
||||||
|
var topFolder = await GetInternalLiveTvFolder(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var internalQuery = new InternalItemsQuery(user)
|
var internalQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { typeof(LiveTvProgram).Name },
|
IncludeItemTypes = new[] { typeof(LiveTvProgram).Name },
|
||||||
|
@ -947,7 +955,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
IsSports = query.IsSports,
|
IsSports = query.IsSports,
|
||||||
IsKids = query.IsKids,
|
IsKids = query.IsKids,
|
||||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||||
SortBy = new[] { ItemSortBy.StartDate }
|
SortBy = new[] { ItemSortBy.StartDate },
|
||||||
|
TopParentIds = new[] { topFolder.Id.ToString("N") }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (query.Limit.HasValue)
|
if (query.Limit.HasValue)
|
||||||
|
@ -1905,7 +1914,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
MaxStartDate = now,
|
MaxStartDate = now,
|
||||||
MinEndDate = now,
|
MinEndDate = now,
|
||||||
Limit = channelIds.Length,
|
Limit = channelIds.Length,
|
||||||
SortBy = new[] { "StartDate" }
|
SortBy = new[] { "StartDate" },
|
||||||
|
TopParentIds = new[] { GetInternalLiveTvFolder(CancellationToken.None).Result.Id.ToString("N") }
|
||||||
|
|
||||||
}, new string[] { }).ToList();
|
}, new string[] { }).ToList();
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||||
"create index if not exists idx_TypeTopParentId2 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem)",
|
"create index if not exists idx_TypeTopParentId2 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem)",
|
||||||
"create index if not exists idx_TypeTopParentId3 on TypedBaseItems(TopParentId,IsFolder,IsVirtualItem)",
|
"create index if not exists idx_TypeTopParentId3 on TypedBaseItems(TopParentId,IsFolder,IsVirtualItem)",
|
||||||
"create index if not exists idx_TypeTopParentId4 on TypedBaseItems(TopParentId,Type,IsVirtualItem)",
|
"create index if not exists idx_TypeTopParentId4 on TypedBaseItems(TopParentId,Type,IsVirtualItem)",
|
||||||
"create index if not exists idx_TypeTopParentId5 on TypedBaseItems(TopParentId,IsVirtualItem)"
|
"create index if not exists idx_TypeTopParentId5 on TypedBaseItems(TopParentId,IsVirtualItem)",
|
||||||
|
"create index if not exists idx_TypeTopParentId6 on TypedBaseItems(TopParentId,Type,IsVirtualItem,PresentationUniqueKey)",
|
||||||
|
"create index if not exists idx_TypeTopParentId7 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem,PresentationUniqueKey)",
|
||||||
|
"create index if not exists idx_TypeTopParentId8 on TypedBaseItems(TopParentId,IsFolder,IsVirtualItem,PresentationUniqueKey)"
|
||||||
};
|
};
|
||||||
|
|
||||||
_connection.RunQueries(postQueries, Logger);
|
_connection.RunQueries(postQueries, Logger);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user