{#if artist && head}
← Catalogue

{head.artist_name}

{head.held} of {plural(head.albums, 'album', 'albums')} held{head.wanted ? ` · ${head.wanted} wanted` : ''}{head.missing ? ` · ${head.missing} with files missing` : ''}{head.downloading ? ` · ${head.downloading} downloading` : ''}

{#if head.artist_id} Open in the library {/if}
{/if} {#if !artist && !wants.isPending && (items.length > 0 || q)}
{/if} {#if wants.isPending}

Reading the wanted list…

{:else if wants.isError && !wants.isFetchNextPageError}

Couldn't load {artist ? "this artist's albums" : 'the wanted list'}.

{:else if items.length === 0 && q}

Nothing on this list has an artist or album named like '{q}'.

{:else if items.length === 0}

{#if artist}None of this artist's albums are in the catalogue. {:else if list === 'upgrade'}No album is wanted for a better copy. {:else}Nothing is wanted.{/if}

{#if list === 'upgrade'} An album you have below the quality set under Acquisition, or with a video rip among its tracks, lands here. {:else} A request you approve, a new release from a followed artist, or an album whose files went missing lands here. {/if}

{:else}
{#each sections as a, i (a.key + ':' + i)}
{#if !artist}

{#if a.mbid} {a.name} {:else} {a.name} {/if} {plural(a.wants.length, 'album', 'albums')}

{/if}
{/each}
wants.fetchNextPage()} /> {/if}