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>
Start played the first item right away, although the plan begins at
the next full hour. The news was at :00 and :30 in the plan but not on
the real clock.
PlaybackEngine now takes a clock and waits before each item until its
planned start. An item that runs late is never cut; the next one then
starts right after it. When the broadcast starts after the plan has
begun, items that should already have started are skipped and playback
joins at the next one.
While the engine waits for the first item, the now-playing card shows
"On air at" with the planned time. Starting a plan that is already
over is refused with a message.
Refs #12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README now explains how to use each page, how the schedule is
built, the MVC layers and main services, and the Openverse license
and attribution handling. A checklist maps every requirement of the
assignment to the code that covers it.
The review found one gap, now listed under known limitations: the
plan starts at the next full hour, but Start plays right away, so the
news only hits the real :00 and :30 when the broadcast starts at a
full hour.
The home page still said that features "will appear here"; it now
points to the pages that exist.
Refs #12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A listener request can now replace any upcoming item in the schedule,
also while the broadcast is running. The user picks a song from the
library, selects a row in the timeline and clicks "Play instead of
selected".
ScheduleGenerator.Replace puts the song at that position and rebuilds
only the rest of its half hour. Filler goes before the songs, so the
last song still ends exactly when the next news starts. Items before
the swap and all later half hours stay as they were. The filler budget
counts the ads and talk already planned earlier in that half hour, and
an ad never follows another ad.
PlaybackEngine.ReplaceUpcoming switches the running engine to the new
plan. It refuses when the item has already started, and the engine
reads each next item under a lock, so a swap cannot hit an item that
is just going on air.
The timeline marks the item on air with a play icon instead of
selecting it, so the selection is free for the swap target. A hint
next to the button says why a row cannot be replaced (news, already
played, no song chosen).
Refs #11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new Schedule page lets the user choose 1 to 24 hours and create a
plan that starts at the next full hour. The timeline lists start time,
type, title and duration. Each type has a labelled chip: news,
ads and moderator segments get their own border color, songs stay
neutral because the accent color can be the same red as the news.
A now-playing card shows the current item with progress, elapsed and
planned time, Start and Stop buttons and a volume slider. The current
row is selected and scrolled into view. Errors from the generator and
skipped items appear in an InfoBar.
ScheduleController creates the plan from the library and drives the
PlaybackEngine. It lives on App for the whole app run, so a broadcast
keeps playing while the user switches pages, and it stops on exit.
Refs #10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>