Radio starts empty and fills from the Store (Add to Radio, including The Journey FM); iCloud connect falls back to the calendar home beside the principal
build-container / build (push) Successful in 6m9s
build-container / build (push) Successful in 6m9s
- Store > Radio is the station finder with Add to Radio / Added; Radio under Listen lists only what was added - Fix the Radio tab going blank (the router passed its arguments as the Store host) - iCloud: when the account reports no calendar home, try /<id>/calendars/, and say what iCloud answered if that fails Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a31fdcdabd
commit
a804f9a8db
9 files changed
+76
-38
No files matched your search
@@ -87,11 +87,12 @@ async function connect(appleId, password) {
|
||||
const principalHref = hrefOf(tag(a.text, 'current-user-principal') || '');
|
||||
if (!principalHref) throw new Error('iCloud did not return an account (is calendar turned on for this Apple ID?)');
|
||||
const b = await dav('PROPFIND', abs(principalHref, a.url), { ...o, depth: 0, body: PROPFIND_HOME });
|
||||
const homeHref = hrefOf(tag(b.text, 'calendar-home-set') || '');
|
||||
if (!homeHref) throw new Error('Could not find the calendar home for this account');
|
||||
const home = abs(homeHref, b.url);
|
||||
const c = await dav('PROPFIND', home, { ...o, depth: 1, body: PROPFIND_CALS });
|
||||
if (c.status >= 400) throw new Error(`iCloud answered ${c.status} when listing the calendars`);
|
||||
let homeHref = hrefOf(tag(b.text, 'calendar-home-set') || '');
|
||||
const guess = abs(principalHref, a.url).replace(/\/principal\/?$/, '/calendars/');
|
||||
const home0 = homeHref ? abs(homeHref, b.url) : guess.endsWith('/calendars/') ? guess : null; // (some accounts do not report the home at the principal; Apple keeps it beside it, as /<id>/calendars/)
|
||||
if (!home0) throw new Error(`Could not find the calendar home for this account (iCloud answered ${b.status}: ${b.text.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim().slice(0, 160) || 'nothing'})`);
|
||||
const c = await dav('PROPFIND', home0, { ...o, depth: 1, body: PROPFIND_CALS });
|
||||
if (c.status >= 400) throw new Error(homeHref ? `iCloud answered ${c.status} when listing the calendars` : `Could not find the calendar home for this account (the principal gave none, and ${new URL(home0).pathname} answered ${c.status})`);
|
||||
const calendars = parseCollections(c.text, c.url);
|
||||
if (!calendars.found.length) throw new Error(`Signed in, but no calendars were found (iCloud listed ${calendars.seen.length} item${calendars.seen.length === 1 ? '' : 's'}: ${calendars.seen.slice(0, 8).join(', ') || 'none'}). Make sure Calendar is turned on for this Apple ID in iCloud settings.`);
|
||||
save({ user: o.user, pass: o.pass, calendars: calendars.found });
|
||||
|
||||
Reference in new issue
Block a user