roadie/Roadie.Api.Library/Data/Release.cs

128 lines
3.5 KiB
C#
Raw Normal View History

2018-11-02 16:04:49 -05:00
using Roadie.Library.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
[Table("release")]
2018-11-06 15:55:31 -06:00
public partial class Release : EntityBase
2018-11-02 16:04:49 -05:00
{
2018-11-06 15:55:31 -06:00
[Column("alternateNames", TypeName = "text")]
[MaxLength(65535)]
public string AlternateNames { get; set; }
2018-11-02 16:04:49 -05:00
[Column("amgId")]
[MaxLength(50)]
public string AmgId { get; set; }
2018-11-02 16:11:11 -05:00
public Artist Artist { get; set; }
2018-11-02 16:04:49 -05:00
[Column("artistId")]
[Required]
public int ArtistId { get; set; }
2018-11-02 16:11:11 -05:00
public ICollection<CollectionRelease> Collections { get; set; }
2018-11-02 16:04:49 -05:00
[Column("duration")]
public int? Duration { get; set; }
2018-11-02 16:04:49 -05:00
[Column("discogsId")]
[MaxLength(50)]
public string DiscogsId { get; set; }
2018-11-02 16:11:11 -05:00
public ICollection<ReleaseGenre> Genres { get; set; }
2018-11-02 17:20:36 -05:00
public ICollection<Image> Images { get; set; }
2018-11-02 16:04:49 -05:00
[Column("isVirtual")]
public bool? IsVirtual { get; set; }
[Column("itunesId")]
[MaxLength(100)]
public string ITunesId { get; set; }
2018-11-02 16:11:11 -05:00
public ICollection<ReleaseLabel> Labels { get; set; }
2018-11-02 16:04:49 -05:00
[Column("lastFMId")]
[MaxLength(50)]
public string LastFMId { get; set; }
[Column("lastFMSummary", TypeName = "text")]
[MaxLength(65535)]
public string LastFMSummary { get; set; }
2018-11-21 00:34:53 -06:00
[Column("lastPlayed")]
public DateTime? LastPlayed { get; set; }
2018-11-02 16:04:49 -05:00
[Column("libraryStatus")]
public LibraryStatus? LibraryStatus { get; set; }
[Column("mediaCount")]
public short? MediaCount { get; set; }
2018-11-02 16:11:11 -05:00
public ICollection<ReleaseMedia> Medias { get; set; }
2018-11-02 16:04:49 -05:00
[Column("musicBrainzId")]
[MaxLength(100)]
public string MusicBrainzId { get; set; }
2018-11-21 00:34:53 -06:00
[Column("playedCount")]
public int? PlayedCount { get; set; }
2018-11-21 00:34:53 -06:00
2018-11-02 16:04:49 -05:00
[Column("profile", TypeName = "text")]
[MaxLength(65535)]
public string Profile { get; set; }
2018-11-06 15:55:31 -06:00
[Column("rating")]
public short? Rating { get; set; }
2018-11-02 16:04:49 -05:00
[Column("releaseDate")]
2018-11-03 16:21:36 -05:00
public DateTime? ReleaseDate { get; set; }
2018-11-02 16:04:49 -05:00
2018-11-02 16:11:11 -05:00
[Column("releaseType")]
2018-11-02 16:04:49 -05:00
public ReleaseType? ReleaseType { get; set; }
[Column("spotifyId")]
[MaxLength(100)]
public string SpotifyId { get; set; }
[Column("submissionId")]
public int? SubmissionId { get; set; }
2018-11-06 15:55:31 -06:00
[Column("tags", TypeName = "text")]
[MaxLength(65535)]
public string Tags { get; set; }
[Column("thumbnail", TypeName = "blob")]
2019-06-02 22:13:07 -05:00
[MaxLength(65535)]
2018-11-06 15:55:31 -06:00
public byte[] Thumbnail { get; set; }
2018-11-02 16:04:49 -05:00
[MaxLength(250)]
[Column("title")]
[Required]
public string Title { get; set; }
[Column("trackCount")]
public short TrackCount { get; set; }
2018-11-06 15:55:31 -06:00
[Column("urls", TypeName = "text")]
[MaxLength(65535)]
public string URLs { get; set; }
2018-12-14 22:19:52 -06:00
2019-01-21 18:04:58 -06:00
[Column("rank")]
public decimal? Rank { get; set; }
2018-12-14 22:19:52 -06:00
public Release()
{
this.Rating = 0;
2018-12-17 15:26:24 -06:00
this.ReleaseType = Enums.ReleaseType.Release;
this.Images = new HashSet<Image>();
2018-12-14 22:19:52 -06:00
this.Medias = new HashSet<ReleaseMedia>();
2018-12-17 15:26:24 -06:00
this.Labels = new HashSet<ReleaseLabel>();
this.Collections = new HashSet<CollectionRelease>();
this.Genres = new HashSet<ReleaseGenre>();
2018-12-14 22:19:52 -06:00
}
2018-11-02 16:04:49 -05:00
}
}