diff --git a/AGENTS.md b/AGENTS.md index 8df1764..10f5084 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -67,9 +67,13 @@ update it only when dependencies change. (`music_dht::podcast`, `furumi_library::podcasts`) and must not be re-derived here. Public podcast cards are published only through `podcasts::publication` (`PodcastDht::sync_shares` over the merged - registers): never publish a podcast directly, never log feed URLs or ids - of podcasts that are not shared. Queue items are identified by `state::track_key` / - `TrackItem::key`, never by numeric id (every episode has the same sentinel + registers): never publish a podcast directly, never log feed URLs or ids of + podcasts that are not shared, never put progress, history, counters or + device names into a card. Public cards found by search are publisher claims: + subscribe and preview only through `podcasts::discovery`, which uses the + card's origin URL (`PodcastSearchHit::feed_url`), never a claimed URL, and + never stores card metadata. Queue items are identified by `state::track_key` + / `TrackItem::key`, never by numeric id (every episode has the same sentinel id); music-only code must skip `TrackItem::is_podcast()` items. - `src/devices.rs` owns trusted-device replication, membership, and playback coordination. Its wire types are the shared `music_dht::device_sync` diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index a58e6eb..c2b83a5 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -419,6 +419,21 @@ The TUI owns what the contract leaves to clients: (`podcast-share-confirmations.json`, mode 0600) and bound to the exact URLs. Without a readable podcast store this device revokes all its own cards. Logs carry counts only. +- **Finding and subscribing.** `Federation::search` runs + `PodcastDht::search` next to the music DHT search and takes the podcast + entries of `merge_search_results` (exact titles first) as + `podcasts::discovery::PodcastHit`s; the music sections keep their own + aggregation and ranking, so music results are unchanged. Off the UI + thread each hit's origin URL is resolved with + `PodcastStore::resolve_podcast_id`, and the "subscribed" mark compares + that id and the card's id with the subscribed podcasts, so a feed alias + counts. A card is a publisher's claim: only `PodcastSearchHit::feed_url` + (the origin URL the id is hashed from) is ever fetched, both for the + episode preview (`discovery::preview`, nothing stored) and for + «Подписаться» (`discovery::subscribe_from_hit` → `refresh::subscribe_url`), + which refuses a hit whose id does not match its URL and stores only what + the feed says. Claimed moved-feed URLs are displayed, never fetched or + recorded as aliases. The new subscription is private. - **Progress.** `podcasts::progress` runs one writer thread so every progress write of this device is ordered. The app tick follows the position and actual listening time and sends: an explicit start (or @@ -603,7 +618,8 @@ The source tree follows the architectural responsibilities: - `federation/` owns DHT-facing search, peer catalogs, and audio exchange; - `podcasts/` owns feed HTTP (conditional requests, redirects, limits), refresh scheduling policy, the episode stream reader and the progress - writer, and the publication of shared podcasts; the podcast model, + writer, the publication of shared podcasts and subscribing from public + cards; the podcast model, identity, merge rules, SQLite store and discovery overlay come from FRID; - `devices.rs` owns trusted-device replication and playback coordination; - `app/` owns state transitions and runtime orchestration; diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e5772..d0b4379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.0] - unreleased + +### Added + +- Sharing a podcast in the federation (`Shift+F` in the `podcasts` context, + off by default): the synced share decision makes each device publish a + signed public card of the podcast in the FRID discovery overlay + (`podcast_dht`, advertised in the capability manifest); share-off and + unsubscribe revoke it with a tombstone. Feed URLs that look private are + published only after a confirmation on that device. The list and side + panel show whether a podcast is shared and whether this device publishes + it. +- Search (`/`, with the federation running) also finds public podcast cards. + They are listed after the music results under "Podcasts · public cards" with + a `[podcast]` marker, the number of publishing devices, and "✓ subscribed" + when this device is subscribed (also through a feed alias). Local-only + search is unchanged. +- Enter on a podcast hit opens its card: title, author, categories, + description, episode count, newest episode, publishing devices, feed URL + and unverified moved-feed claims. `e` reads the seasons and episodes from + the feed without subscribing. «Подписаться» (Enter) subscribes privately + with the card's origin feed URL, so the podcast id is the card's, and + reads everything from the feed itself; «Уже подписан» opens the podcast + in the Podcasts tab instead. + +### Changed + +- `furumi-tui` 0.5.0. + ## [0.4.0] - unreleased ### Added @@ -45,14 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 is cancelled at the next start or stop; pause pressed while an episode connects is kept; seeks that do not move the audio are not saved. - Podcast key bindings in the `podcasts` context: `o`, `/`, `Shift+R`, - `Ctrl+R`, `Shift+S`, `f`, `m`, `Shift+U`, `b`, `Shift+F`. -- Sharing a podcast in the federation (`Shift+F`, off by default): the - synced share decision makes each device publish a signed public card of - the podcast in the FRID discovery overlay (`podcast_dht`, advertised in - the capability manifest); share-off and unsubscribe revoke it with a - tombstone. Feed URLs that look private are published only after a - confirmation on that device. The list and side panel show whether a - podcast is shared and whether this device publishes it. + `Ctrl+R`, `Shift+S`, `f`, `m`, `Shift+U`, `b`. - An optional top-level `version` in `keymap.toml`; the current format is `version = 2`, and a `podcasts` binding context. diff --git a/Cargo.lock b/Cargo.lock index 096d153..d0f70dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1713,7 +1713,7 @@ dependencies = [ [[package]] name = "furumi_tui" -version = "0.4.0" +version = "0.5.0" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index fddcb74..3804300 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "furumi_tui" -version = "0.4.0" +version = "0.5.0" edition = "2024" rust-version = "1.97" description = "A federated P2P player for personal music libraries" diff --git a/README.md b/README.md index fc0714d..d247c3d 100644 --- a/README.md +++ b/README.md @@ -312,8 +312,33 @@ Sharing a podcast (public discovery): key of its public music library, so a shared podcast can be linked to that library and to the device's network address. - Publishing needs the federation to be running; the side panel shows - "not published" with the reason otherwise. Search and subscribing from a - public card come in a later step of this feature. + "not published" with the reason otherwise. + +Finding public podcasts: + +- The search (`/` outside the Podcasts tab, with the federation + running) also looks for public podcast cards. They are listed after the + music results under "Podcasts · public cards", each marked `[podcast]`, + with the number of devices that publish the card (devices, not + subscribers; anyone can create devices, so it is not a sign of trust) or + "✓ subscribed" when this device already follows the podcast, also when + you subscribed under an older or newer address of the same feed. Your + query words go to the discovery peers, as they do for music search. With + the federation off, search stays local and shows no podcasts. +- Enter opens the card (in Russian): what its publishers claim (title, + author, categories, description, number of episodes and date of the + newest one), the feed URL, and addresses some publishers claim the feed + moved to, shown as unverified and never used. `e` reads the feed itself + and lists its seasons and episodes without subscribing; this is a request + to the podcast's own server, not to the publisher. +- «Подписаться» (Enter) subscribes with the card's feed URL, the address + the podcast's id is derived from, so the podcast is the same one the + publisher shares. Furumi then reads the feed from its own server and + stores only what the feed says; the publisher does not need to stay + online, and nothing from the card is kept. The new subscription is + private like any other: it is not shared until you press `Shift+F`, and + your progress is your own. «Уже подписан» means this device is already + subscribed; Enter then opens the podcast in the Podcasts tab. Podcast data lives in `podcasts.sqlite3` in the platform data directory (the same file the earlier podcast test build used; it is upgraded in place). If