Share says why an episode gets no play link (#454)

A private feed's episode, or one ipx-play could not make a link for,
was offered its own address with no word of why, so someone expecting
a page anyone can play could not tell it was on purpose. The menu now
says the feed is private to them, or that the link could not be made
just now, beside the warning for an address carrying their access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 17:26:01 +00:00
parent b3636e648f
commit 45ef1e83f2
4 changed files with 26 additions and 2 deletions

View File

@@ -331,3 +331,15 @@ test('a shared link starts where you are, from five seconds in (#447)', () => {
assert.equal(run(`shareAt(${JSON.stringify(url)}, 754.6)`), `${url}?t=754`);
assert.equal(run(`shareAt(${JSON.stringify(url)}, 3)`), url);
});
test('Share says why an episode gets no page anyone can play, and warns of a key in its address (#454)', () => {
const note = (why: string | null, url: string) => run(`noLinkNote(${JSON.stringify(why)}, ${JSON.stringify(url)})`) as string;
const paid = 'https://c10.patreonusercdn.com/ep.mp3?token-hash=abc';
assert.match(note('private', paid), /private to you.*includes your own access/s);
assert.match(note('failed', 'https://example.com/ep.mp3'), /could not be made just now/);
assert.doesNotMatch(note('failed', 'https://example.com/ep.mp3'), /own access/);
// A server with no ipx-play shares as it always has, with no reason to give.
assert.equal(note('not_set_up', 'https://example.com/ep.mp3'), '');
// The request failed outright: no reason known, but the key is still warned of.
assert.match(note(null, paid), /own access/);
});