Skip to content

Commit 14b3000

Browse files
committed
streams makeover
1 parent b0b5c07 commit 14b3000

12 files changed

Lines changed: 1065 additions & 39 deletions

File tree

.claude/settings.local.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"allow": [
44
"Bash(dotnet build)",
55
"Bash(dotnet run:*)",
6-
"Bash(dotnet build:*)"
6+
"Bash(dotnet build:*)",
7+
"Bash(dotnet ef migrations:*)"
78
],
89
"deny": [],
910
"ask": []
1011
}
11-
}
12+
}

HomeSpeaker.Server2/Data/MusicContext.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public MusicContext(DbContextOptions<MusicContext> options) : base(options)
1414
public DbSet<AnchorDefinitionEntity> AnchorDefinitions { get; set; }
1515
public DbSet<UserAnchorEntity> UserAnchors { get; set; }
1616
public DbSet<DailyAnchorEntity> DailyAnchors { get; set; }
17+
public DbSet<RadioStream> RadioStreams { get; set; }
1718
}
1819

1920
public class Thumbnail
@@ -86,4 +87,16 @@ public class DailyAnchorEntity
8687
public string AnchorName { get; set; } = string.Empty; // Snapshot of name at time of creation
8788
public string AnchorDescription { get; set; } = string.Empty; // Snapshot of description at time of creation
8889
public DateTime CreatedAt { get; set; }
90+
}
91+
92+
public class RadioStream
93+
{
94+
public int Id { get; set; }
95+
public string Name { get; set; } = string.Empty;
96+
public string Url { get; set; } = string.Empty;
97+
public string? FaviconFileName { get; set; }
98+
public int PlayCount { get; set; } = 0;
99+
public int DisplayOrder { get; set; } = 0;
100+
public DateTime CreatedAt { get; set; }
101+
public DateTime? LastPlayedAt { get; set; }
89102
}

HomeSpeaker.Server2/Migrations/20260317002518_AddRadioStreams.Designer.cs

Lines changed: 256 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using System;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace HomeSpeaker.Server2.Migrations
7+
{
8+
/// <inheritdoc />
9+
public partial class AddRadioStreams : Migration
10+
{
11+
/// <inheritdoc />
12+
protected override void Up(MigrationBuilder migrationBuilder)
13+
{
14+
migrationBuilder.CreateTable(
15+
name: "RadioStreams",
16+
columns: table => new
17+
{
18+
Id = table.Column<int>(type: "INTEGER", nullable: false)
19+
.Annotation("Sqlite:Autoincrement", true),
20+
Name = table.Column<string>(type: "TEXT", nullable: false),
21+
Url = table.Column<string>(type: "TEXT", nullable: false),
22+
FaviconFileName = table.Column<string>(type: "TEXT", nullable: true),
23+
PlayCount = table.Column<int>(type: "INTEGER", nullable: false),
24+
DisplayOrder = table.Column<int>(type: "INTEGER", nullable: false),
25+
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
26+
LastPlayedAt = table.Column<DateTime>(type: "TEXT", nullable: true)
27+
},
28+
constraints: table =>
29+
{
30+
table.PrimaryKey("PK_RadioStreams", x => x.Id);
31+
});
32+
33+
// Seed the 22 existing streams
34+
migrationBuilder.InsertData(
35+
table: "RadioStreams",
36+
columns: new[] { "Name", "Url", "FaviconFileName", "PlayCount", "DisplayOrder", "CreatedAt", "LastPlayedAt" },
37+
values: new object[,]
38+
{
39+
{ "Church Music Stream", "https://nmcdn-lds.msvdn.net/icecastRelay/101156/GvaVK70/icecast?rnd=637109878513586401", null, 0, 1, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
40+
{ "Tabernacle Choir Stream", "https://nmcdn-lds.msvdn.net/icecastRelay/101158/3nGepF3/icecast?rnd=637109879815090752", null, 0, 2, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
41+
{ "Canal Espanol", "https://nmcdn-lds.msvdn.net/icecastRelay/101157/V2Pm3WE/icecast?rnd=637109879429639917", null, 0, 3, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
42+
{ "KBAQ", "https://kbaq.streamguys1.com/kbaq_mp3_128", null, 0, 4, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
43+
{ "Your Classical Radio", "https://ycradio.stream.publicradio.org/ycradio.aac", null, 0, 5, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
44+
{ "YourClassical MPR", "https://cms.stream.publicradio.org/cms.aac", null, 0, 6, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
45+
{ "Relax Radio", "https://relax.stream.publicradio.org/relax.aac", null, 0, 7, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
46+
{ "Lullabies", "https://lullabies.stream.publicradio.org/lullabies.aac", null, 0, 8, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
47+
{ "Choral Stream", "https://choral.stream.publicradio.org/choral.aac", null, 0, 9, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
48+
{ "Classical Favorites", "https://favorites.stream.publicradio.org/favorites.aac", null, 0, 10, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
49+
{ "Chamber Music", "https://chambermusic.stream.publicradio.org/chambermusic.aac", null, 0, 11, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
50+
{ "Peaceful Piano", "https://peacefulpiano.stream.publicradio.org/peacefulpiano.aac", null, 0, 12, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
51+
{ "Hygge", "https://hygge.stream.publicradio.org/hygge.aac", null, 0, 13, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
52+
{ "Focus", "https://focus.stream.publicradio.org/focus.aac", null, 0, 14, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
53+
{ "Concert Band", "https://concertband.stream.publicradio.org/concertband.aac", null, 0, 15, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
54+
{ "Classical Kids", "https://classicalkids.stream.publicradio.org/classicalkids.aac", null, 0, 16, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
55+
{ "Holiday Stream", "https://holiday.stream.publicradio.org/holiday_yc.aac", null, 0, 17, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
56+
{ "Classical 89", "https://radio.byub.org/classical89/classical89_aac", null, 0, 18, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
57+
{ "Guitar Stream", "https://guitar.stream.publicradio.org/guitar.aac", null, 0, 19, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
58+
{ "Madrigals", "https://streams.calmradio.com:14228/stream", null, 0, 20, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
59+
{ "Radio Clasique", "https://listen.radioking.com/radio/228241/stream/271810", null, 0, 21, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
60+
{ "Positively Baroque", "https://play.organlive.com:7020/128", null, 0, 22, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null },
61+
{ "Adagio Radio (Madrid)", "https://stream.tunerplay.com/listen/adagioradio/adagioradio.mp3", null, 0, 23, new DateTime(2026, 3, 17, 0, 0, 0, DateTimeKind.Utc), null }
62+
});
63+
}
64+
65+
/// <inheritdoc />
66+
protected override void Down(MigrationBuilder migrationBuilder)
67+
{
68+
migrationBuilder.DropTable(
69+
name: "RadioStreams");
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)