diff --git a/README.md b/README.md index 8b6bc2f..2bf82f0 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Vega is free and open-source. If it's useful to you: | Method | Details | |---|---| | ⚡ Zap (in-app) | Open the **support** view in Vega's sidebar and zap directly | -| ⚡ Lightning | `harpos@getalby.com` | +| ⚡ Lightning | `jure@getalby.com` | | ₿ Bitcoin | `bc1qcgaupf80j28ca537xjlcs9dm9s03khezjs7crp` | | ☕ Ko-fi | [ko-fi.com/jure](https://ko-fi.com/jure) | | ♥ GitHub Sponsors | [github.com/sponsors/hoornet](https://github.com/sponsors/hoornet) | diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 5d9cf32..a235f82 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -15,7 +15,9 @@ { "url": "https://void.cat/**" }, { "url": "https://nostrimg.com/**" }, { "url": "https://relay.vertexlab.io/**" }, - { "url": "https://fountain.fm/**" } + { "url": "https://fountain.fm/**" }, + { "url": "https://api.podcastindex.org/**" }, + { "url": "https://**" } ] }, "dialog:default", diff --git a/src/components/podcast/PodcastPlayerBar.tsx b/src/components/podcast/PodcastPlayerBar.tsx index d7d2b07..8060645 100644 --- a/src/components/podcast/PodcastPlayerBar.tsx +++ b/src/components/podcast/PodcastPlayerBar.tsx @@ -83,13 +83,18 @@ export function PodcastPlayerBar() { setAudioError(null); setPlaybackState("loading"); - // Set source and let it load + // Reset and set source — explicit load() is needed to clear error state + // from a previous failed episode, otherwise WebView won't attempt the new URL audio.src = episode.enclosureUrl; + audio.load(); audio.playbackRate = playbackRate; audio.volume = volume; + let loaded = false; + // Wait for the audio to be ready, then seek + play const onCanPlay = () => { + loaded = true; audio.removeEventListener("canplaythrough", onCanPlay); const savedPosition = usePodcastStore.getState().loadProgress(episode.guid); if (savedPosition > 0) { @@ -99,7 +104,19 @@ export function PodcastPlayerBar() { }; audio.addEventListener("canplaythrough", onCanPlay); - return () => audio.removeEventListener("canplaythrough", onCanPlay); + // Timeout: if audio doesn't load within 15s, show helpful error + const timeout = setTimeout(() => { + if (!loaded) { + audio.removeEventListener("canplaythrough", onCanPlay); + setAudioError("Audio file not available — the podcast host may be down or the episode URL is broken."); + setPlaybackState("paused"); + } + }, 15000); + + return () => { + clearTimeout(timeout); + audio.removeEventListener("canplaythrough", onCanPlay); + }; }, [episode, playCounter]); // Sync playback rate @@ -214,6 +231,7 @@ export function PodcastPlayerBar() { onLoadedMetadata={handleLoadedMetadata} onEnded={handleEnded} onPlay={() => setPlaybackState("playing")} + onPlaying={() => setPlaybackState("playing")} onPause={() => { const s = usePodcastStore.getState().playbackState; // Only mark paused if we were actually playing — ignore pause events from src changes diff --git a/src/components/shared/AboutView.tsx b/src/components/shared/AboutView.tsx index c891d67..ff14b19 100644 --- a/src/components/shared/AboutView.tsx +++ b/src/components/shared/AboutView.tsx @@ -5,7 +5,7 @@ import pkg from "../../../package.json"; const DEV_NPUB = "npub1ezt7xcq87ljj65jkjsuagwll4yp75tacgkuyjdhkw6mza8j3azfq2vrvl6"; const DEV_PUBKEY = "c897e36007f7e52d52569439d43bffa903ea2fb845b84936f676b62e9e51e892"; -const LIGHTNING_ADDRESS = "harpos@getalby.com"; +const LIGHTNING_ADDRESS = "jure@getalby.com"; const BITCOIN_ADDRESS = "bc1qcgaupf80j28ca537xjlcs9dm9s03khezjs7crp"; const KOFI_URL = "https://ko-fi.com/jure"; const GITHUB_URL = "https://github.com/hoornet/vega"; diff --git a/src/lib/podcast/fountainFm.ts b/src/lib/podcast/fountainFm.ts index 8f9d71d..4fa82f6 100644 --- a/src/lib/podcast/fountainFm.ts +++ b/src/lib/podcast/fountainFm.ts @@ -69,7 +69,12 @@ export async function resolveFountainEpisode(url: string): Promise | undefined); if (value.length === 0) return episode; - return { ...episode, value }; + // If Fountain's audio URL is on their broken CDN, use Podcast Index's real enclosure URL + let { enclosureUrl } = episode; + if (match && enclosureUrl.includes("feeds.fountain.fm")) { + const piUrl = match.enclosureUrl as string | undefined; + if (piUrl) enclosureUrl = piUrl; + } + + return { ...episode, value, enclosureUrl }; } catch { return episode; } diff --git a/src/lib/podcast/v4v.ts b/src/lib/podcast/v4v.ts index 34191bb..4c55f8f 100644 --- a/src/lib/podcast/v4v.ts +++ b/src/lib/podcast/v4v.ts @@ -1,3 +1,4 @@ +import { fetch } from "@tauri-apps/plugin-http"; import type { PodcastEpisode, V4VRecipient } from "../../types/podcast"; import { payInvoiceViaNWC } from "../lightning/nwc";