Add local source ingest and podcasts

This commit is contained in:
Krishna Kumar
2026-07-02 01:11:03 -05:00
parent 4d875e12d6
commit f8693f4be0
18 changed files with 1044 additions and 31 deletions

View File

@@ -76,7 +76,14 @@ final class PodcastPlayerViewModel {
private var interruptionObserver: Any?
private var currentPodcastTitle: String = "Marks Podcast"
func start(articleUrl: String, articleTitle: String = "", claude: ClaudeService, parentBookmarkUrl: String? = nil) {
func start(
articleUrl: String,
articleTitle: String = "",
claude: ClaudeService,
parentBookmarkUrl: String? = nil,
sourceText: String? = nil,
sourceKind: String? = nil
) {
// Idempotent don't restart if already generating or playing this article
if currentArticleUrl == articleUrl && (player != nil || pollingTask != nil) { return }
@@ -99,7 +106,12 @@ final class PodcastPlayerViewModel {
pollingTask = Task {
do {
let jobId = try await claude.generatePodcast(url: articleUrl)
let jobId = try await claude.generatePodcast(
url: articleUrl,
title: articleTitle,
sourceText: sourceText,
sourceKind: sourceKind
)
while !Task.isCancelled {
let job = try await claude.podcastStatus(jobId: jobId)
phase = .generating(