mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 22:38:30 +01:00
add ArtistItems to api output
This commit is contained in:
@@ -171,16 +171,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified name has artist.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
|
||||
public bool HasArtist(string name)
|
||||
{
|
||||
return AllArtists.Contains(name, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities.Audio
|
||||
{
|
||||
@@ -9,10 +11,20 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
|
||||
public interface IHasArtist
|
||||
{
|
||||
bool HasArtist(string name);
|
||||
|
||||
List<string> AllArtists { get; }
|
||||
|
||||
List<string> Artists { get; }
|
||||
List<string> Artists { get; set; }
|
||||
}
|
||||
|
||||
public static class HasArtistExtensions
|
||||
{
|
||||
public static bool HasArtist(this IHasArtist hasArtist, string artist)
|
||||
{
|
||||
return hasArtist.Artists.Contains(artist, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
public static bool HasAnyArtist(this IHasArtist hasArtist, string artist)
|
||||
{
|
||||
return hasArtist.AllArtists.Contains(artist, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,16 +120,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
get { return Parent as MusicArtist ?? UnknwonArtist; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified artist has artist.
|
||||
/// </summary>
|
||||
/// <param name="artist">The artist.</param>
|
||||
/// <returns><c>true</c> if the specified artist has artist; otherwise, <c>false</c>.</returns>
|
||||
public bool HasArtist(string artist)
|
||||
{
|
||||
return AllArtists.Contains(artist, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public List<string> Artists { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
||||
return i =>
|
||||
{
|
||||
var hasArtist = i as IHasArtist;
|
||||
return hasArtist != null && hasArtist.HasArtist(Name);
|
||||
return hasArtist != null && hasArtist.HasAnyArtist(Name);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,16 +47,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the specified name has artist.
|
||||
/// </summary>
|
||||
/// <param name="name">The name.</param>
|
||||
/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
|
||||
public bool HasArtist(string name)
|
||||
{
|
||||
return AllArtists.Contains(name, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user data key.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user