mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-05 21:37:10 -04:00
update intro queries
This commit is contained in:
parent
b253b86338
commit
ba9222898b
@ -3368,9 +3368,9 @@ namespace Emby.Server.Implementations.Data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.SimilarTo != null)
|
if (query.SimilarTo != null && query.MinSimilarityScore > 0)
|
||||||
{
|
{
|
||||||
whereClauses.Add("SimilarityScore > 0");
|
whereClauses.Add("SimilarityScore > " + (query.MinSimilarityScore - 1).ToString(CultureInfo.InvariantCulture));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.IsFolder.HasValue)
|
if (query.IsFolder.HasValue)
|
||||||
|
@ -100,7 +100,12 @@ namespace Emby.Server.Implementations.Intros
|
|||||||
|
|
||||||
if (trailerTypes.Count > 0)
|
if (trailerTypes.Count > 0)
|
||||||
{
|
{
|
||||||
var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery
|
if (trailerTypes.Count >= 5)
|
||||||
|
{
|
||||||
|
trailerTypes.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
var trailerResult = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { typeof(Trailer).Name },
|
IncludeItemTypes = new[] { typeof(Trailer).Name },
|
||||||
TrailerTypes = trailerTypes.ToArray(),
|
TrailerTypes = trailerTypes.ToArray(),
|
||||||
@ -111,7 +116,8 @@ namespace Emby.Server.Implementations.Intros
|
|||||||
|
|
||||||
// Account for duplicates by imdb id, since the database doesn't support this yet
|
// Account for duplicates by imdb id, since the database doesn't support this yet
|
||||||
Limit = config.TrailerLimit * 2,
|
Limit = config.TrailerLimit * 2,
|
||||||
SourceTypes = sourceTypes.ToArray()
|
SourceTypes = sourceTypes.ToArray(),
|
||||||
|
MinSimilarityScore = 0
|
||||||
|
|
||||||
}).Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).Take(config.TrailerLimit);
|
}).Where(i => string.IsNullOrWhiteSpace(i.GetProviderId(MetadataProviders.Imdb)) || !string.Equals(i.GetProviderId(MetadataProviders.Imdb), item.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).Take(config.TrailerLimit);
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
ImageInfos = new List<ItemImageInfo>();
|
ImageInfos = new List<ItemImageInfo>();
|
||||||
InheritedTags = new List<string>();
|
InheritedTags = new List<string>();
|
||||||
ProductionLocations = new List<string>();
|
ProductionLocations = new List<string>();
|
||||||
|
SourceType = SourceType.Library;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly char[] SlugReplaceChars = { '?', '/', '&' };
|
public static readonly char[] SlugReplaceChars = { '?', '/', '&' };
|
||||||
|
@ -160,6 +160,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
public DateTime? MinDateLastSaved { get; set; }
|
public DateTime? MinDateLastSaved { get; set; }
|
||||||
|
|
||||||
public DtoOptions DtoOptions { get; set; }
|
public DtoOptions DtoOptions { get; set; }
|
||||||
|
public int MinSimilarityScore { get; set; }
|
||||||
|
|
||||||
public bool HasField(ItemFields name)
|
public bool HasField(ItemFields name)
|
||||||
{
|
{
|
||||||
@ -197,6 +198,8 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
public InternalItemsQuery()
|
public InternalItemsQuery()
|
||||||
{
|
{
|
||||||
|
MinSimilarityScore = 1;
|
||||||
|
|
||||||
GroupByPresentationUniqueKey = true;
|
GroupByPresentationUniqueKey = true;
|
||||||
EnableTotalRecordCount = true;
|
EnableTotalRecordCount = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user