WIP: Analysis: Cannot remove legacy database system without EF Core replacement #70

Closed
Copilot wants to merge 1 commit from copilot/remove-legacy-database-system into main
Copilot commented 2026-01-19 09:59:52 +00:00 (Migrated from github.com)

This issue requests removal of both PodcastDatabaseService (per-feed databases) and CentralDatabaseService (centralized database) as part of Epic #58 "Migrate to Entity Framework Core". However, no EF Core implementation exists in the codebase.

Blocking Issues

No replacement system available:

  • No Entity Framework Core packages in Castr.csproj
  • No DbContext, repository interfaces, or EF Core migrations
  • No AddCastrDatabase() extension method referenced in issue

Active dependencies prevent removal:

CentralDatabaseService used by:

  • All Dashboard Blazor components (Dashboard, Downloads, Episodes, Feeds)
  • Program.cs for feed migration and episode syncing

PodcastDatabaseService used by:

  • PodcastFeedService for RSS feed generation
  • PlaylistWatcherService for YouTube download tracking

Possible Interpretations

  1. Issue is premature - EF Core implementation (Epic #58) must be completed first
  2. Issue description incorrect - Only remove PodcastDatabaseService, retain CentralDatabaseService as the "new" system
  3. Missing context - EF Core work exists in another branch/PR

Recommendation

Clarify intent before proceeding. Removing both services without a replacement will break:

  • RSS feed generation (no episode data)
  • YouTube download tracking (no video ID tracking)
  • Dashboard (no feed/episode/activity data)
  • Feed management UI (no CRUD operations)
Original prompt

This section details on the original issue you should resolve

<issue_title>Remove legacy per-feed database system</issue_title>
<issue_description>## Parent Epic
Part of joezombie/btb_pod#58 - Migrate to Entity Framework Core

Description

Remove the legacy per-feed database system after EF Core migration is complete. This is the final cleanup step.

Files to Delete

Services

  • Services/PodcastDatabaseService.cs - Legacy per-feed database service
  • Services/CentralDatabaseService.cs - Legacy central database service (raw SQL)
  • Services/ICentralDatabaseService.cs - Legacy interface

Configuration (Partial)

Remove from Models/PodcastFeedConfig.cs:

// Remove this property
public string? DatabasePath { get; set; }

Code to Remove from Program.cs

// REMOVE: Per-feed database initialization loop (lines 77-149)
foreach (var (feedName, feedConfig) in config.Value.Feeds)
{
    // ... all database initialization code
    await database.InitializeDatabaseAsync(feedName);
}

// REMOVE: Episode sync from per-feed databases (lines 199-215)
foreach (var feed in feedsToSync)
{
    var perFeedDbPath = Path.Combine(feed.Directory, "podcast.db");
    await centralDatabase.SyncEpisodesFromPerFeedDatabaseAsync(feed.Id, perFeedDbPath);
}

DI Registration Changes

// REMOVE these registrations from Program.cs
builder.Services.AddSingleton<IPodcastDatabaseService, PodcastDatabaseService>();
builder.Services.AddSingleton<ICentralDatabaseService, CentralDatabaseService>();

// KEEP (added in earlier issues)
builder.Services.AddCastrDatabase(builder.Configuration);
builder.Services.AddScoped<IFeedRepository, FeedRepository>();
builder.Services.AddScoped<IEpisodeRepository, EpisodeRepository>();
// ... etc

Configuration Cleanup

appsettings.json

{
  "PodcastFeeds": {
    // REMOVE: "CentralDatabasePath": "/data/castr.db"
    // REMOVE: DatabasePath from feed configs
    "Feeds": {
      "btb": {
        // REMOVE: "DatabasePath": "..."
      }
    }
  },
  // NEW location for database config
  "Database": {
    "Provider": "SQLite",
    "ConnectionString": "Data Source=/data/castr.db"
  }
}

CONFIGURATION.md

  • Remove documentation for per-feed DatabasePath
  • Remove CentralDatabasePath documentation
  • Add new Database section documentation

Migration Safety Checks

Before removing legacy code, ensure:

  1. Data Migration Complete

    • All feeds migrated to new database
    • All episodes present in new database
    • Download history preserved
  2. Feature Parity

    • RSS feeds generate correctly
    • Dashboard shows all data
    • Downloads work correctly
    • Episode redownload works
  3. Backup Recommendation

    • Document backup procedure for legacy databases
    • Provide migration verification script

Tasks

  • Verify all data migrated successfully
  • Delete PodcastDatabaseService.cs
  • Delete CentralDatabaseService.cs
  • Delete ICentralDatabaseService.cs
  • Remove DatabasePath from PodcastFeedConfig
  • Update Program.cs - remove legacy initialization
  • Update DI registrations
  • Update appsettings.json schema
  • Update CONFIGURATION.md
  • Update DASHBOARD.md
  • Update CLAUDE.md
  • Clean up any remaining references

Acceptance Criteria

  • No legacy database code remains
  • Application starts and runs correctly
  • All features work as before
  • Documentation updated
  • No compiler warnings about removed code</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

This issue requests removal of both `PodcastDatabaseService` (per-feed databases) and `CentralDatabaseService` (centralized database) as part of Epic #58 "Migrate to Entity Framework Core". However, no EF Core implementation exists in the codebase. ## Blocking Issues **No replacement system available:** - No Entity Framework Core packages in `Castr.csproj` - No `DbContext`, repository interfaces, or EF Core migrations - No `AddCastrDatabase()` extension method referenced in issue **Active dependencies prevent removal:** `CentralDatabaseService` used by: - All Dashboard Blazor components (Dashboard, Downloads, Episodes, Feeds) - `Program.cs` for feed migration and episode syncing `PodcastDatabaseService` used by: - `PodcastFeedService` for RSS feed generation - `PlaylistWatcherService` for YouTube download tracking ## Possible Interpretations 1. **Issue is premature** - EF Core implementation (Epic #58) must be completed first 2. **Issue description incorrect** - Only remove `PodcastDatabaseService`, retain `CentralDatabaseService` as the "new" system 3. **Missing context** - EF Core work exists in another branch/PR ## Recommendation Clarify intent before proceeding. Removing both services without a replacement will break: - RSS feed generation (no episode data) - YouTube download tracking (no video ID tracking) - Dashboard (no feed/episode/activity data) - Feed management UI (no CRUD operations) <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Remove legacy per-feed database system</issue_title> > <issue_description>## Parent Epic > Part of joezombie/btb_pod#58 - Migrate to Entity Framework Core > > ## Description > Remove the legacy per-feed database system after EF Core migration is complete. This is the final cleanup step. > > ## Files to Delete > > ### Services > - `Services/PodcastDatabaseService.cs` - Legacy per-feed database service > - `Services/CentralDatabaseService.cs` - Legacy central database service (raw SQL) > - `Services/ICentralDatabaseService.cs` - Legacy interface > > ### Configuration (Partial) > Remove from `Models/PodcastFeedConfig.cs`: > ```csharp > // Remove this property > public string? DatabasePath { get; set; } > ``` > > ## Code to Remove from Program.cs > > ```csharp > // REMOVE: Per-feed database initialization loop (lines 77-149) > foreach (var (feedName, feedConfig) in config.Value.Feeds) > { > // ... all database initialization code > await database.InitializeDatabaseAsync(feedName); > } > > // REMOVE: Episode sync from per-feed databases (lines 199-215) > foreach (var feed in feedsToSync) > { > var perFeedDbPath = Path.Combine(feed.Directory, "podcast.db"); > await centralDatabase.SyncEpisodesFromPerFeedDatabaseAsync(feed.Id, perFeedDbPath); > } > ``` > > ## DI Registration Changes > > ```csharp > // REMOVE these registrations from Program.cs > builder.Services.AddSingleton<IPodcastDatabaseService, PodcastDatabaseService>(); > builder.Services.AddSingleton<ICentralDatabaseService, CentralDatabaseService>(); > > // KEEP (added in earlier issues) > builder.Services.AddCastrDatabase(builder.Configuration); > builder.Services.AddScoped<IFeedRepository, FeedRepository>(); > builder.Services.AddScoped<IEpisodeRepository, EpisodeRepository>(); > // ... etc > ``` > > ## Configuration Cleanup > > ### appsettings.json > ```json > { > "PodcastFeeds": { > // REMOVE: "CentralDatabasePath": "/data/castr.db" > // REMOVE: DatabasePath from feed configs > "Feeds": { > "btb": { > // REMOVE: "DatabasePath": "..." > } > } > }, > // NEW location for database config > "Database": { > "Provider": "SQLite", > "ConnectionString": "Data Source=/data/castr.db" > } > } > ``` > > ### CONFIGURATION.md > - Remove documentation for per-feed DatabasePath > - Remove CentralDatabasePath documentation > - Add new Database section documentation > > ## Migration Safety Checks > > Before removing legacy code, ensure: > > 1. **Data Migration Complete** > - All feeds migrated to new database > - All episodes present in new database > - Download history preserved > > 2. **Feature Parity** > - RSS feeds generate correctly > - Dashboard shows all data > - Downloads work correctly > - Episode redownload works > > 3. **Backup Recommendation** > - Document backup procedure for legacy databases > - Provide migration verification script > > ## Tasks > - [ ] Verify all data migrated successfully > - [ ] Delete PodcastDatabaseService.cs > - [ ] Delete CentralDatabaseService.cs > - [ ] Delete ICentralDatabaseService.cs > - [ ] Remove DatabasePath from PodcastFeedConfig > - [ ] Update Program.cs - remove legacy initialization > - [ ] Update DI registrations > - [ ] Update appsettings.json schema > - [ ] Update CONFIGURATION.md > - [ ] Update DASHBOARD.md > - [ ] Update CLAUDE.md > - [ ] Clean up any remaining references > > ## Acceptance Criteria > - [ ] No legacy database code remains > - [ ] Application starts and runs correctly > - [ ] All features work as before > - [ ] Documentation updated > - [ ] No compiler warnings about removed code</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes joezombie/btb_pod#65 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
joezombie (Migrated from github.com) reviewed 2026-01-19 09:59:52 +00:00
joezombie commented 2026-01-26 21:17:53 +00:00 (Migrated from github.com)

Closing as this is an analysis document, not implementable code. The analysis correctly identifies that the legacy database system cannot be removed until EF Core migration (Epic #58) is complete. This dependency is tracked in the epic.

Closing as this is an analysis document, not implementable code. The analysis correctly identifies that the legacy database system cannot be removed until EF Core migration (Epic #58) is complete. This dependency is tracked in the epic.

Pull request closed

Sign in to join this conversation.
No description provided.