{#snippet addMenu(kind: 'search' | 'download', label: string)}
{#if adding === kind}
{#each choices[kind] as choice (choice.protocol)} {/each}
{:else} {/if}
{/snippet}
{#if loadError}

Couldn't load indexers and download clients.

{:else if services === null}

Loading indexers and download clients…

{:else}

{#if !canFetch} No download client is switched on, so nothing can be downloaded. {:else if !canSearch} No indexer is switched on, so nothing new can be found. {:else} Music can be searched for and downloaded. {/if}

{#each indexers as service (service.code)} {:else}

No indexer yet. Prowlarr is the usual choice.

{/each} {#if searchingExchanges.length > 0}

Also searched: {searchingExchanges.map((s) => s.label).join(', ')}, under download clients.

{/if} {@render addMenu('search', 'Add indexer')}
{#each clients as service (service.code)} {:else}

No download client yet.

{/each} {@render addMenu('download', 'Add download client')}
{/if}