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:
@@ -64,7 +64,7 @@ function play(e: Entry,enc=e.enclosures.find(isPlayable)){
|
||||
}
|
||||
// The same file carries on where it was; another of the item's files starts from its top. So
|
||||
// does the other version of the same file, from the place the entry gives in its clock.
|
||||
const resuming = player.guid===e.guid && player.enc===enc.id && player.src===mediaSrc(enc);
|
||||
const resuming = inPlayer(e) && player.enc===enc.id && player.src===mediaSrc(enc);
|
||||
// Every play button is a pause button for what is playing, as the player bar's is.
|
||||
if(resuming && !audio.paused){ audio.pause(); return; }
|
||||
let wait: Promise<void>|null=null;
|
||||
@@ -140,16 +140,16 @@ for(const ev of ['play','pause','ended']) audio.addEventListener(ev,syncPlayButt
|
||||
/// Every play button for what is playing shows pause, like the player bar's: a row's, the files
|
||||
/// pane's, the toolbar's. Only the bar's used to change, so the others said play while it played.
|
||||
function syncPlayButtons(){
|
||||
const on=(guid: string|null,enc?: number)=>!audio.paused&&player.guid===guid&&(enc==null||player.enc===enc);
|
||||
const on=(key: string|null|undefined,enc?: number)=>!audio.paused&&player.feed+'\n'+player.guid===key&&(enc==null||player.enc===enc);
|
||||
const paint=(b: HTMLElement,now: boolean,idle: string)=>{
|
||||
const label=now?'Pause':idle;
|
||||
if(b.title===label) return;
|
||||
b.title=label; b.setAttribute('aria-label',label); b.innerHTML=now?ICON.pause:ICON.play;
|
||||
};
|
||||
for(const b of $$('#eps .ep [data-a=play]')) paint(b,on(b.closest<HTMLElement>('.ep')!.dataset.guid!),'Play');
|
||||
for(const b of $$('#eps .ep [data-a=play]')) paint(b,on(b.closest<HTMLElement>('.ep')!.dataset.key),'Play');
|
||||
for(const b of $$('#files [data-a=play][data-enc], #detail [data-a=play][data-enc]'))
|
||||
paint(b,on(S.sel,Number(b.dataset.enc)),'Play');
|
||||
const e=cur(); paint($<HTMLButtonElement>('#tbPlay'),!!e&&on(e.guid),'Play the selected item');
|
||||
const e=cur(); paint($<HTMLButtonElement>('#tbPlay'),!!e&&on(entryKey(e)),'Play the selected item');
|
||||
}
|
||||
for(const ev of ['play','pause','timeupdate']) audio.addEventListener(ev,syncListening);
|
||||
window.addEventListener('beforeunload',savePos);
|
||||
@@ -244,10 +244,10 @@ const GO: Record<string,string>={a:':all',d:':directory',l:':listening'};
|
||||
let gAt=0;
|
||||
function stepEntry(by: number){
|
||||
if(VIEWS[S.feed ?? '']?.url||!S.entries.length) return;
|
||||
const i=S.entries.findIndex(x=>x.guid===S.sel);
|
||||
const i=S.entries.findIndex(x=>entryKey(x)===S.sel);
|
||||
const e=S.entries[i<0?0:Math.min(S.entries.length-1,Math.max(0,i+by))];
|
||||
selectEntry(e,true);
|
||||
$(`#eps .ep[data-guid="${CSS.escape(e.guid)}"]`)?.scrollIntoView({block:'nearest'});
|
||||
$(`#eps .ep[data-key="${CSS.escape(entryKey(e))}"]`)?.scrollIntoView({block:'nearest'});
|
||||
}
|
||||
function stepFeed(by: number){
|
||||
const rows=$$('#feedlist [data-id]'), i=rows.findIndex(r=>r.dataset.id===S.feed), id=rows[i+by]?.dataset.id;
|
||||
|
||||
Reference in New Issue
Block a user