The page tells two feeds' items with one guid apart (#361)

Rows, the selection, the items turned past and the player were matched
by guid alone, so in All Subscriptions two feeds giving a post the same
guid (a blog's RSS and Atom) were one item to the page: clicking the
second selected and marked the first, and the second never read. They
are matched by feed and guid now (entryKey, the key readWrites already
used); data-guid stays on the row for the tests, data-key is matched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 02:00:14 +00:00
parent 2c7e23c346
commit eae0ef5061
5 changed files with 39 additions and 32 deletions

View File

@@ -362,7 +362,7 @@ function drawListening(box: HTMLElement,rows: Entry[]){
/// One row's time left, progress and play button, taken from the player when it is the one in it.
function paintListenRow(el: HTMLElement & {entry?: Entry}){
const e=el.entry!, now=player.guid===e.guid&&player.feed===e.feed_id;
const e=el.entry!, now=inPlayer(e);
// Zero until the player has sought to where you left off; the saved position stands till then.
if(now&&audio.currentTime) e.position=Math.floor(audio.currentTime);
// The player's own length first: a feed's can be minutes out.
@@ -378,14 +378,14 @@ function paintListenRow(el: HTMLElement & {entry?: Entry}){
/// Keeps the list in step with the player. Only a row that is, or was, the one in it changes.
function syncListening(){
for(const el of $$<HTMLElement & {entry?: Entry}>('#listening .childrow'))
if(el.entry&&(el.classList.contains('now')||player.guid===el.entry.guid)) paintListenRow(el);
if(el.entry&&(el.classList.contains('now')||inPlayer(el.entry))) paintListenRow(el);
}
/// Takes an episode off Currently Listening by forgetting where you got to: the list is every
/// episode with a saved position short of the end, so the position is what has to go.
async function forget(e: Entry){
// Closed without saving first, or the player's next save would put it straight back.
if(player.guid===e.guid){ player.guid=null; $<HTMLButtonElement>('#pclose').click(); }
if(inPlayer(e)){ player.guid=null; $<HTMLButtonElement>('#pclose').click(); }
try{
await api(`/api/entries/${encodeURIComponent(e.feed_id)}/${encodeURIComponent(e.guid)}/position`,
{method:'POST',body:JSON.stringify({secs:0})});