Share handed over the raw file address or the item's link: no preview, no time, nothing a person without iPX could do much with. Now, as Overcast does, an episode shares as a short link to its own page, play.ipxreader.app/e/<id>, which anyone can open: the show's art and name, the episode's title, date, length and notes, a player on the publisher's own file starting at ?t= if a time was shared, buttons to subscribe in Apple Podcasts, Overcast, Pocket Casts or Castro, and Open Graph tags for a preview where the link is pasted. ipx-play is a service of its own (crates/play), built like the directory: ipx sends it the episode with its token (POST /v1/shares) and gets the link back. The id comes from the feed's address and the guid, so the same episode is one link whoever shares it. Only episodes of feeds the directory would be sent go there, by the directory's own rule (snapshot_entries), so the two cannot disagree on what is private; ipx-play also refuses an address that looks private. Anything else, and any server without ipx-play set up, shares as before. In the page, Share on an episode opens a menu once the link is back: Share link, Share from 12:34 (the player's clock, or where you left off), Copy link. A menu because the share sheet needs a press of its own, and the request for the link used up the one that opened it. The page runs no script: the start time is the media fragment #t=, and its CSP loads nothing but its stylesheet, the art and the file. Admin, Directory, Sharing episodes sets the address and token. The browser suite starts its own ipx-play; it was not run here (no Caddy on this Mac). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.4 KiB
Bash
Executable File
31 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
# Refuses a commit whose Rust is not as rustfmt writes it, or that clippy warns about. Clippy only
|
|
# checks and never links, so it is light beside a test build (CLAUDE.md, Tests). It checks the
|
|
# crates the commit touches and those built on them, not the workspace: ipx uses ipx-play and
|
|
# ipx-directory, ipx-play uses ipx-directory, and all use ipx-feed. A commit to the page alone runs nothing here.
|
|
staged=$(git diff --cached --name-only --diff-filter=ACMD)
|
|
echo "$staged" | grep -q -e '\.rs$' -e 'Cargo\.toml$' -e '^Cargo\.lock$' || exit 0
|
|
if ! cargo fmt --all --check >/dev/null 2>&1; then
|
|
echo "pre-commit: the Rust is not formatted; run cargo fmt --all" >&2
|
|
exit 1
|
|
fi
|
|
if echo "$staged" | grep -q -e '^Cargo\.toml$' -e '^Cargo\.lock$' -e '^crates/feed/'; then
|
|
pkgs="ipx-feed ipx-directory ipx-play ipx ipx-tui"
|
|
elif echo "$staged" | grep -q '^crates/tui/'; then
|
|
pkgs="ipx-tui"
|
|
elif echo "$staged" | grep -q '^crates/directory/'; then
|
|
pkgs="ipx-directory ipx-play ipx"
|
|
elif echo "$staged" | grep -q '^crates/play/'; then
|
|
pkgs="ipx-play ipx"
|
|
elif echo "$staged" | grep -q '^crates/ipx/'; then
|
|
pkgs="ipx"
|
|
else
|
|
exit 0
|
|
fi
|
|
args=$(for p in $pkgs; do printf ' -p %s' "$p"; done)
|
|
# shellcheck disable=SC2086 # one word a flag
|
|
if ! cargo clippy $args --all-targets -q -- -D warnings; then
|
|
echo "pre-commit: clippy has warnings in $pkgs; fix them, or allow one where it is wrong, with a comment saying why" >&2
|
|
exit 1
|
|
fi
|