fix: remove required from entities' id

also adds "Global" entity for storing global configuration
This commit is contained in:
2025-12-16 04:01:45 +01:00
parent efb8a41065
commit eebc5f1d6d
15 changed files with 1627 additions and 1537 deletions

View File

@@ -1,7 +1,7 @@
namespace Shadow.Entities;
public class Album
{
required public int Id { get; set; }
public int Id { get; set; }
public required string Name { get; set; }
public required string Uri { get; set; }
public int State { get; set; } = 0;

View File

@@ -1,7 +1,7 @@
namespace Shadow.Entities;
public class AlbumInteraction
{
required public int Id { get; set; }
public int Id { get; set; }
required public int AlbumId { get; set; }
required public int UserId { get; set; }
public DateTime? PlayDate { get; set; } = null;

View File

@@ -1,7 +1,7 @@
namespace Shadow.Entities;
public class Artist
{
required public int Id { get; set; }
public int Id { get; set; }
required public string Name { get; set; }
required public string NormalizedName { get; set; }

View File

@@ -1,7 +1,7 @@
namespace Shadow.Entities;
public class Genre
{
required public int Id { get; set; }
public int Id { get; set; }
required public string Name { get; set; }
required public string NormalizedName { get; set; }

View File

@@ -2,7 +2,7 @@ namespace Shadow.Entities;
public class GenreSong
{
// Composite keys
required public int GenreId { get; set; }
public int GenreId { get; set; }
required public int SongId { get; set; }
required public Genre Genre { get; set; }

7
Entities/Global.cs Normal file
View File

@@ -0,0 +1,7 @@
namespace Shadow.Entities;
public class Global
{
public int Id { get; set; }
required public string Key { get; set; }
public string? Value { get; set; } = null;
}

View File

@@ -1,8 +1,9 @@
namespace Shadow.Entities;
public class Image
{
required public int Id { get; set; }
public int Id { get; set; }
required public string Uri { get; set; }
required public string Filetype { get; set; }
public int State { get; set; }
public int? SongId { get; set; } = null;

View File

@@ -1,7 +1,7 @@
namespace Shadow.Entities;
public class Playlist
{
required public int Id { get; set; }
public int Id { get; set; }
required public string Name { get; set; }
required public string Uri { get; set; }
required public string Description { get; set; }

View File

@@ -1,7 +1,7 @@
namespace Shadow.Entities;
public class Radio
{
required public int Id { get; set; }
public int Id { get; set; }
required public string Name { get; set; }
required public string NormalizedName { get; set; }
public string? Homepage { get; set; } = null;