fix: enrich existing files with YouTube metadata on feed creation #72

Merged
joezombie merged 4 commits from fix/enrich-existing-files-metadata into main 2026-02-13 12:32:35 +00:00
joezombie commented 2026-02-13 11:43:14 +00:00 (Migrated from github.com)

Summary

  • Enriches existing MP3 files with YouTube metadata (description, thumbnail, publish date) when a feed with a playlist URL is created or synced
  • Marks matched files as downloaded in the DownloadedVideo table so the playlist watcher skips them on subsequent polls
  • Removes redundant disk-based file existence check from the metadata-fetch loop (now relies solely on database tracking)

Review Fixes Applied

  • Narrowed DbUpdateException catch to rethrow non-race-condition errors
  • Added ILogger to DownloadRepository for upsert fallback visibility
  • Replaced ChangeTracker.Clear() with targeted entity detach to preserve shared DbContext state
  • Added OperationCanceledException filter to match project conventions
  • Activity log on partial sync failure for dashboard visibility (protected against its own DB failure)
  • Documented first-run metadata fetch behavior after deployment
  • Fixed test compilation after constructor change
  • Fixed pre-existing XML doc inaccuracy on SyncDirectoryAsync

Test Plan

  • Build passes (0 warnings, 0 errors)
  • All 157 tests pass
  • 87.58% line coverage, 65.38% branch coverage
  • Verify existing feeds with pre-existing MP3 files get enriched on next poll
  • Verify enriched files are not re-downloaded on subsequent polls
  • Verify a transient DB error on one video doesn't abort sync of remaining videos

🤖 Generated with Claude Code

## Summary - Enriches existing MP3 files with YouTube metadata (description, thumbnail, publish date) when a feed with a playlist URL is created or synced - Marks matched files as downloaded in the `DownloadedVideo` table so the playlist watcher skips them on subsequent polls - Removes redundant disk-based file existence check from the metadata-fetch loop (now relies solely on database tracking) ## Review Fixes Applied - Narrowed `DbUpdateException` catch to rethrow non-race-condition errors - Added `ILogger` to `DownloadRepository` for upsert fallback visibility - Replaced `ChangeTracker.Clear()` with targeted entity detach to preserve shared DbContext state - Added `OperationCanceledException` filter to match project conventions - Activity log on partial sync failure for dashboard visibility (protected against its own DB failure) - Documented first-run metadata fetch behavior after deployment - Fixed test compilation after constructor change - Fixed pre-existing XML doc inaccuracy on `SyncDirectoryAsync` ## Test Plan - [x] Build passes (0 warnings, 0 errors) - [x] All 157 tests pass - [x] 87.58% line coverage, 65.38% branch coverage - [ ] Verify existing feeds with pre-existing MP3 files get enriched on next poll - [ ] Verify enriched files are not re-downloaded on subsequent polls - [ ] Verify a transient DB error on one video doesn't abort sync of remaining videos 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No description provided.