A seasoned podcast runs in its own order, and a season downloads whole (#482)

Asked for on the issue: lowest to highest, by season and then episode,
and a way to download every episode of a season.

sort=episode orders by season, episode, then date, with the episodes in
none last either way round; a podcast told in seasons opens in it until a
heading is clicked, and its seasons are offered lowest first.
download-latest takes a season and queues every file of it not on iPX,
first episode first, up to 300; the page asks first, since a season can
be gigabytes. The picked season scrolls into view in the picker, and the
count under the list is the season's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVAJFkEgz9cXG3jG1Zy
This commit is contained in:
2026-11-19 09:21:50 -05:00
parent 4eb6fbb286
commit c441215c62
12 changed files with 168 additions and 44 deletions

View File

@@ -16,9 +16,9 @@ const LISTS_KEPT=40;
const fetching=new Map<string,Promise<ListPage>>();
// A season is of the podcast open (#482): another feed's list, fetched ahead, is of every season.
const seasonFor=(feed: string)=>feed===S.feed?S.season:'';
const listKey=(feed: string, filter=S.filter)=>[feed,filter,S.sort.col,S.sort.dir,S.q,seasonFor(feed)].join('\n');
const listKey=(feed: string, filter=S.filter)=>[feed,filter,sortFor(feed).col,sortFor(feed).dir,S.q,seasonFor(feed)].join('\n');
function listUrl(feed: string, filter=S.filter, offset=0){
const p=new URLSearchParams({offset:String(offset),limit:String(LIMIT),filter,sort:S.sort.col,dir:S.sort.dir});
const p=new URLSearchParams({offset:String(offset),limit:String(LIMIT),filter,sort:sortFor(feed).col,dir:sortFor(feed).dir});
if(S.q) p.set('q',S.q);
if(seasonFor(feed)) p.set('season',seasonFor(feed));
const sg=signalId(feed);
@@ -146,7 +146,7 @@ function renderEntries(){
const f=S.feeds.find(x=>x.id===S.feed), v=VIEWS[S.feed ?? ''], sg=signalOf(S.feed);
// An OPML's own row counts nothing: its shows do.
const kids=f?S.feeds.filter(c=>c.group===f.id):[];
const unread=kids.length?kids.reduce((n,x)=>n+x.unread,0):f?f.unread:sg?sg.unread:S.feeds.reduce((n,x)=>n+(x.unread||0),0);
const unread=kids.length?kids.reduce((n,x)=>n+x.unread,0):f?(seasonUnread(f.id)??f.unread):sg?sg.unread:S.feeds.reduce((n,x)=>n+(x.unread||0),0);
$('#count').textContent=
`${f?(f.title||f.id):sg?sg.name:v?v.title:''}: ${S.total} item${S.total===1?'':'s'}, ${unread} unread`;
const pane=$('#list'), top=pane?pane.scrollTop:0;