{#await schedulePromise} {:then scheduleResponse} {#if scheduleResponse} {#await scheduleResponse.text()} {:then untypedSchedule} {@const schedule = typeSchedule(parseScheduleHtml(untypedSchedule))} {#if schedule.lives.length === 0} {/if}
{#each schedule.lives .filter((live) => { const time = new Date(live.time); return time.getTime() > Date.now() - 12 * 60 * 60 * 1000 || time.getTime() > Date.now() || live.streaming; }) .sort((a, b) => { if (a.streaming && !b.streaming) { return -1; } else if (!a.streaming && b.streaming) { return 1; } const aTime = new Date(a.time).getTime(); if (aTime < Date.now() && new Date(b.time).getTime() > Date.now()) { return 1; } else if (aTime > Date.now() && new Date(b.time).getTime() < Date.now()) { return -1; } return aTime - new Date(b.time).getTime(); }) as live}

[{#if live.streaming} LIVE{:else if new Date(live.time).getTime() < Date.now()} Ended{:else} Upcoming{/if}] {live.streamer} | {new Date(live.time).toLocaleString()} {#if live.guests.length > 0}
With {live.guests.join(', ').replace(/, ([^,]+)$/, ', & $1')} {/if}

Stream Thumbnail
{/each}
{:catch} Could not parse schedule. location.reload()}>Try again? {/await} {:else} {/if} {:catch} Could not load schedule. Please location.reload()}>try again later. {/await}