feat: add SQLite song database and repository
Store the music library in SQLite through Microsoft.Data.Sqlite. SongRepository creates the database file and the Songs table if they are missing and offers GetAll, GetById, Add, Update and Delete with parameterized queries. The app opens the database on startup at %LOCALAPPDATA%\Radiosender\radiosender.db. Add an xUnit test project that covers CRUD, persistence across instances, SQL characters in values and the duration check. Refs #2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f301829e58
commit
a02081fe66
10 files changed
+315
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,19 @@
|
||||
namespace Radiosender.Models;
|
||||
|
||||
public enum SongSource
|
||||
{
|
||||
Upload,
|
||||
Openverse,
|
||||
}
|
||||
|
||||
public class Song
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Title { get; set; } = "";
|
||||
public string Artist { get; set; } = "";
|
||||
public TimeSpan Duration { get; set; }
|
||||
public string FilePath { get; set; } = "";
|
||||
public SongSource Source { get; set; }
|
||||
public string? License { get; set; }
|
||||
public string? Attribution { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user