roadie/Roadie.Api.Library/Models/Artist.cs

122 lines
3.7 KiB
C#
Raw Normal View History

2018-11-02 21:04:49 +00:00
using Newtonsoft.Json;
2018-11-07 04:33:22 +00:00
using Roadie.Library.Models.Collections;
using Roadie.Library.Models.Playlists;
2018-11-06 21:55:31 +00:00
using Roadie.Library.Models.Releases;
using Roadie.Library.Models.Statistics;
using Roadie.Library.Models.Users;
2018-11-02 21:04:49 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
2018-11-06 02:41:51 +00:00
namespace Roadie.Library.Models
2018-11-02 21:04:49 +00:00
{
[Serializable]
public class Artist : EntityModelBase
{
2019-07-03 16:21:29 +00:00
public const string DefaultIncludes =
"stats,images,associatedartists,similarartists,comments,collections,playlists,contributions,labels";
2018-11-06 21:55:31 +00:00
public IEnumerable<ReleaseList> ArtistContributionReleases;
public IEnumerable<LabelList> ArtistLabels;
2019-07-03 16:21:29 +00:00
private IEnumerable<string> _isniList;
[MaxLength(100)] public string AmgId { get; set; }
2018-11-02 21:04:49 +00:00
public string ArtistType { get; set; }
2018-12-04 23:26:27 +00:00
public IEnumerable<ArtistList> AssociatedArtists { get; set; }
2018-12-03 04:12:47 +00:00
2018-12-27 17:37:17 +00:00
public IEnumerable<DataToken> AssociatedArtistsTokens { get; set; }
2018-11-02 21:04:49 +00:00
public string BandStatus { get; set; }
2019-07-03 16:21:29 +00:00
[MaxLength(65535)] public string BioContext { get; set; }
2018-11-02 21:04:49 +00:00
public DateTime? BirthDate { get; set; }
2019-07-03 16:21:29 +00:00
public IEnumerable<CollectionList> CollectionsWithArtistReleases { get; set; }
public IEnumerable<Comment> Comments { get; set; }
[MaxLength(50)] public string DiscogsId { get; set; }
2018-11-02 21:04:49 +00:00
2018-11-06 02:41:51 +00:00
public IEnumerable<DataToken> Genres { get; set; }
2018-11-06 21:55:31 +00:00
public IEnumerable<Image> Images { get; set; }
2018-11-02 21:04:49 +00:00
[MaxLength(65535)]
[JsonIgnore]
[IgnoreDataMember]
2018-12-27 21:56:40 +00:00
public string ISNI { get; set; }
2018-11-02 21:04:49 +00:00
[JsonProperty("isniList")]
2018-12-27 21:56:40 +00:00
public IEnumerable<string> ISNIList
2018-11-02 21:04:49 +00:00
{
get
{
2019-07-03 16:21:29 +00:00
if (_isniList == null)
2018-11-02 21:04:49 +00:00
{
2019-07-03 16:21:29 +00:00
if (string.IsNullOrEmpty(ISNI)) return null;
return ISNI.Split('|');
2018-11-02 21:04:49 +00:00
}
2019-07-03 16:21:29 +00:00
return _isniList;
2018-11-02 21:04:49 +00:00
}
2019-07-03 16:21:29 +00:00
set => _isniList = value;
2018-11-02 21:04:49 +00:00
}
2019-07-03 16:21:29 +00:00
[MaxLength(100)] public string ITunesId { get; set; }
2018-11-02 21:04:49 +00:00
2019-07-03 16:21:29 +00:00
public Image MediumThumbnail { get; set; }
2018-11-02 21:04:49 +00:00
2019-07-03 16:21:29 +00:00
[MaxLength(100)] public string MusicBrainzId { get; set; }
[MaxLength(250)] public string Name { get; set; }
2018-11-02 21:04:49 +00:00
2019-05-23 03:10:59 +00:00
/// <summary>
2019-07-03 16:21:29 +00:00
/// When populated a "data:image" base64 byte array of an image to use as secondary Artist images.
2019-05-23 03:10:59 +00:00
/// </summary>
2019-07-03 16:21:29 +00:00
public List<string> NewSecondaryImagesData { get; set; }
2018-12-27 17:37:17 +00:00
2019-05-23 03:10:59 +00:00
/// <summary>
2019-07-03 16:21:29 +00:00
/// When populated a "data:image" base64 byte array of an image to use as new Thumbnail.
2019-05-23 03:10:59 +00:00
/// </summary>
2019-07-03 16:21:29 +00:00
public string NewThumbnailData { get; set; }
2019-05-23 03:10:59 +00:00
2019-07-03 16:21:29 +00:00
public IEnumerable<PlaylistList> PlaylistsWithArtistReleases { get; set; }
2018-11-02 21:04:49 +00:00
2019-07-03 16:21:29 +00:00
[MaxLength(65535)] public string Profile { get; set; }
2018-11-02 21:04:49 +00:00
2019-01-23 16:50:36 +00:00
public decimal? Rank { get; set; }
/// <summary>
2019-07-03 16:21:29 +00:00
/// The Position of this Artist as ranked against other Artists (highest ranking Artist is #1)
/// </summary>
public int? RankPosition { get; set; }
2019-07-03 16:21:29 +00:00
public short? Rating { get; set; }
2018-11-02 21:04:49 +00:00
2019-07-03 16:21:29 +00:00
[MaxLength(500)] public string RealName { get; set; }
2018-11-06 21:55:31 +00:00
2019-07-03 16:21:29 +00:00
public IEnumerable<ReleaseList> Releases { get; set; }
2018-11-02 21:04:49 +00:00
2019-07-03 16:21:29 +00:00
public IEnumerable<ArtistList> SimilarArtists { get; set; }
2018-11-06 02:41:51 +00:00
2019-07-03 16:21:29 +00:00
public IEnumerable<DataToken> SimilarArtistsTokens { get; set; }
2018-12-03 04:12:47 +00:00
2019-07-03 16:21:29 +00:00
[MaxLength(100)] public string SpotifyId { get; set; }
2018-11-02 21:04:49 +00:00
2019-07-03 16:21:29 +00:00
public CollectionStatistics Statistics { get; set; }
2018-11-06 21:55:31 +00:00
2019-07-03 16:21:29 +00:00
public Image Thumbnail { get; set; }
2018-11-07 04:33:22 +00:00
2019-07-03 16:21:29 +00:00
public string Tooltip => Name;
public UserArtist UserRating { get; set; }
2018-11-07 04:33:22 +00:00
2018-11-02 21:04:49 +00:00
public Artist()
{
2019-07-03 16:21:29 +00:00
BandStatus = "1";
2018-11-02 21:04:49 +00:00
}
}
}