Use featured image as player artwork fallback #843#897
Conversation
Falls back to the post's featured image in get_album_art() after cover/series/feed images and before the placeholder. Skips the squareness check since the HTML5 player handles non-square via CSS. Co-Authored-By: Claude via AIContext
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthrough
ChangesAlbum Art Fallback Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.54)PHPStan was skipped because the sandbox runner could not parse its output. Review rate limit: 4/5 reviews remaining, refill in 12 minutes. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/WPUnit/EpisodeRepositoryAlbumArtTest.php`:
- Around line 79-82: The tests currently only assert $result is an array and its
src is not the placeholder; update the assertions in
EpisodeRepositoryAlbumArtTest (both the block around the existing
$this->assertIsArray/$this->assertNotEmpty/$this->assertStringNotContainsString
and the similar block at 117-121) to verify the selected image is the actual
featured image: fetch the expected featured image identifier or URL from the
test fixture (e.g. the post's featured image ID or its URL used to set up the
post), then assert equality between that expected value and $result['src'] (or
$result['attachment_id'] if that key is present) using $this->assertEquals to
ensure the returned src matches the real featured image rather than merely not
being the placeholder.
- Around line 14-18: In setUp() of EpisodeRepositoryAlbumArtTest reset the
global feed-image option so tests won't be affected by external state: call the
WordPress option reset (e.g., update_option('ss_podcasting_data_image', '') or
delete_option('ss_podcasting_data_image')) inside the setUp() method right after
obtaining $this->episode_repository so get_album_art() behavior is
deterministic; reference the setUp() method and the ss_podcasting_data_image
option/get_album_art() check when making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cd71bfc6-85b4-4955-85c8-ec32bc746e21
📒 Files selected for processing (2)
php/classes/repositories/class-episode-repository.phptests/WPUnit/EpisodeRepositoryAlbumArtTest.php
Co-Authored-By: Claude via AIContext
Summary
get_album_art()after cover/series/feed images and before the placeholderTest plan
vendor/bin/codecept run WPUnit EpisodeRepositoryAlbumArtTest— 4 tests passSummary by CodeRabbit
Bug Fixes
Tests