mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-05 18:03:10 +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 { ImLastfm2 } from 'react-icons/im'
|
||||||
import MusicBrainz from '../icons/MusicBrainz'
|
import MusicBrainz from '../icons/MusicBrainz'
|
||||||
import { intersperse } from '../utils'
|
import { intersperse } from '../utils'
|
||||||
|
import config from '../config'
|
||||||
|
|
||||||
const AlbumExternalLinks = (props) => {
|
const AlbumExternalLinks = (props) => {
|
||||||
const { className } = props
|
const { className } = props
|
||||||
@ -26,15 +27,17 @@ const AlbumExternalLinks = (props) => {
|
|||||||
links.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
links.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
||||||
}
|
}
|
||||||
|
|
||||||
addLink(
|
if (config.lastFMEnabled) {
|
||||||
`https://last.fm/music/${
|
addLink(
|
||||||
encodeURIComponent(record.albumArtist) +
|
`https://last.fm/music/${
|
||||||
'/' +
|
encodeURIComponent(record.albumArtist) +
|
||||||
encodeURIComponent(record.name)
|
'/' +
|
||||||
}`,
|
encodeURIComponent(record.name)
|
||||||
'message.openIn.lastfm',
|
}`,
|
||||||
<ImLastfm2 className="lastfm-icon" />
|
'message.openIn.lastfm',
|
||||||
)
|
<ImLastfm2 className="lastfm-icon" />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
record.mbzAlbumId &&
|
record.mbzAlbumId &&
|
||||||
addLink(
|
addLink(
|
||||||
|
@ -5,6 +5,7 @@ import { IconButton, Tooltip, Link } from '@material-ui/core'
|
|||||||
import { ImLastfm2 } from 'react-icons/im'
|
import { ImLastfm2 } from 'react-icons/im'
|
||||||
import MusicBrainz from '../icons/MusicBrainz'
|
import MusicBrainz from '../icons/MusicBrainz'
|
||||||
import { intersperse } from '../utils'
|
import { intersperse } from '../utils'
|
||||||
|
import config from '../config'
|
||||||
|
|
||||||
const ArtistExternalLinks = ({ artistInfo, record }) => {
|
const ArtistExternalLinks = ({ artistInfo, record }) => {
|
||||||
const translate = useTranslate()
|
const translate = useTranslate()
|
||||||
@ -36,11 +37,14 @@ const ArtistExternalLinks = ({ artistInfo, record }) => {
|
|||||||
linkButtons.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
linkButtons.push(<span key={`link-${record.id}-${id}`}>{link}</span>)
|
||||||
}
|
}
|
||||||
|
|
||||||
addLink(
|
if (config.lastFMEnabled) {
|
||||||
links[0],
|
addLink(
|
||||||
'message.openIn.lastfm',
|
links[0],
|
||||||
<ImLastfm2 className="lastfm-icon" />
|
'message.openIn.lastfm',
|
||||||
)
|
<ImLastfm2 className="lastfm-icon" />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
artistInfo?.musicBrainzId &&
|
artistInfo?.musicBrainzId &&
|
||||||
addLink(
|
addLink(
|
||||||
links[1],
|
links[1],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user