mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-06 18:33:10 +03:00
Add link to all artist's albums from an album
This commit is contained in:
parent
3b6d0b3d15
commit
096ed396c8
@ -3,6 +3,7 @@ import { Card, CardContent, CardMedia, Typography } from '@material-ui/core'
|
|||||||
import { useTranslate } from 'react-admin'
|
import { useTranslate } from 'react-admin'
|
||||||
import subsonic from '../subsonic'
|
import subsonic from '../subsonic'
|
||||||
import { DurationField, formatRange } from '../common'
|
import { DurationField, formatRange } from '../common'
|
||||||
|
import { ArtistLinkField } from './ArtistLinkField'
|
||||||
|
|
||||||
const AlbumDetails = ({ classes, record }) => {
|
const AlbumDetails = ({ classes, record }) => {
|
||||||
const translate = useTranslate()
|
const translate = useTranslate()
|
||||||
@ -29,7 +30,7 @@ const AlbumDetails = ({ classes, record }) => {
|
|||||||
{record.name}
|
{record.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography component="h6">
|
<Typography component="h6">
|
||||||
{record.albumArtist || record.artist}
|
<ArtistLinkField record={record} />
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography component="p">{genreYear(record)}</Typography>
|
<Typography component="p">{genreYear(record)}</Typography>
|
||||||
<Typography component="p">
|
<Typography component="p">
|
||||||
|
19
ui/src/album/ArtistLinkField.js
Normal file
19
ui/src/album/ArtistLinkField.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Link } from 'react-admin'
|
||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
export const ArtistLinkField = (props) => {
|
||||||
|
const filter = { artist_id: props.record.albumArtistId }
|
||||||
|
const url = `/album?filter=${JSON.stringify(
|
||||||
|
filter
|
||||||
|
)}&order=ASC&sort=maxYear&displayedFilters={"compilation":true}`
|
||||||
|
return (
|
||||||
|
<Link to={url} onClick={(e) => e.stopPropagation()}>
|
||||||
|
{props.record.albumArtist}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
ArtistLinkField.defaultProps = {
|
||||||
|
source: 'artistId',
|
||||||
|
addLabel: true
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user