Files
Shadow/Entities/Playlist.cs
sherl eebc5f1d6d fix: remove required from entities' id
also adds "Global" entity for storing global configuration
2025-12-16 04:01:45 +01:00

26 lines
611 B
C#

namespace Shadow.Entities;
public class Playlist
{
public int Id { get; set; }
required public string Name { get; set; }
required public string Uri { get; set; }
required public string Description { get; set; }
required public int CreatorId { get; set; } // UserId?
required public User Creator { get; set; }
public List<PlaylistUser> AuthorizedPlaylistUsers { get; set; } = [];
public bool CanAccess(User u) {
bool isUserPresent = false;
foreach (PlaylistUser pu in AuthorizedPlaylistUsers)
{
if (pu.User == u)
{
isUserPresent = true;
break;
}
}
return isUserPresent;
}
}