Add local source ingest and podcasts
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user