{selectedBook ? `${selectedBook.title} · ` : currentSeries ? `${currentSeries.title} · ` : ''}Shelf Goblin
{#if view !== 'series'}

{view === 'similar' ? 'Similar series' : view === 'releases' ? 'Audiobook releases' : view === 'library' ? 'My library' : 'Series index'}

{#if view === 'library'}{account.status}
{#if account.user}{/if}
{/if}
{/if} {#if storageWarning}

{storageWarning}

{/if} {#if account.canImport}
You have a library saved in this browser.
{/if} {#if account.user && (account.status.includes('paused') || account.status.includes('Could not') || account.needsLogin)}

{account.status}

{/if} {#if error} {:else if loading}

Loading catalog…

{:else if view === 'series'} {#if currentSeries} {#key currentSeries.id} navigate('index')} onfollow={toggleFollow} onmarkall={markAll} onwork={setWorkRead} onthrough={markThrough} onopenbook={openBook} onlike={findSimilar}/> {/key} {:else}

That series isn’t in the catalog.

{/if} {:else if view === 'similar'}
{similarSeries.length} series · {semanticCount} matched by reading traits{@render layoutControls()}{@render filterButton()}
{@render preferences()} {#if similarSeries.length}
{#each similarSeries as match (match.series.id)}{@render seriesTile(match.series, `${match.method === 'taste' ? 'Shared traits' : 'Shared genres'}: ${match.reasons.join(', ')}`, match.book)}{/each}
{:else}

No matches with these filters.

{/if}
{:else if view === 'releases'}
{#each [{ id: 'upcoming', label: 'Upcoming' }, { id: 'year', label: 'By year' }, { id: 'unknown', label: 'Date unknown' }] as mode (mode.id)}{/each}
{#if releaseMode === 'year'}{/if} {@render filterButton()}
{@render preferences()}
{releaseBooks.length.toLocaleString()} audiobook editions{query ? ` matching “${query}”` : ''}US Audible · {@render freshness()}
{#if releaseBooks.length}{@render listHeading()}
{#each releaseBooks.slice(0, visibleCount) as book (book.id)}{/each}
{#if releaseBooks.length > visibleCount}{/if} {:else}

No releases found. The source snapshot may be out of date.

{/if} {:else} {@const list = view === 'library' ? librarySeries : indexSeries} {#if view === 'library'}
{#each Object.entries(stateLabels) as [key, label] (key)}{/each}
{/if} {#if view === 'library' && libraryState === 'up-next'}
{upNext.length} audiobook{upNext.length === 1 ? '' : 's'} waiting across {followedCount} series
{#if upNext.length}
{#each upNext.slice(0, visibleCount) as item (item.series.id)} setWorkRead(s, w, true)} onopenbook={openBook}/>{/each}
{#if upNext.length > visibleCount}{/if} {:else}

{followedCount ? 'Nothing waiting. You’re current on every series you follow.' : 'Follow a series and the next audiobook to listen to shows up here.'}

{/if} {:else}
{#if view === 'index'}{#if adultOn}{/if}{@render filterButton()}{/if}
{@render preferences()} {#if list.length || !searchFallback.length}
{list.length.toLocaleString()} series{query ? ` matching “${query}”` : ''}
{@render layoutControls()}
{/if} {#if list.length} {#if bookLayout === 'list'}{@render seriesHeading()}{/if}
{#each list.slice(0, visibleCount) as series (series.id)}{@render seriesTile(series)}{/each}
{#if list.length > visibleCount}{/if} {:else if searchFallback.length}
No series match “{query}”, but {searchFallback.length} matching audiobook{searchFallback.length === 1 ? '' : 's'} did.Individual editions, not series starts
{@render listHeading()}
{#each searchFallback as book (book.id)}{/each}
{:else}

{view === 'library' ? (followedCount ? 'No series with this status.' : 'You aren’t following any series yet. Use “Follow” on a series to start.') : query ? `Nothing matches “${query}” with your current filters.` : 'No series match your filters.'}

{/if} {/if} {/if}
{#snippet seriesTile(series: CatalogSeries, reason = '', cover: CatalogBook | undefined = undefined)} {/snippet} {#snippet layoutControls()}
{/snippet} {#snippet filterButton()}{/snippet} {#snippet listHeading()}{/snippet} {#snippet seriesHeading()}{/snippet} {#snippet preferences()} {#if filtersOpen && view !== 'library'}
{#each filterOptions as option (option.key)}{/each}
{@render adultSettings()}
Filters change what you see here. Your library and reading progress stay complete.
{/if} {/snippet} {#snippet adultSettings()}

Adult content

{adultOn ? 'Sexualized and explicit titles can appear. The two filters above are yours to set.' : 'Sexualized covers and marketing, and explicit sexual content, are hidden.'}

{#if !consent.birthDate || editingBirthDate}
{#if consent.birthDate}{/if}

Confirm your date of birth to choose whether 18+ titles are shown. GitHub does not tell us your age, so this is your own word for it. The date is kept only to check you are {ADULT_AGE} or over, and nothing else reads it.

{:else if verifiedAdult}

Off unless you turn it on. Turning it on adds the two sexual-content filters above so you can set them yourself.

{:else}

The date you confirmed is under {ADULT_AGE}, so 18+ titles stay hidden. The option appears on its own once you are old enough.

{/if} {#if consent.birthDate && !editingBirthDate}
{/if} {#if consentError}{/if} {#if account.ready && !account.user}

Saved in this browser only. Sign in with GitHub to keep this across your devices.

{/if}
{/snippet} {#snippet freshness()}{#if catalog?.sourceSnapshotAt}Source snapshot: {displayDate(catalog.sourceSnapshotAt.slice(0, 10))}{/if}{/snippet} {#if selectedBook}{#key selectedBook.id}{/key}{/if}
{toast}