Commit a6a6bd6
src/app.rs
@@ -19,11 +19,18 @@ pub struct App {
impl App {
pub fn new() -> Result<Self> {
let config = Config::load()?;
- let feeds: Vec<Feed> = config.feeds
+ let mut feeds: Vec<Feed> = config.feeds
.iter()
.map(|(name, url)| Feed::new(name.clone(), url.clone()))
.collect();
+ // Auto-load episodes on startup
+ for feed in &mut feeds {
+ if let Err(e) = feed.fetch_episodes() {
+ eprintln!("Failed to fetch episodes for {}: {}", feed.name, e);
+ }
+ }
+
Ok(Self {
current_screen: CurrentScreen::FeedList,
feeds,
src/config.rs
@@ -60,12 +60,16 @@ impl Default for Config {
fn default() -> Self {
let mut feeds = HashMap::new();
feeds.insert(
- "Rust Podcast".to_string(),
- "https://feeds.feedburner.com/rustacean-station".to_string(),
+ "Rustacean Station".to_string(),
+ "https://rustacean-station.org/podcast.rss".to_string(),
);
feeds.insert(
- "Tech Talk".to_string(),
- "https://feeds.feedburner.com/thetechguys".to_string(),
+ "Syntax".to_string(),
+ "https://feeds.transistor.fm/syntax".to_string(),
+ );
+ feeds.insert(
+ "The Changelog".to_string(),
+ "https://changelog.com/podcast/feed".to_string(),
);
let mut radio = HashMap::new();
src/main.rs
@@ -108,8 +108,16 @@ fn ui(f: &mut Frame, app: &App) {
// Right panel - Episodes or info
match app.current_screen {
CurrentScreen::FeedList => {
- let info = Paragraph::new("Select a feed with Enter\nj/k to navigate\nq to quit\nr to refresh")
- .block(Block::default().title("Info").borders(Borders::ALL));
+ let info_text = if app.feeds.is_empty() {
+ "No feeds configured!\n\nEdit ~/.config/ghetto-blaster.yml\nto add podcast feeds.\n\nThen press 'r' to refresh."
+ } else if app.feeds.iter().all(|f| f.episodes.is_empty()) {
+ "Loading episodes...\n\nIf this persists:\n• Check your internet connection\n• Verify feed URLs are valid\n• Press 'r' to refresh"
+ } else {
+ "Navigation:\n• j/k or ↑/↓ - navigate\n• Enter - select feed\n• r - refresh feeds\n• q - quit"
+ };
+
+ let info = Paragraph::new(info_text)
+ .block(Block::default().title("Help").borders(Borders::ALL));
f.render_widget(info, chunks[1]);
}
CurrentScreen::EpisodeList => {