2018-11-02 21:04:49 +00:00
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
|
using Roadie.Library.Data;
|
2018-11-26 03:15:19 +00:00
|
|
|
|
using Roadie.Library.Enums;
|
2018-11-02 21:04:49 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace Roadie.Library.Identity
|
|
|
|
|
{
|
2018-12-02 15:51:54 +00:00
|
|
|
|
/// <summary>
|
2019-07-03 16:21:29 +00:00
|
|
|
|
/// Application User for Identity
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// As this is used by UserManager to get for each request in API *do not* lazy load properties as the object
|
|
|
|
|
/// is too heavy and requires multiple DB hits to poplate - which is data not needed to authenticate a user.
|
|
|
|
|
/// </remarks>
|
2018-12-02 15:51:54 +00:00
|
|
|
|
/// </summary>
|
2018-11-02 21:04:49 +00:00
|
|
|
|
[Table("user")]
|
|
|
|
|
public partial class ApplicationUser : IdentityUser<int>
|
|
|
|
|
{
|
|
|
|
|
[Column("apiToken")]
|
|
|
|
|
[StringLength(100)]
|
|
|
|
|
public string ApiToken { get; set; }
|
|
|
|
|
|
2018-12-02 15:51:54 +00:00
|
|
|
|
public ICollection<UserArtist> ArtistRatings { get; set; }
|
2018-11-02 22:20:36 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("avatar", TypeName = "blob")] public byte[] Avatar { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2018-11-02 22:20:36 +00:00
|
|
|
|
public ICollection<Bookmark> Bookmarks { get; set; }
|
|
|
|
|
|
2018-12-02 15:51:54 +00:00
|
|
|
|
public ICollection<ApplicationUserClaim> Claims { get; set; }
|
2018-11-10 23:26:04 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
public ICollection<Comment> Comments { get; set; }
|
|
|
|
|
[Column("createdDate")] public DateTime? CreatedDate { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("doUseHtmlPlayer")] public bool? DoUseHtmlPlayer { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
|
|
|
|
[Column("email")]
|
|
|
|
|
[Required]
|
|
|
|
|
[StringLength(100)]
|
|
|
|
|
public override string Email { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("ftpDirectory")]
|
|
|
|
|
[StringLength(500)]
|
|
|
|
|
public string FtpDirectory { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("ftpPassword")]
|
|
|
|
|
[StringLength(500)]
|
|
|
|
|
public string FtpPassword { get; set; }
|
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("ftpUrl")] [StringLength(250)] public string FtpUrl { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
|
|
|
|
[Column("ftpUsername")]
|
|
|
|
|
[StringLength(50)]
|
|
|
|
|
public string FtpUsername { get; set; }
|
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("id")] [Key] public override int Id { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("isActive")] public bool? IsActive { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("isLocked")] public bool? IsLocked { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("isPrivate")] public bool? IsPrivate { get; set; }
|
2019-01-27 05:05:43 +00:00
|
|
|
|
|
2019-01-27 23:34:33 +00:00
|
|
|
|
/// <summary>
|
2019-07-03 16:21:29 +00:00
|
|
|
|
/// This is the last time a user access Roadie via an API (ie Subsonic or Plex or Apache)
|
2019-01-27 23:34:33 +00:00
|
|
|
|
/// </summary>
|
2018-11-02 21:04:49 +00:00
|
|
|
|
[Column("lastApiAccess")]
|
|
|
|
|
public DateTime? LastApiAccess { get; set; }
|
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("lastFMSessionKey")]
|
|
|
|
|
[StringLength(50)]
|
|
|
|
|
public string LastFMSessionKey { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("lastLogin")] public DateTime? LastLogin { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("lastUpdated")] public DateTime? LastUpdated { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
|
|
|
|
[Column("password")]
|
|
|
|
|
[Required]
|
|
|
|
|
[StringLength(100)]
|
|
|
|
|
public override string PasswordHash { get; set; }
|
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("playerTrackLimit")] public short? PlayerTrackLimit { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2018-11-02 22:20:36 +00:00
|
|
|
|
public ICollection<Playlist> Playlists { get; set; }
|
|
|
|
|
|
2018-11-02 21:04:49 +00:00
|
|
|
|
[Column("profile", TypeName = "text")]
|
|
|
|
|
[StringLength(65535)]
|
|
|
|
|
public string Profile { get; set; }
|
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("randomReleaseLimit")] public short? RandomReleaseLimit { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("recentlyPlayedLimit")] public short? RecentlyPlayedLimit { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("registeredOn")] public DateTime? RegisteredOn { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2018-11-02 22:20:36 +00:00
|
|
|
|
public ICollection<UserRelease> ReleaseRatings { get; set; }
|
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("removeTrackFromQueAfterPlayed")]
|
|
|
|
|
public bool? RemoveTrackFromQueAfterPlayed { get; set; }
|
|
|
|
|
|
2018-11-02 22:20:36 +00:00
|
|
|
|
public ICollection<Request> Requests { get; set; }
|
|
|
|
|
|
2018-11-03 21:21:36 +00:00
|
|
|
|
[Column("RoadieId")]
|
2018-11-02 21:04:49 +00:00
|
|
|
|
[StringLength(36)]
|
2018-11-07 04:33:22 +00:00
|
|
|
|
public Guid RoadieId { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2019-07-03 16:21:29 +00:00
|
|
|
|
[Column("status")] public Statuses? Status { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
|
2018-11-02 22:20:36 +00:00
|
|
|
|
public ICollection<Submission> Submissions { get; set; }
|
|
|
|
|
|
2018-11-02 21:04:49 +00:00
|
|
|
|
[Column("timeformat")]
|
|
|
|
|
[StringLength(50)]
|
|
|
|
|
public string Timeformat { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("timezone")]
|
|
|
|
|
[StringLength(50)]
|
|
|
|
|
public string Timezone { get; set; }
|
|
|
|
|
|
2018-11-02 22:20:36 +00:00
|
|
|
|
public ICollection<UserTrack> TrackRatings { get; set; }
|
2018-12-02 15:51:54 +00:00
|
|
|
|
public ICollection<UserQue> UserQues { get; set; }
|
2018-11-25 23:34:17 +00:00
|
|
|
|
|
2018-12-02 15:51:54 +00:00
|
|
|
|
public ICollection<ApplicationUserRole> UserRoles { get; set; }
|
2018-12-02 00:11:55 +00:00
|
|
|
|
|
|
|
|
|
//public ICollection<ChatMessage> ChatMessages { get; set; }
|
|
|
|
|
//public ICollection<Collection> Collections { get; set; }
|
|
|
|
|
//public ICollection<Submission> Submission { get; set; }
|
2018-11-02 21:04:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|