Transcripts: say why a show's own transcript was not found; read Podgrab fields whatever their capitals
build-container / build (push) Successful in 4m2s
build-container / build (push) Successful in 4m2s
This commit is contained in:
1 parent
ae00f61711
commit
747002924d
5 files changed
+27
-16
No files matched your search
+1
-1
@@ -116,7 +116,7 @@ async function handle(req, res) {
|
||||
/** For transcripts: where an episode came from (its feed, its id in that feed, its file). Anyone may ask about the shows on their own list only. */
|
||||
async function feedInfo(me, itemId) {
|
||||
if (!BASE || !/^[\w-]+$/.test(String(itemId))) return null;
|
||||
const f = (o, k) => o && (o[k] !== undefined ? o[k] : o[k.toLowerCase()]);
|
||||
const f = (o, k) => { if (!o) return undefined; const hit = Object.keys(o).find(x => x.toLowerCase() === k.toLowerCase()); return hit === undefined ? undefined : o[hit]; }; // (Podgrab's field names, whatever their capitals)
|
||||
const it = await (await podgrab('/podcastitems/' + itemId)).json().catch(() => null); if (!it) return null;
|
||||
const pid = f(it, 'PodcastID') || f(it, 'podcastId'); if (!pid || !(await mySubs(me)).includes(pid)) return null;
|
||||
const sh = await (await podgrab('/podcasts/' + pid)).json().catch(() => null);
|
||||
|
||||
Reference in new issue
Block a user