mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-18 12:57:41 +03:00
Fix displaying album year when viewing an artist's albums
This commit is contained in:
parent
3b52df5efd
commit
a3eb14d7f4
@ -9,7 +9,7 @@ import {
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import withWidth from '@material-ui/core/withWidth'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { linkToRecord, Loading } from 'react-admin'
|
||||
import { linkToRecord, Loading, useListContext } from 'react-admin'
|
||||
import { withContentRect } from 'react-measure'
|
||||
import subsonic from '../subsonic'
|
||||
import {
|
||||
@ -147,8 +147,10 @@ const AlbumGridTile = ({ showArtist, record, basePath }) => {
|
||||
)
|
||||
}
|
||||
|
||||
const LoadedAlbumGrid = ({ ids, data, basePath, width, isArtistView }) => {
|
||||
const LoadedAlbumGrid = ({ ids, data, basePath, width }) => {
|
||||
const classes = useStyles()
|
||||
const { filterValues } = useListContext()
|
||||
const isArtistView = !!(filterValues && filterValues.artist_id)
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
|
@ -10,7 +10,6 @@ import {
|
||||
SearchInput,
|
||||
Pagination,
|
||||
useTranslate,
|
||||
useListParams,
|
||||
} from 'react-admin'
|
||||
import StarIcon from '@material-ui/icons/Star'
|
||||
import { withWidth } from '@material-ui/core'
|
||||
@ -59,18 +58,11 @@ const AlbumListTitle = ({ albumListType }) => {
|
||||
}
|
||||
|
||||
const AlbumList = (props) => {
|
||||
const { width, resource } = props
|
||||
const { width } = props
|
||||
const albumView = useSelector((state) => state.albumView)
|
||||
const [perPage, perPageOptions] = useAlbumsPerPage(width)
|
||||
const location = useLocation()
|
||||
|
||||
const [query] = useListParams({
|
||||
resource,
|
||||
location,
|
||||
perPage,
|
||||
})
|
||||
const isArtistView = !!(query.filter && query.filter.artist_id)
|
||||
|
||||
const albumListType = location.pathname
|
||||
.replace(/^\/album/, '')
|
||||
.replace(/^\//, '')
|
||||
@ -99,7 +91,7 @@ const AlbumList = (props) => {
|
||||
title={<AlbumListTitle albumListType={albumListType} />}
|
||||
>
|
||||
{albumView.grid ? (
|
||||
<AlbumGridView isArtistView={isArtistView} {...props} />
|
||||
<AlbumGridView {...props} />
|
||||
) : (
|
||||
<AlbumListView {...props} />
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user