feat: add database connections, initial migration and early CLI tooling
All checks were successful
Update changelog / changelog (push) Successful in 25s
All checks were successful
Update changelog / changelog (push) Successful in 25s
This commit is contained in:
25
Entities/Playlist.cs
Normal file
25
Entities/Playlist.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace Shadow.Entities;
|
||||
public class Playlist
|
||||
{
|
||||
required 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user