mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-06 18:26:33 +00:00
update series queries
This commit is contained in:
@@ -291,6 +291,7 @@ namespace Emby.Server.Implementations.Data
|
||||
AddColumn(db, "TypedBaseItems", "Artists", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "AlbumArtists", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "ExternalId", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "SeriesPresentationUniqueKey", "Text", existingColumnNames);
|
||||
|
||||
existingColumnNames = GetColumnNames(db, "ItemValues");
|
||||
AddColumn(db, "ItemValues", "CleanValue", "Text", existingColumnNames);
|
||||
@@ -341,6 +342,7 @@ namespace Emby.Server.Implementations.Data
|
||||
"drop index if exists Idx_ProviderIds1",
|
||||
"drop table if exists Images",
|
||||
"drop index if exists idx_Images",
|
||||
"drop index if exists idx_TypeSeriesPresentationUniqueKey",
|
||||
|
||||
"create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)",
|
||||
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
|
||||
@@ -353,6 +355,9 @@ namespace Emby.Server.Implementations.Data
|
||||
// covering index
|
||||
"create index if not exists idx_TopParentIdGuid on TypedBaseItems(TopParentId,Guid)",
|
||||
|
||||
// series
|
||||
"create index if not exists idx_TypeSeriesPresentationUniqueKey1 on TypedBaseItems(Type,SeriesPresentationUniqueKey,PresentationUniqueKey,SortName)",
|
||||
|
||||
// live tv programs
|
||||
"create index if not exists idx_TypeTopParentIdStartDate on TypedBaseItems(Type,TopParentId,StartDate)",
|
||||
|
||||
@@ -488,7 +493,8 @@ namespace Emby.Server.Implementations.Data
|
||||
"ExtraType",
|
||||
"Artists",
|
||||
"AlbumArtists",
|
||||
"ExternalId"
|
||||
"ExternalId",
|
||||
"SeriesPresentationUniqueKey"
|
||||
};
|
||||
|
||||
private readonly string[] _mediaStreamSaveColumns =
|
||||
@@ -619,7 +625,8 @@ namespace Emby.Server.Implementations.Data
|
||||
"ExtraType",
|
||||
"Artists",
|
||||
"AlbumArtists",
|
||||
"ExternalId"
|
||||
"ExternalId",
|
||||
"SeriesPresentationUniqueKey"
|
||||
};
|
||||
|
||||
var saveItemCommandCommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
||||
@@ -1024,11 +1031,13 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
saveItemStatement.TryBind("@SeriesId", hasSeries.SeriesId);
|
||||
saveItemStatement.TryBind("@SeriesSortName", hasSeries.SeriesSortName);
|
||||
saveItemStatement.TryBind("@SeriesPresentationUniqueKey", hasSeries.SeriesPresentationUniqueKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
saveItemStatement.TryBindNull("@SeriesId");
|
||||
saveItemStatement.TryBindNull("@SeriesSortName");
|
||||
saveItemStatement.TryBindNull("@SeriesPresentationUniqueKey");
|
||||
}
|
||||
|
||||
saveItemStatement.TryBind("@ExternalSeriesId", item.ExternalSeriesId);
|
||||
@@ -1983,6 +1992,15 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
index++;
|
||||
|
||||
if (hasSeries != null)
|
||||
{
|
||||
if (!reader.IsDBNull(index))
|
||||
{
|
||||
hasSeries.SeriesPresentationUniqueKey = reader.GetString(index);
|
||||
}
|
||||
}
|
||||
index++;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(item.Tagline))
|
||||
{
|
||||
var movie = item as Movie;
|
||||
@@ -4292,6 +4310,16 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.SeriesPresentationUniqueKey))
|
||||
{
|
||||
whereClauses.Add("SeriesPresentationUniqueKey=@SeriesPresentationUniqueKey");
|
||||
|
||||
if (statement != null)
|
||||
{
|
||||
statement.TryBind("@SeriesPresentationUniqueKey", query.SeriesPresentationUniqueKey);
|
||||
}
|
||||
}
|
||||
|
||||
if (query.BlockUnratedItems.Length == 1)
|
||||
{
|
||||
whereClauses.Add("(InheritedParentalRatingValue > 0 or UnratedType <> @UnratedType)");
|
||||
|
||||
Reference in New Issue
Block a user