Generate podcasts in the background without stopping current playback #2

Closed
opened 2026-07-01 16:07:27 +00:00 by admin · 0 comments
Owner

Summary

When a podcast is playing and I open another bookmark and tap the headphone button, it should start generating that podcast in the background while the current episode keeps playing. When generation finishes, the new episode drops into the Unplayed queue instead of hijacking the player.

Motivation

Today, kicking off a new podcast interrupts whatever I'm listening to. I want to browse and queue up several podcasts while continuing to listen.

Current state of the code

  • PodcastPlayerViewModel.start() (Marks/Views/PodcastPlayerView.swift, ~line 62) calls stop() on the previous episode and runs the generate -> poll -> download loop inside the player itself. So generation and playback are welded together — starting a generation necessarily tears down playback.
  • Need to decouple generation from the player: a background generation service/queue that runs claude.generatePodcast -> podcastStatus polling -> downloadPodcastAudio independently of PodcastPlayerViewModel, so the current AVPlayer is untouched.
  • On completion the service calls PodcastIndex.upsert(...) (already the case in the download path) and the new entry appears at the top of the Unplayed queue.

Behavior

  • Tapping the headphone button on a new bookmark while audio is playing -> shows "Generating…" state for that item (mini indicator / badge), does not stop playback.
  • Multiple generations can be queued/in-flight; surface their progress somewhere (e.g. a badge on the Podcasts tab or an inline row).
  • When a generation completes, it becomes an Unplayed episode (ties into the played/unplayed queue feature).

Dependencies

  • Pairs with the played/unplayed queue feature — finished background generations should enqueue as Unplayed. Filed separately but designed to compose.
## Summary When a podcast is playing and I open another bookmark and tap the headphone button, it should **start generating that podcast in the background** while the current episode **keeps playing**. When generation finishes, the new episode drops into the Unplayed queue instead of hijacking the player. ## Motivation Today, kicking off a new podcast interrupts whatever I'm listening to. I want to browse and queue up several podcasts while continuing to listen. ## Current state of the code - `PodcastPlayerViewModel.start()` (`Marks/Views/PodcastPlayerView.swift`, ~line 62) calls `stop()` on the previous episode and runs the **generate -> poll -> download** loop *inside* the player itself. So generation and playback are welded together — starting a generation necessarily tears down playback. - Need to **decouple generation from the player**: a background generation service/queue that runs `claude.generatePodcast` -> `podcastStatus` polling -> `downloadPodcastAudio` independently of `PodcastPlayerViewModel`, so the current `AVPlayer` is untouched. - On completion the service calls `PodcastIndex.upsert(...)` (already the case in the download path) and the new entry appears at the top of the Unplayed queue. ## Behavior - Tapping the headphone button on a new bookmark while audio is playing -> shows "Generating…" state for that item (mini indicator / badge), **does not** stop playback. - Multiple generations can be queued/in-flight; surface their progress somewhere (e.g. a badge on the Podcasts tab or an inline row). - When a generation completes, it becomes an Unplayed episode (ties into the played/unplayed queue feature). ## Dependencies - Pairs with the played/unplayed queue feature — finished background generations should enqueue as Unplayed. Filed separately but designed to compose.
admin closed this issue 2026-07-01 18:18:57 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/linkding-ios#2