Skip to content

fix(radio): fall back when ICY titles are blank - #909

Merged
LargeModGames merged 1 commit into
LargeModGames:mainfrom
WaterWhisperer:fix/radio-empty-stream-title
Oct 21, 2026
Merged

LargeModGames merged 1 commit into
LargeModGames:mainfrom
WaterWhisperer:fix/radio-empty-stream-title

Conversation

@WaterWhisperer

@WaterWhisperer WaterWhisperer commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Treat blank ICY StreamTitle values as missing so Radio uses its existing station fallback.

Fixes #820.

Testing

  • cargo test --no-default-features --features telemetry,tui,internet-radio stream_title
  • cargo test --no-default-features --features telemetry,tui,internet-radio
  • cargo test --no-default-features --features telemetry,tui
  • cargo fmt --all -- --check
  • cargo clippy --no-default-features --features telemetry,tui -- -D warnings

Additional notes


💬 Questions or want to chat with other contributors? Join the spotatui Discord.

Summary by CodeRabbit

  • Bug Fixes
    • Blank, whitespace-only, or dash-only radio titles now fall back to station information.
    • Preserves the playbar subtitle and artist metadata in media integrations.
    • Surrounding whitespace is removed from valid radio titles.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: LargeModGames/spotatui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 12d1e4a0-4093-4d7e-a0d7-47d19784d6bb
📥 Commits

Reviewing files that changed from the base of the PR and between 837308b and f285c6c.

📒 Files selected for processing: 2
  • CHANGELOG.md
  • src/infra/radio/stream.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

ICY stream titles are trimmed before storage. Blank and hyphen-only titles become None, allowing existing radio metadata fallback behavior to apply. Unit tests cover the normalization rules, and the changelog records the change.

Changes: Radio title cleanup

Layer / File(s) Summary
Normalize and store ICY titles
src/infra/radio/stream.rs, CHANGELOG.md
The stream callback now cleans titles before storing them. Blank and hyphen-only titles become None, while other titles are trimmed and retained. Unit tests cover these cases. The changelog documents the fallback behavior.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to f285c

No established merge-blocking risk remains in the reviewed change.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses the valid conventional-commit prefix "fix(radio):" and clearly describes the ICY title fallback change. The subject is concise and imperative.
Linked Issues check Passed The change meets #820. clean_stream_title trims valid titles and returns None for missing, empty, whitespace-only, and hyphen-only values. The callback uses this function at the single metadata wr…
Out of Scope Changes check Passed The changes stay within #820. They modify radio stream title normalization, add focused unit tests, and add the related changelog entry. No reader duplication, timeout change, or unrelated implementat…
Full details: Linked Issues check

Explanation

The change meets #820. clean_stream_title trims valid titles and returns None for missing, empty, whitespace-only, and hyphen-only values. The callback uses this function at the single metadata write site and keeps the existing parse-error guard, so parse failures preserve the last valid title. Unit tests cover the required cases and use stream_title in their names. The existing readers receive None and provide the station fallback.

Full details: Out of Scope Changes check

Explanation

The changes stay within #820. They modify radio stream title normalization, add focused unit tests, and add the related changelog entry. No reader duplication, timeout change, or unrelated implementation change is present in the reviewed evidence.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/infra/radio/stream.rs 93.7% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@LargeModGames
LargeModGames merged commit 30d5c5e into LargeModGames:main Oct 21, 2026
32 checks passed
@WaterWhisperer
WaterWhisperer deleted the fix/radio-empty-stream-title branch October 21, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Radio: an empty ICY StreamTitle blanks the playbar subtitle

2 participants