mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-09 20:02:11 +01:00
update query fields
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Linq;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Dto;
|
||||
|
||||
@@ -42,20 +43,22 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
[IgnoreDataMember]
|
||||
public MusicArtist MusicArtist
|
||||
{
|
||||
get
|
||||
{
|
||||
var artist = GetParents().OfType<MusicArtist>().FirstOrDefault();
|
||||
get { return GetMusicArtist(new DtoOptions(true)); }
|
||||
}
|
||||
|
||||
if (artist == null)
|
||||
public MusicArtist GetMusicArtist(DtoOptions options)
|
||||
{
|
||||
var artist = GetParents().OfType<MusicArtist>().FirstOrDefault();
|
||||
|
||||
if (artist == null)
|
||||
{
|
||||
var name = AlbumArtist;
|
||||
if (!string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
var name = AlbumArtist;
|
||||
if (!string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
artist = LibraryManager.GetArtist(name);
|
||||
}
|
||||
artist = LibraryManager.GetArtist(name, options);
|
||||
}
|
||||
return artist;
|
||||
}
|
||||
return artist;
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
@@ -171,7 +174,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
id.AlbumArtists = AlbumArtists;
|
||||
|
||||
var artist = MusicArtist;
|
||||
var artist = GetMusicArtist(new DtoOptions(false));
|
||||
|
||||
if (artist != null)
|
||||
{
|
||||
|
||||
@@ -160,42 +160,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
public DtoOptions DtoOptions { get; set; }
|
||||
public int MinSimilarityScore { get; set; }
|
||||
|
||||
public bool HasField(ItemFields name)
|
||||
{
|
||||
var fields = DtoOptions.Fields;
|
||||
|
||||
switch (name)
|
||||
{
|
||||
case ItemFields.HomePageUrl:
|
||||
case ItemFields.Keywords:
|
||||
case ItemFields.DisplayMediaType:
|
||||
case ItemFields.VoteCount:
|
||||
case ItemFields.CustomRating:
|
||||
case ItemFields.ProductionLocations:
|
||||
case ItemFields.Settings:
|
||||
case ItemFields.OriginalTitle:
|
||||
case ItemFields.Taglines:
|
||||
case ItemFields.SortName:
|
||||
case ItemFields.Studios:
|
||||
case ItemFields.Tags:
|
||||
case ItemFields.ThemeSongIds:
|
||||
case ItemFields.ThemeVideoIds:
|
||||
case ItemFields.DateCreated:
|
||||
case ItemFields.Overview:
|
||||
case ItemFields.Genres:
|
||||
case ItemFields.DateLastMediaAdded:
|
||||
case ItemFields.ExternalEtag:
|
||||
case ItemFields.PresentationUniqueKey:
|
||||
case ItemFields.InheritedParentalRatingValue:
|
||||
case ItemFields.ExternalSeriesId:
|
||||
return fields.Contains(name);
|
||||
case ItemFields.ServiceName:
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public InternalItemsQuery()
|
||||
{
|
||||
MinSimilarityScore = 20;
|
||||
|
||||
Reference in New Issue
Block a user