One place to get an episode's file where you are (#457)
Getting an episode onto a phone took two buttons in two states: download it to the server, wait, then keep it on the device, beside Save to this computer, Share and Delete, five buttons that did not say where each copy went. Now a file has one button that brings it to where you are. On a phone or in the iOS app it ends on the device; when iPX has not got the file yet, iPX fetches it and the device's copy follows once iPX says it is done (remembered in localStorage, so a page closed meanwhile catches up when a list next shows the file). On a computer it has iPX fetch the file, and with iPX's copy there saves one. A line beside the size says where the file is, and the rarer actions, two of them destructive, are under a menu. isPlayable is false for any file not on iPX, so the phone's button is decided by playsKind, the same test without the path. download_done now marks the file as on iPX in what the page holds, so the open file's box changes at once rather than after the list is fetched again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqkrVA8TdTxe556JB3sR1n
This commit is contained in:
@@ -352,3 +352,19 @@ test('a Patreon feed or file carries your access, a post page does not (#455)',
|
||||
assert.equal(carries('https://www.patreon.com/glasscannon/posts/music-from-room-174604106'), false);
|
||||
assert.equal(carries('https://example.com/ep.mp3'), false);
|
||||
});
|
||||
|
||||
test('a file\'s box says where it is: the publisher, on its way, iPX, this device (#457)', () => {
|
||||
const where = (x: object) => run(`whereText(${JSON.stringify({ id: 7, deadair: 0, path: null, state: 'held', ...x })})`) as string;
|
||||
assert.equal(where({}), 'Publisher only');
|
||||
assert.equal(where({ state: 'pending' }), 'Queued for iPX');
|
||||
assert.equal(where({ state: 'error' }), 'iPX could not download it');
|
||||
run(`want(7, 'Ep')`);
|
||||
assert.equal(where({ state: 'pending' }), 'Downloading to iPX, then this device');
|
||||
run('unwant(7)');
|
||||
assert.equal(where({ path: '/d/ep.mp3', state: 'done' }), 'On iPX');
|
||||
run(`kept.add('/media/7')`);
|
||||
assert.equal(where({ path: '/d/ep.mp3', state: 'done' }), 'On iPX and this device');
|
||||
// iPX let its copy go; the one here stays.
|
||||
assert.equal(where({ state: 'reaped' }), 'On this device');
|
||||
run('kept.clear()');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user