Give Currently Listening its own place, below Popular
It was a section at the bottom of the Popular page, so finding the episode you were halfway through meant opening a list of feeds first. It is a place in the feed list now, between Popular and All Subscriptions, with its own page and count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -855,6 +855,8 @@ const VIEWS={
|
||||
blurb:'Every feed anyone on this server subscribes to, A to Z. The feeds inside an OPML are listed one by one, not the OPML.'},
|
||||
':popular':{title:'Popular',icon:ICON.popular,url:'/api/popular',
|
||||
blurb:'The ten feeds with the most subscribers here. The feeds inside an OPML count one by one, not the OPML.'},
|
||||
':listening':{title:'Currently Listening',icon:ICON.audio,url:'/api/entries?filter=in_progress&limit=50',
|
||||
blurb:'Episodes you started and have not finished, across every feed you subscribe to. Pick one up where you left off.'},
|
||||
':all':{title:'All Subscriptions',icon:ICON.all},
|
||||
};
|
||||
function renderFeeds(){
|
||||
@@ -1745,30 +1747,26 @@ async function renderListed(v){
|
||||
$('#tbRemove').disabled=true;
|
||||
syncTools(null);
|
||||
$('#epSearch').placeholder='Search items…';
|
||||
const listening=v===VIEWS[':popular'], grid=v===VIEWS[':directory'];
|
||||
const listening=v===VIEWS[':listening'], grid=v===VIEWS[':directory'];
|
||||
box.innerHTML=`
|
||||
<div class="fhead slim">
|
||||
<div class="art">${v.icon}</div>
|
||||
<div class="meta"><h2>${v.title}</h2>
|
||||
<div class="sub">${v.blurb} Everyone counts, you included. Private feeds are never listed.</div></div>
|
||||
<div class="sub">${v.blurb}${listening?'':' Everyone counts, you included. Private feeds are never listed.'}</div></div>
|
||||
</div>
|
||||
${grid?'<div class="dirbar" id="dirbar"></div>':''}
|
||||
<div class="${grid?'tiles':'childlist'}" id="popular"><p class="hint">Loading…</p></div>
|
||||
${listening?`<div class="sub" style="margin:18px 0 8px;font-weight:600;color:var(--fg)">Currently Listening</div>
|
||||
<div class="childlist" id="listening"><p class="hint">Loading…</p></div>`:''}`;
|
||||
<div class="${grid?'tiles':'childlist'}" id="${listening?'listening':'popular'}"><p class="hint">Loading…</p></div>`;
|
||||
$('#count').textContent=v.title;
|
||||
const n=await (grid?renderDirectory:listFeeds)(v.url,$('#popular',box));
|
||||
if(VIEWS[S.feed]===v) $('#count').textContent=`${v.title}: ${n} feed${n===1?'':'s'}`;
|
||||
if(listening) renderListening();
|
||||
const n=await (listening?renderListening:grid?renderDirectory:listFeeds)(v.url,$(listening?'#listening':'#popular',box));
|
||||
if(VIEWS[S.feed]===v) $('#count').textContent=`${v.title}: ${plural(n,listening?'episode':'feed')}`;
|
||||
}
|
||||
|
||||
/// Below Popular: episodes you started and have not finished, across every feed you
|
||||
/// Currently Listening: episodes you started and have not finished, across every feed you
|
||||
/// subscribe to. A row resumes the episode in the player bar on click -- a shortcut back to
|
||||
/// where you left off, not another way to browse.
|
||||
async function renderListening(){
|
||||
const box=$('#listening');
|
||||
async function renderListening(url,box){
|
||||
let rows=[];
|
||||
try{ rows=(await api('/api/entries?filter=in_progress&limit=10')).entries||[]; }catch{}
|
||||
try{ rows=(await api(url)).entries||[]; }catch{}
|
||||
box.innerHTML=rows.length?'':'<p class="hint">Nothing in progress. Episodes you start and do not finish show up here.</p>';
|
||||
for(const e of rows){
|
||||
const el=document.createElement('div');
|
||||
@@ -1782,6 +1780,7 @@ async function renderListening(){
|
||||
el.onclick=()=>play(e);
|
||||
box.appendChild(el);
|
||||
}
|
||||
return rows.length;
|
||||
}
|
||||
|
||||
// The toolbar acts on whatever is selected: the feed on the left, the item in the table.
|
||||
|
||||
Reference in New Issue
Block a user