3.2.17.11
This commit is contained in:
parent
8b9e7e1f59
commit
27c3acb2bf
|
@ -1348,10 +1348,10 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
private BaseItem GetItem(IReadOnlyList<IResultSetValue> reader, InternalItemsQuery query)
|
private BaseItem GetItem(IReadOnlyList<IResultSetValue> reader, InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
return GetItem(reader, query, HasProgramAttributes(query), HasEpisodeAttributes(query), HasStartDate(query), HasTrailerTypes(query), HasArtistFields(query));
|
return GetItem(reader, query, HasProgramAttributes(query), HasEpisodeAttributes(query), HasStartDate(query), HasTrailerTypes(query), HasArtistFields(query), HasSeriesFields(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
private BaseItem GetItem(IReadOnlyList<IResultSetValue> reader, InternalItemsQuery query, bool enableProgramAttributes, bool hasEpisodeAttributes, bool queryHasStartDate, bool hasTrailerTypes, bool hasArtistFields)
|
private BaseItem GetItem(IReadOnlyList<IResultSetValue> reader, InternalItemsQuery query, bool enableProgramAttributes, bool hasEpisodeAttributes, bool queryHasStartDate, bool hasTrailerTypes, bool hasArtistFields, bool hasSeriesFields)
|
||||||
{
|
{
|
||||||
var typeString = reader.GetString(0);
|
var typeString = reader.GetString(0);
|
||||||
|
|
||||||
|
@ -1800,6 +1800,8 @@ namespace Emby.Server.Implementations.Data
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
var hasSeries = item as IHasSeries;
|
var hasSeries = item as IHasSeries;
|
||||||
|
if (hasSeriesFields)
|
||||||
|
{
|
||||||
if (hasSeries != null)
|
if (hasSeries != null)
|
||||||
{
|
{
|
||||||
if (!reader.IsDBNull(index))
|
if (!reader.IsDBNull(index))
|
||||||
|
@ -1808,6 +1810,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasEpisodeAttributes)
|
if (hasEpisodeAttributes)
|
||||||
{
|
{
|
||||||
|
@ -1831,6 +1834,8 @@ namespace Emby.Server.Implementations.Data
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasSeriesFields)
|
||||||
|
{
|
||||||
if (hasSeries != null)
|
if (hasSeries != null)
|
||||||
{
|
{
|
||||||
if (!reader.IsDBNull(index))
|
if (!reader.IsDBNull(index))
|
||||||
|
@ -1839,6 +1844,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
if (HasField(query, ItemFields.PresentationUniqueKey))
|
if (HasField(query, ItemFields.PresentationUniqueKey))
|
||||||
{
|
{
|
||||||
|
@ -2461,6 +2467,34 @@ namespace Emby.Server.Implementations.Data
|
||||||
return types.Any(i => query.IncludeItemTypes.Contains(i, StringComparer.OrdinalIgnoreCase));
|
return types.Any(i => query.IncludeItemTypes.Contains(i, StringComparer.OrdinalIgnoreCase));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool HasSeriesFields(InternalItemsQuery query)
|
||||||
|
{
|
||||||
|
var excludeParentTypes = new string[]
|
||||||
|
{
|
||||||
|
"PhotoAlbum"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query.IncludeItemTypes.Length == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var types = new string[]
|
||||||
|
{
|
||||||
|
"Book",
|
||||||
|
"AudioBook",
|
||||||
|
"Episode",
|
||||||
|
"Season"
|
||||||
|
};
|
||||||
|
|
||||||
|
return types.Any(i => query.IncludeItemTypes.Contains(i, StringComparer.OrdinalIgnoreCase));
|
||||||
|
}
|
||||||
|
|
||||||
private string[] GetFinalColumnsToSelect(InternalItemsQuery query, string[] startColumns)
|
private string[] GetFinalColumnsToSelect(InternalItemsQuery query, string[] startColumns)
|
||||||
{
|
{
|
||||||
var list = startColumns.ToList();
|
var list = startColumns.ToList();
|
||||||
|
@ -2511,6 +2545,12 @@ namespace Emby.Server.Implementations.Data
|
||||||
list.Remove("Artists");
|
list.Remove("Artists");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!HasSeriesFields(query))
|
||||||
|
{
|
||||||
|
list.Remove("SeriesId");
|
||||||
|
list.Remove("SeriesName");
|
||||||
|
}
|
||||||
|
|
||||||
if (!HasEpisodeAttributes(query))
|
if (!HasEpisodeAttributes(query))
|
||||||
{
|
{
|
||||||
list.Remove("SeasonName");
|
list.Remove("SeasonName");
|
||||||
|
@ -2753,10 +2793,11 @@ namespace Emby.Server.Implementations.Data
|
||||||
var hasStartDate = HasStartDate(query);
|
var hasStartDate = HasStartDate(query);
|
||||||
var hasTrailerTypes = HasTrailerTypes(query);
|
var hasTrailerTypes = HasTrailerTypes(query);
|
||||||
var hasArtistFields = HasArtistFields(query);
|
var hasArtistFields = HasArtistFields(query);
|
||||||
|
var hasSeriesFields = HasSeriesFields(query);
|
||||||
|
|
||||||
foreach (var row in statement.ExecuteQuery())
|
foreach (var row in statement.ExecuteQuery())
|
||||||
{
|
{
|
||||||
var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasStartDate, hasTrailerTypes, hasArtistFields);
|
var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasStartDate, hasTrailerTypes, hasArtistFields, hasSeriesFields);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
list.Add(item);
|
list.Add(item);
|
||||||
|
@ -2961,10 +3002,11 @@ namespace Emby.Server.Implementations.Data
|
||||||
var hasStartDate = HasStartDate(query);
|
var hasStartDate = HasStartDate(query);
|
||||||
var hasTrailerTypes = HasTrailerTypes(query);
|
var hasTrailerTypes = HasTrailerTypes(query);
|
||||||
var hasArtistFields = HasArtistFields(query);
|
var hasArtistFields = HasArtistFields(query);
|
||||||
|
var hasSeriesFields = HasSeriesFields(query);
|
||||||
|
|
||||||
foreach (var row in statement.ExecuteQuery())
|
foreach (var row in statement.ExecuteQuery())
|
||||||
{
|
{
|
||||||
var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasStartDate, hasTrailerTypes, hasArtistFields);
|
var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasStartDate, hasTrailerTypes, hasArtistFields, hasSeriesFields);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
list.Add(item);
|
list.Add(item);
|
||||||
|
@ -5320,10 +5362,11 @@ namespace Emby.Server.Implementations.Data
|
||||||
var hasStartDate = HasStartDate(query);
|
var hasStartDate = HasStartDate(query);
|
||||||
var hasTrailerTypes = HasTrailerTypes(query);
|
var hasTrailerTypes = HasTrailerTypes(query);
|
||||||
var hasArtistFields = HasArtistFields(query);
|
var hasArtistFields = HasArtistFields(query);
|
||||||
|
var hasSeriesFields = HasSeriesFields(query);
|
||||||
|
|
||||||
foreach (var row in statement.ExecuteQuery())
|
foreach (var row in statement.ExecuteQuery())
|
||||||
{
|
{
|
||||||
var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasStartDate, hasTrailerTypes, hasArtistFields);
|
var item = GetItem(row, query, hasProgramAttributes, hasEpisodeAttributes, hasStartDate, hasTrailerTypes, hasArtistFields, hasSeriesFields);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
var countStartColumn = columns.Count - 1;
|
var countStartColumn = columns.Count - 1;
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.17.10")]
|
[assembly: AssemblyVersion("3.2.17.11")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user