Add view artist discography

This commit is contained in:
jeffvli 2023-01-15 16:22:07 -08:00
parent 67523f1e7b
commit 5614ad54f2
7 changed files with 338 additions and 155 deletions

View file

@ -13,7 +13,7 @@ import { Box, Group, Stack } from '@mantine/core';
import { RiArrowDownSLine, RiHeartFill, RiHeartLine, RiMoreFill } from 'react-icons/ri';
import { generatePath, useParams } from 'react-router';
import { useCurrentServer } from '/@/renderer/store';
import { Link } from 'react-router-dom';
import { createSearchParams, Link } from 'react-router-dom';
import styled from 'styled-components';
import { AppRoute } from '/@/renderer/router/routes';
import { useContainerQuery } from '/@/renderer/hooks';
@ -66,6 +66,13 @@ export const AlbumArtistDetailContent = () => {
const detailQuery = useAlbumArtistDetail({ id: albumArtistId });
const artistDiscographyLink = `${generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL_DISCOGRAPHY, {
albumArtistId,
})}?${createSearchParams({
artistId: albumArtistId,
artistName: detailQuery?.data?.name || '',
})}`;
const recentAlbumsQuery = useAlbumList({
jfParams: server?.type === ServerType.JELLYFIN ? { artistIds: albumArtistId } : undefined,
limit: itemsPerPage,
@ -146,9 +153,7 @@ export const AlbumArtistDetailContent = () => {
compact
uppercase
component={Link}
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL_DISCOGRAPHY, {
albumArtistId,
})}
to={artistDiscographyLink}
variant="subtle"
>
View discography
@ -283,9 +288,7 @@ export const AlbumArtistDetailContent = () => {
compact
uppercase
component={Link}
to={generatePath(AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL_DISCOGRAPHY, {
albumArtistId,
})}
to={artistDiscographyLink}
variant="subtle"
>
View discography
@ -302,7 +305,6 @@ export const AlbumArtistDetailContent = () => {
</Group>
</Group>
</Box>
{showGenres && (
<Box component="section">
<Group>