Commit Graph
4 Commits
Author SHA1 Message Date
fraujulianandClaude Fable 5.2 a8ccb9b73d refactor(import): put online sources behind IMusicProvider
A provider only has to search and return MusicTrack items. Downloading and
storing them is shared by all providers in TrackDownloader and
OnlineImportController. OpenverseProvider is the first implementation.
Song.OpenverseId becomes ExternalId and SongSource.Openverse becomes
Online; the database column and the stored values stay the same.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 15:09:35 +01:00
fraujulianandClaude Fable 5.2 65743279b1 refactor(database): access the library through EF Core
SongRepository uses Entity Framework Core instead of hand-written SQL. The
table and column names stay the same, so existing libraries open unchanged.
The duration rule moves into the repository, and a duplicate Openverse id
now surfaces as DbUpdateException. Libraries from before the Openverse
import, which lack the OpenverseId column, are no longer upgraded.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 14:40:12 +01:00
fraujulianandClaude Opus 5.5 0a0d8e1d4c feat: combine upload and Openverse into one import page
Adding music took two navigation items that each did half the job.
The new Import page has both sources as tabs and one shared list of
what was added in this session, with the reason for every failure and
a link to the library.

From computer: drop several MP3 or WAV files or pick them with a
multi-select dialog. Files are imported one by one on a background
thread with a progress bar, and a failing file does not stop the rest.

Openverse: search and download show a progress ring with a status
text. Results that are already in the library or have no duration are
marked in their row and cannot be imported; a double-click imports.

To detect duplicates, songs now store the Openverse result id. The
repository adds the column to existing databases and a unique index
keeps one song per Openverse result.

Refs #13

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:34:35 +01:00
fraujulianandClaude Opus 5.5 a02081fe66 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>
2026-11-23 10:06:14 +01:00