{#snippet externalLinks( info: { musicBrainzId?: string; lastFmUrl?: string }, type: "artist" | "recording" | "release", )} {#if info.musicBrainzId || info.lastFmUrl}
{#if info.musicBrainzId} MusicBrainz {/if} {#if info.lastFmUrl} {#if info.musicBrainzId} {" "} {/if} Last.fm {/if}
{/if} {/snippet} {#snippet libraryItem( type: MiniType, item: LibraryItem, fetcher: (() => Promise) | undefined, rowKey: string, depth = 0, artworkUrl?: string, )} {@const track = type === "song" && isSong(item) ? item : undefined} {@const childFactory = type === "artist" ? (child: LibraryItem) => () => infoApi().getAlbum(child.id) : undefined} void toggleMiniNode(rowKey, fetcher)} onAdd={(asNext) => void addToQueue(rowKey, fetcher, item, childFactory, asNext)} onMenu={(nextMenu) => (menu = nextMenu)} onItemChange={(changes) => Object.assign(item, changes)} /> {#if miniNode(rowKey).expanded && miniNode(rowKey).items} {@const childType = type === "artist" ? "album" : "song"} {#each miniNode(rowKey).items ?? [] as child, index (itemKey(rowKey, childType, child.id, index))} {@const childFetcher = childType === "album" ? () => infoApi().getAlbum(child.id) : undefined} {@render libraryItem( childType, child, childFetcher, itemKey(rowKey, childType, child.id, index), depth + 1, )} {/each} {/if} {/snippet} {#snippet infoArtwork( info: AlbumInfo | ArtistInfo, onload: (event: Event) => void, )} {@const image = infoImage(info, infoArtworkSize)} {@const image2x = infoImage(info, infoArtworkSize * 2)} {#if image} {/if} {/snippet} {#snippet itemActions( item: Album | Artist | Song, type: "album" | "artist" | "song", )}
toggleInfoStar(item, type)} /> {" "} setInfoRating(item, value)} />
{/snippet} (ui.infoItem = null)} class="info-modal" style={modalTheme ? `--info-bg: ${modalTheme.bg}; --info-text: ${modalTheme.text}; color-scheme: ${modalTheme.dark ? "dark" : "light"}` : ""} title={`${t("common.info")}: ${ui.infoItem?.label ?? ""}`} >
{#if artistInfo || albumInfo || songItem} {@const backgroundInfo = artistInfo ?? albumInfo} {@const artId = songItem && songArtId(songItem)} {@const backgroundImage = backgroundInfo ? infoImage(backgroundInfo, 512) : artId ? infoApi().getCoverArt(artId, 512) : undefined} {#if backgroundImage} {/if} {/if}
{#if loading}

{t("common.busy")}

{:else if error}

{error}

{:else if !artistItem && !albumItem && !songItem && details !== null}
{JSON.stringify(details, null, 2)}
{:else}
{#if artistItem}
{#if artistInfo} {@const info = artistInfo} {@render infoArtwork( info, (event) => applyModalTheme(event, info), )} {/if}

{artistLabel}

{@render itemActions(artistItem, "artist")}
{#if artistInfo} {@render externalLinks(artistInfo, "artist")} {/if}
{#if artistInfo?.biography}

{artistInfo.biography}

{/if}
{/if} {#if songItem} {@const artId = songArtId(songItem)}
{#if artId} {@const artwork = infoApi().getCoverArt(artId, infoArtworkSize)} {@const artwork2x = infoApi().getCoverArt( artId, infoArtworkSize * 2, )} applyModalTheme(event, songItem)} {@attach retryImageWithoutCors} {@attach fadeImage} > {/if}

{songItem.title}

{#if albumLabel} {#if albumId} {:else} {albumLabel} {/if} {/if} {#if artistLabel} • {#if artistId} {:else} {artistLabel} {/if} {/if} {#if songItem.year !== undefined} • {songItem.year} {/if} • {@render itemActions(songItem, "song")}
{@render externalLinks(songItem, "recording")}
{/if} {#if albumItem}
{#if albumInfo} {@const info = albumInfo} {@render infoArtwork( info, (event) => applyModalTheme(event, info), )} {/if}

{albumLabel}

{#if artistLabel} {#if artistId} {:else} {artistLabel} {/if} {/if} {#if albumItem.year !== undefined} • {albumItem.year} {/if} • {@render itemActions(albumItem, "album")}
{#if albumInfo} {@render externalLinks(albumInfo, "release")} {/if}
{#if albumInfo?.notes}

{albumInfo.notes}

{/if}
{/if}
{#if ui.infoItem?.type === "artist" || albumItem || artistAlbums.length || artistInfo?.similarArtist?.length || (songItem && hasSonicSimilarity)} {/if}
{#if details !== null}
API
{JSON.stringify(
								{ item: details, artistInfo, albumInfo, artistAlbums },
								null,
								2,
							)}
{/if} {/if}
{#if menu} (menu = null)} /> {/if}