mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-19 13:27:42 +03:00
Hide LastFM icons if config.lastFMEnabled
is false (#1935)
Hide LastFM icons if `config.lastFMEnabled` is false
This commit is contained in:
parent
80ded63d35
commit
b8c171d3d4
@ -4,6 +4,7 @@ import { IconButton, Tooltip, Link } from '@material-ui/core'
|
||||
import { ImLastfm2 } from 'react-icons/im'
|
||||
import MusicBrainz from '../icons/MusicBrainz'
|
||||
import { intersperse } from '../utils'
|
||||
import config from '../config'
|
||||
|
||||
const AlbumExternalLinks = (props) => {
|
||||
const { className } = props
|
||||
@ -26,15 +27,17 @@ const AlbumExternalLinks = (props) => {
|
||||
links.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
||||
}
|
||||
|
||||
addLink(
|
||||
`https://last.fm/music/${
|
||||
encodeURIComponent(record.albumArtist) +
|
||||
'/' +
|
||||
encodeURIComponent(record.name)
|
||||
}`,
|
||||
'message.openIn.lastfm',
|
||||
<ImLastfm2 className="lastfm-icon" />
|
||||
)
|
||||
if (config.lastFMEnabled) {
|
||||
addLink(
|
||||
`https://last.fm/music/${
|
||||
encodeURIComponent(record.albumArtist) +
|
||||
'/' +
|
||||
encodeURIComponent(record.name)
|
||||
}`,
|
||||
'message.openIn.lastfm',
|
||||
<ImLastfm2 className="lastfm-icon" />
|
||||
)
|
||||
}
|
||||
|
||||
record.mbzAlbumId &&
|
||||
addLink(
|
||||
|
@ -5,6 +5,7 @@ import { IconButton, Tooltip, Link } from '@material-ui/core'
|
||||
import { ImLastfm2 } from 'react-icons/im'
|
||||
import MusicBrainz from '../icons/MusicBrainz'
|
||||
import { intersperse } from '../utils'
|
||||
import config from '../config'
|
||||
|
||||
const ArtistExternalLinks = ({ artistInfo, record }) => {
|
||||
const translate = useTranslate()
|
||||
@ -36,11 +37,14 @@ const ArtistExternalLinks = ({ artistInfo, record }) => {
|
||||
linkButtons.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
||||
}
|
||||
|
||||
addLink(
|
||||
links[0],
|
||||
'message.openIn.lastfm',
|
||||
<ImLastfm2 className="lastfm-icon" />
|
||||
)
|
||||
if (config.lastFMEnabled) {
|
||||
addLink(
|
||||
links[0],
|
||||
'message.openIn.lastfm',
|
||||
<ImLastfm2 className="lastfm-icon" />
|
||||
)
|
||||
}
|
||||
|
||||
artistInfo?.musicBrainzId &&
|
||||
addLink(
|
||||
links[1],
|
||||
|
Loading…
x
Reference in New Issue
Block a user