feat: stream live to laut.fm and import from its library
The Settings page gets a laut.fm card: a switch, the live access data from Radioadmin (server, port, mountpoint, user, password) and the station id and Radioadmin token for the library. Password and token are written to settings.json encrypted with DPAPI for the Windows user. While laut.fm is on, the Schedule page shows a Live button next to "Jetzt starten". It logs in at the Icecast server with PUT and sends a copy of the broadcast mix as MP3 at 128 kbit/s, encoded by Windows Media Foundation. ProgramOutput hands that copy out through a live feed. Each item that starts sets the stream title; ad items send START_AD_BREAK at most once every 15 minutes. LautFmProvider searches the station's tracks through the Radioadmin API and the Import page lists it while laut.fm is on, so laut.fm tracks are imported into the same library as local songs. Providers can now hide themselves with IsAvailable. Nothing was tested against a real laut.fm account; the tests use a local fake server and fake HTTP answers. Refs #15 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5d261717fe
commit
a94fb862d2
16 files changed
+999
-16
No files matched your search
@@ -7,8 +7,10 @@ namespace Radiosender.Controllers;
|
||||
/// <summary>Searches the registered music providers and imports their results into the library.</summary>
|
||||
public class OnlineImportController(IEnumerable<IMusicProvider> providers, TrackDownloader downloader, SongRepository songs)
|
||||
{
|
||||
/// <summary>Every provider registered in <c>App</c>, in registration order.</summary>
|
||||
public IReadOnlyList<IMusicProvider> Providers { get; } = providers.ToList();
|
||||
private readonly IReadOnlyList<IMusicProvider> _providers = providers.ToList();
|
||||
|
||||
/// <summary>The providers registered in <c>App</c> that are available now, in registration order.</summary>
|
||||
public IReadOnlyList<IMusicProvider> Providers => _providers.Where(provider => provider.IsAvailable).ToList();
|
||||
|
||||
/// <summary>Ids of the provider results that are already in the library.</summary>
|
||||
public IReadOnlySet<string> ImportedIds() => songs.GetExternalIds();
|
||||
|
||||
Reference in new issue
Block a user