Commit Graph
67 Commits
Author SHA1 Message Date
fraujulian ba97d351b0 Merge remote-tracking branch 'origin/main' into j.lechner/openverse
# Conflicts:
#	src/Radiosender/Views/MainWindow.xaml
2026-11-23 10:42:16 +01:00
Julian Lechner 586274967f Merge branch 'j.lechner/song-upload' into 'main'
feat: add song upload for MP3 and WAV files

Closes #4

See merge request julian/blockwoche3.1-radiosender!5
2026-11-23 09:40:34 +00:00
fraujulian d3f9da32b8 Merge remote-tracking branch 'origin/main' into j.lechner/openverse
# Conflicts:
#	src/Radiosender/Views/MainWindow.xaml
2026-11-23 10:38:16 +01:00
fraujulian 360077ff64 Merge remote-tracking branch 'origin/main' into j.lechner/song-upload
# Conflicts:
#	src/Radiosender/Radiosender.csproj
#	src/Radiosender/Views/MainWindow.xaml
2026-11-23 10:37:26 +01:00
Julian Lechner 4c6a45ebd7 Merge branch 'j.lechner/music-player' into 'main'
feat: add music player singleton on NAudio

Closes #6

See merge request julian/blockwoche3.1-radiosender!6
2026-11-23 09:32:09 +00:00
Julian Lechner 57a987648f Merge branch 'j.lechner/ad-placeholders' into 'main'
feat: add ad and moderator placeholder content

Closes #7

See merge request julian/blockwoche3.1-radiosender!3
2026-11-23 09:31:20 +00:00
Julian Lechner bb1e64d1b4 Merge branch 'j.lechner/music-library-view' into 'main'
feat: add music library page with search, edit and delete

Closes #3

See merge request julian/blockwoche3.1-radiosender!4
2026-11-23 09:31:15 +00:00
fraujulianandClaude Opus 5.5 fc461b74cb feat: add Openverse audio search and import
Add an Openverse page that searches free audio through the anonymous
Openverse API, previews a result by streaming its URL with MediaPlayer
and imports it into the library.

OpenverseClient uses HttpClient with a timeout and a generic User-Agent.
It downloads only the result's https URL, limits files to 50 MB, never
overwrites an existing file and deletes partial files on failure.
Timeouts, HTTP 429 and other errors become readable messages. Imported
songs get Source = Openverse plus license and attribution from the API.
Results without a duration cannot be imported, because songs need one.

Refs #5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:26:11 +01:00
fraujulianandClaude Opus 5.5 7c95aba30a feat: add song upload for MP3 and WAV files
Add an Upload page where the user picks an MP3 or WAV file. The new
SongImportService copies it into %LOCALAPPDATA%\Radiosender\Music under
a unique name, reads the duration with NAudio and title/artist from tags
with TagLibSharp (falling back to the file name), and saves the song
with Source = Upload. Wrong extensions, unreadable files, garbage data
and files without audio are rejected; the copied file is deleted again
so nothing is left behind. The page shows the result in a Snackbar.

The music folder is injected so the service is testable without UI.
Tests cover a generated WAV, duplicate names, wrong extension, garbage
files, empty audio and missing files.

Refs #4

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:24:15 +01:00
fraujulianandClaude Opus 5.5 5ea2740895 feat: add music player singleton on NAudio
Add MusicPlayer, a thread-safe lazy singleton that plays one audio
file at a time through NAudio 3.3.0 (WaveOut and AudioFileReader).
It offers Play, Pause, Resume, Stop, Position, Duration, Volume and
IsPlaying, plus TrackFinished and PositionChanged events. The station
needs one shared playback point that later schedule and UI code can
drive.

TrackFinished fires only when a track ends on its own. Stop and Play
unsubscribe from the old output before releasing it, so they never
raise it. Both events run on a thread-pool thread, so WPF callers
must marshal to the dispatcher. Reader and output are disposed on
stop, on replacement and on process exit. A missing file throws
FileNotFoundException and an unreadable one InvalidDataException;
in both cases the player stays stopped.

Tests cover the singleton, error cases and events. Tests that need an
audio device skip when none is present.

Refs #6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:24:14 +01:00
fraujulianandClaude Opus 5.5 faa1dc19cc feat: add music library page with search, edit and delete
Add a Library page reachable from the navigation. It lists all songs
from the SQLite database, filters them by title or artist, edits title,
artist, license and attribution in a dialog, and deletes a song after a
confirmation prompt. File path, duration and source stay read-only.

LibraryController wraps SongRepository so the view only forwards user
actions. Changes are written to the database immediately, and the list
reloads every time the page is shown.

Refs #3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:24:12 +01:00
fraujulianandClaude Opus 5.5 2241c57203 feat: add ad and moderator placeholder content
Add AdSpot and ModeratorSegment models with Title and Duration and a
read-only in-memory seed list for each in PlaceholderContent. Ads and
moderator talk are placeholders without audio, so no database table is
needed. Lengths vary (ads 30 s to 2 min, moderator 30 s to 3 min) so the
schedule generator can size these segments to end songs exactly before
the news. Tests check the lists are non-empty with titles and positive
durations.

Refs #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:20:59 +01:00
Julian Lechner 89b7959404 Merge branch 'j.lechner/sqlite-database' into 'main'
feat: add SQLite song database and repository

Closes #2

See merge request julian/blockwoche3.1-radiosender!2
2026-11-23 09:08:18 +00: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
Julian Lechner f301829e58 Merge branch 'j.lechner/initialize' into 'main'
feat: initialize WPF project with WPF UI

Closes #1

See merge request julian/blockwoche3.1-radiosender!1
2026-11-23 09:02:38 +00:00
fraujulianandClaude Opus 5.5 910709fe26 feat: initialize WPF project with WPF UI
Add the Radiosender solution on .NET 10 with the WPF-UI 4.3.0 package.
The main window is a FluentWindow with a title bar and a NavigationView
that opens a home page. Models, Controllers and Services folders hold
the MVC structure for the next issues. Replace the GitLab template
README with build instructions.

Refs #1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 09:57:35 +01:00
Julian Lechner 145fc13f31 Initial commit 2026-11-23 08:30:43 +00:00