mirror of
https://github.com/jeffvli/feishin.git
synced 2026-12-06 08:42:25 -08:00
fix: radio cover and metadata was incorrect/missing in some cases (#2407)
* fix: discord rpc not following settings in radio * fix: full screen player radio image * fix: discord rpc was not showing radio image * fix: lint error missing imageUrl * chore: revert discord rpc radio image * fix: lint error * refactor: pass radio image instead of querying it inside the imagewithplaceholder * feat: do not hide radio info when player is paused fix: mobile player radio display errors * chore: remove todo
This commit is contained in:
1 parent
98208f3bfc
commit
fbd4c3d317
9 files changed
+182
-128
No files matched your search
@@ -51,7 +51,7 @@ export const useDiscordRpc = () => {
|
||||
const [lastUniqueId, setlastUniqueId] = useState('');
|
||||
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { isPlaying: isRadioPlaying, metadata: radioMetadata, stationName } = useRadioPlayer();
|
||||
const { metadata: radioMetadata, stationName } = useRadioPlayer();
|
||||
|
||||
const currentSong = usePlayerSong();
|
||||
const imageUrl = useItemImageUrl({
|
||||
@@ -94,8 +94,7 @@ export const useDiscordRpc = () => {
|
||||
const song = current[0];
|
||||
const trackChanged = song ? lastUniqueId !== song._uniqueId : false;
|
||||
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
const hasTrackOrRadio = Boolean(current[0]) || isPlayingRadio;
|
||||
const hasTrackOrRadio = Boolean(current[0]) || isRadioActive;
|
||||
|
||||
if (
|
||||
!hasTrackOrRadio || // No track and not playing radio
|
||||
@@ -119,10 +118,16 @@ export const useDiscordRpc = () => {
|
||||
return discordRpc?.clearActivity();
|
||||
}
|
||||
|
||||
if (isPlayingRadio) {
|
||||
if (isRadioActive) {
|
||||
const title = radioMetadata?.title || stationName || 'Radio';
|
||||
const artist = radioMetadata?.artist || stationName || '';
|
||||
|
||||
const statusDisplayMap = {
|
||||
[DiscordDisplayType.ARTIST_NAME]: DiscordStatusDisplayType.STATE,
|
||||
[DiscordDisplayType.FEISHIN]: DiscordStatusDisplayType.NAME,
|
||||
[DiscordDisplayType.SONG_NAME]: DiscordStatusDisplayType.DETAILS,
|
||||
};
|
||||
|
||||
const activity: SetActivity = {
|
||||
details: truncate(title),
|
||||
instance: false,
|
||||
@@ -141,7 +146,7 @@ export const useDiscordRpc = () => {
|
||||
: undefined
|
||||
: sentenceCase(current[2]),
|
||||
state: truncate(artist),
|
||||
statusDisplayType: DiscordStatusDisplayType.STATE,
|
||||
statusDisplayType: statusDisplayMap[discordSettings.displayType],
|
||||
type: discordSettings.showAsListening ? 2 : 0,
|
||||
};
|
||||
|
||||
@@ -352,7 +357,6 @@ export const useDiscordRpc = () => {
|
||||
lastUniqueId,
|
||||
currentSong?._uniqueId,
|
||||
isRadioActive,
|
||||
isRadioPlaying,
|
||||
radioMetadata?.artist,
|
||||
radioMetadata?.title,
|
||||
stationName,
|
||||
|
||||
@@ -100,15 +100,13 @@ export const FullScreenPlayerImage = () => {
|
||||
const [imageContainerWidth, setImageContainerWidth] = useState<null | number>(null);
|
||||
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { isPlaying: isRadioPlaying } = useRadioPlayer();
|
||||
const { currentStationArt: currentRadioStationArt } = useRadioPlayer();
|
||||
|
||||
const currentSong = usePlayerSong();
|
||||
const { nextSong } = usePlayerData();
|
||||
const { blurExplicitImages, playerItems } = useGeneralSettings();
|
||||
const { coverArtSize, titleDisplayType, titleLineCount } = useFullScreenPlayerStore();
|
||||
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
|
||||
const currentImageUrl = useItemImageUrl({
|
||||
id: currentSong?.imageId || undefined,
|
||||
itemType: LibraryItem.SONG,
|
||||
@@ -123,6 +121,13 @@ export const FullScreenPlayerImage = () => {
|
||||
type: 'fullScreenPlayer',
|
||||
});
|
||||
|
||||
const radioImage = useItemImageUrl({
|
||||
id: currentRadioStationArt?.imageId || undefined,
|
||||
itemType: LibraryItem.RADIO_STATION,
|
||||
serverId: currentRadioStationArt?.serverId,
|
||||
type: 'fullScreenPlayer',
|
||||
});
|
||||
|
||||
const [imageState, setImageState] = useSetState({
|
||||
bottomExplicit: nextSong?.explicitStatus === ExplicitStatus.EXPLICIT,
|
||||
bottomImage: nextImageUrl,
|
||||
@@ -215,7 +220,7 @@ export const FullScreenPlayerImage = () => {
|
||||
|
||||
// Update images when song or size changes (skip when playing radio - no album art)
|
||||
useEffect(() => {
|
||||
if (isPlayingRadio) {
|
||||
if (isRadioActive) {
|
||||
return;
|
||||
}
|
||||
if (currentSong?._uniqueId === previousSongRef.current) {
|
||||
@@ -238,7 +243,7 @@ export const FullScreenPlayerImage = () => {
|
||||
|
||||
previousSongRef.current = currentSong?._uniqueId;
|
||||
}, [
|
||||
isPlayingRadio,
|
||||
isRadioActive,
|
||||
currentSong?._uniqueId,
|
||||
currentImageUrl,
|
||||
nextSong?._uniqueId,
|
||||
@@ -267,7 +272,7 @@ export const FullScreenPlayerImage = () => {
|
||||
}}
|
||||
>
|
||||
<AnimatePresence initial={false} mode="sync">
|
||||
{!isPlayingRadio && imageState.current === 0 && (
|
||||
{!isRadioActive && imageState.current === 0 && (
|
||||
<ImageWithPlaceholder
|
||||
animate="open"
|
||||
className="full-screen-player-image"
|
||||
@@ -283,7 +288,7 @@ export const FullScreenPlayerImage = () => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{!isPlayingRadio && imageState.current === 1 && (
|
||||
{!isRadioActive && imageState.current === 1 && (
|
||||
<ImageWithPlaceholder
|
||||
animate="open"
|
||||
className="full-screen-player-image"
|
||||
@@ -299,7 +304,7 @@ export const FullScreenPlayerImage = () => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{isPlayingRadio && (
|
||||
{isRadioActive && (
|
||||
<ImageWithPlaceholder
|
||||
animate="open"
|
||||
className="full-screen-player-image"
|
||||
@@ -310,7 +315,7 @@ export const FullScreenPlayerImage = () => {
|
||||
key="radio"
|
||||
placeholder="var(--theme-colors-foreground-muted)"
|
||||
placeholderIcon="radio"
|
||||
src=""
|
||||
src={radioImage || ''}
|
||||
variants={imageVariants}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -293,9 +293,17 @@ const PlayerContainer = memo(
|
||||
windowBarStyle,
|
||||
}: PlayerContainerProps) => {
|
||||
const currentSong = usePlayerSong();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { currentStationArt: currentRadioStationArt } = useRadioPlayer();
|
||||
|
||||
const imageId = isRadioActive ? currentRadioStationArt?.imageId : currentSong?.imageId;
|
||||
const currentImageUrl = isRadioActive
|
||||
? currentRadioStationArt?.imageUrl
|
||||
: currentSong?.imageUrl;
|
||||
|
||||
const imageUrl = useItemImageUrl({
|
||||
id: currentSong?.imageId || undefined,
|
||||
imageUrl: currentSong?.imageUrl,
|
||||
id: imageId || undefined,
|
||||
imageUrl: currentImageUrl,
|
||||
itemType: LibraryItem.SONG,
|
||||
type: 'itemCard',
|
||||
});
|
||||
@@ -339,11 +347,7 @@ export const FullScreenPlayer = () => {
|
||||
activeTab === 'visualizer';
|
||||
|
||||
const { windowBarStyle } = useWindowSettings();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { isPlaying: isRadioPlaying } = useRadioPlayer();
|
||||
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
const effectiveDynamicBackground = dynamicBackground && !isPlayingRadio;
|
||||
const effectiveDynamicBackground = dynamicBackground;
|
||||
|
||||
const location = useLocation();
|
||||
const isOpenedRef = useRef<boolean | null>(null);
|
||||
|
||||
@@ -93,12 +93,10 @@ export const MobileFullscreenPlayerAlbumArt = () => {
|
||||
const { fullScreenPlayer: albumArtRes } = useImageRes();
|
||||
const { useImageAspectRatio } = useFullScreenPlayerStore();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { isPlaying: isRadioPlaying } = useRadioPlayer();
|
||||
const { currentStationArt: currentRadioStationArt } = useRadioPlayer();
|
||||
const currentSong = usePlayerSong();
|
||||
const { nextSong } = usePlayerData();
|
||||
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
|
||||
const currentImageUrl = useItemImageUrl({
|
||||
id: currentSong?.imageId || undefined,
|
||||
itemType: LibraryItem.SONG,
|
||||
@@ -113,6 +111,13 @@ export const MobileFullscreenPlayerAlbumArt = () => {
|
||||
type: 'fullScreenPlayer',
|
||||
});
|
||||
|
||||
const radioImage = useItemImageUrl({
|
||||
id: currentRadioStationArt?.imageId || undefined,
|
||||
itemType: LibraryItem.RADIO_STATION,
|
||||
serverId: currentRadioStationArt?.serverId,
|
||||
type: 'fullScreenPlayer',
|
||||
});
|
||||
|
||||
const [imageState, setImageState] = useSetState({
|
||||
bottomImage: nextImageUrl,
|
||||
current: 0,
|
||||
@@ -167,7 +172,7 @@ export const MobileFullscreenPlayerAlbumArt = () => {
|
||||
})}
|
||||
>
|
||||
<AnimatePresence initial={false} mode="sync">
|
||||
{isPlayingRadio ? (
|
||||
{isRadioActive ? (
|
||||
<ImageWithPlaceholder
|
||||
animate="open"
|
||||
className={PlaybackSelectors.playerCoverArt}
|
||||
@@ -179,7 +184,7 @@ export const MobileFullscreenPlayerAlbumArt = () => {
|
||||
loading="eager"
|
||||
placeholder="var(--theme-colors-foreground-muted)"
|
||||
placeholderIcon="radio"
|
||||
src=""
|
||||
src={radioImage || ''}
|
||||
useImageAspectRatio={useImageAspectRatio}
|
||||
variants={imageVariants}
|
||||
/>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { lazy, memo, Suspense } from 'react';
|
||||
import styles from './mobile-fullscreen-player.module.css';
|
||||
|
||||
import { PlayerbarSeekSlider } from '/@/renderer/features/player/components/playerbar-seek-slider';
|
||||
import { useIsRadioActive } from '/@/renderer/features/radio/hooks/use-radio-player';
|
||||
import { usePlayerTimestamp } from '/@/renderer/store';
|
||||
import { PlayerbarSliderType, usePlayerbarSlider } from '/@/renderer/store/settings.store';
|
||||
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||
@@ -29,8 +30,13 @@ export const MobileFullscreenPlayerProgress = memo(
|
||||
const formattedDuration = formatDuration(songDuration * 1000 || 0);
|
||||
const formattedTime = formatDuration(currentTime * 1000 || 0);
|
||||
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const isWaveform = playerbarSlider?.type === PlayerbarSliderType.WAVEFORM;
|
||||
|
||||
if (isRadioActive) {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.progressContainer}>
|
||||
<div className={styles.timeContainer}>
|
||||
|
||||
@@ -339,9 +339,17 @@ const MobilePlayerContainer = memo(
|
||||
opacity,
|
||||
}: MobilePlayerContainerProps) => {
|
||||
const currentSong = usePlayerSong();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { currentStationArt: currentRadioStationArt } = useRadioPlayer();
|
||||
|
||||
const imageId = isRadioActive ? currentRadioStationArt?.imageId : currentSong?.imageId;
|
||||
const currentImageUrl = isRadioActive
|
||||
? currentRadioStationArt?.imageUrl
|
||||
: currentSong?.imageUrl;
|
||||
|
||||
const imageUrl = useItemImageUrl({
|
||||
id: currentSong?.imageId || undefined,
|
||||
imageUrl: currentSong?.imageUrl,
|
||||
id: imageId || undefined,
|
||||
imageUrl: currentImageUrl,
|
||||
itemType: LibraryItem.SONG,
|
||||
type: 'itemCard',
|
||||
});
|
||||
@@ -423,11 +431,10 @@ export const MobileFullscreenPlayer = () => {
|
||||
const currentSong = usePlayerSong();
|
||||
const { currentSong: currentSongData } = usePlayerData();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { isPlaying: isRadioPlaying, metadata: radioMetadata, stationName } = useRadioPlayer();
|
||||
const { metadata: radioMetadata, stationName } = useRadioPlayer();
|
||||
const server = useCurrentServer();
|
||||
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
const effectiveDynamicBackground = dynamicBackground && !isPlayingRadio;
|
||||
const effectiveDynamicBackground = dynamicBackground;
|
||||
|
||||
const setFavorite = useSetFavorite();
|
||||
const showRatingsSetting = useShowRatings();
|
||||
@@ -517,8 +524,8 @@ export const MobileFullscreenPlayer = () => {
|
||||
currentSong={currentSong}
|
||||
onToggleFavorite={handleToggleFavorite}
|
||||
onUpdateRating={handleUpdateRating}
|
||||
radioStationName={isPlayingRadio ? (stationName ?? undefined) : undefined}
|
||||
radioTitle={isPlayingRadio ? (radioMetadata?.title ?? undefined) : undefined}
|
||||
radioStationName={isRadioActive ? (stationName ?? undefined) : undefined}
|
||||
radioTitle={isRadioActive ? (radioMetadata?.title ?? undefined) : undefined}
|
||||
showFavorite={showFavorites}
|
||||
showRating={showRating}
|
||||
/>
|
||||
|
||||
@@ -9,7 +9,12 @@ import styles from './mobile-playerbar.module.css';
|
||||
import { ItemImage } from '/@/renderer/components/item-image/item-image';
|
||||
import { ContextMenuController } from '/@/renderer/features/context-menu/context-menu-controller';
|
||||
import { MainPlayButton, PlayerButton } from '/@/renderer/features/player/components/player-button';
|
||||
import { RadioMetadataDisplay } from '/@/renderer/features/player/components/radio-metadata-display';
|
||||
import { usePlayer } from '/@/renderer/features/player/context/player-context';
|
||||
import {
|
||||
useIsRadioActive,
|
||||
useRadioPlayer,
|
||||
} from '/@/renderer/features/radio/hooks/use-radio-player';
|
||||
import { AppRoute } from '/@/renderer/router/routes';
|
||||
import {
|
||||
useFullScreenPlayerStore,
|
||||
@@ -34,11 +39,14 @@ export const MobilePlayerbar = () => {
|
||||
const setFullScreenPlayerStore = useSetFullScreenPlayerStore();
|
||||
const { setStore } = useFullScreenPlayerStoreActions();
|
||||
const currentSong = usePlayerSong();
|
||||
const { currentStationArt } = useRadioPlayer();
|
||||
const status = usePlayerStatus();
|
||||
const { mediaNext, mediaPrevious, mediaTogglePlayPause } = usePlayer();
|
||||
const title = currentSong?.name;
|
||||
const artists = currentSong?.artists;
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const isSongDefined = Boolean(currentSong?.id);
|
||||
const isRadioMode = isRadioActive;
|
||||
|
||||
const handleToggleFullScreenPlayer = (e?: KeyboardEvent | MouseEvent<HTMLDivElement>) => {
|
||||
e?.stopPropagation();
|
||||
@@ -92,9 +100,17 @@ export const MobilePlayerbar = () => {
|
||||
)}
|
||||
enableDebounce={false}
|
||||
enableViewport={false}
|
||||
explicitStatus={currentSong.explicitStatus}
|
||||
explicitStatus={
|
||||
isRadioActive
|
||||
? undefined
|
||||
: currentSong.explicitStatus
|
||||
}
|
||||
fetchPriority="high"
|
||||
id={currentSong.imageId}
|
||||
id={
|
||||
isRadioActive
|
||||
? currentStationArt?.imageId
|
||||
: currentSong.imageId
|
||||
}
|
||||
itemType={LibraryItem.SONG}
|
||||
type="table"
|
||||
/>
|
||||
@@ -104,97 +120,106 @@ export const MobilePlayerbar = () => {
|
||||
)}
|
||||
</AnimatePresence>
|
||||
<motion.div className={styles.metadataStack} layout="position">
|
||||
<div className={styles.lineItem} onClick={stopPropagation}>
|
||||
<Group align="center" gap="xs" wrap="nowrap">
|
||||
<Text
|
||||
className={PlaybackSelectors.songTitle}
|
||||
component={Link}
|
||||
fw={500}
|
||||
isLink
|
||||
onClick={handleToggleFullScreenPlayer}
|
||||
onContextMenu={handleToggleContextMenu}
|
||||
overflow="hidden"
|
||||
size="sm"
|
||||
to={AppRoute.NOW_PLAYING}
|
||||
truncate
|
||||
{isRadioMode ? (
|
||||
<RadioMetadataDisplay
|
||||
onStopPropagation={stopPropagation}
|
||||
onToggleContextMenu={handleToggleContextMenu}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<div className={styles.lineItem} onClick={stopPropagation}>
|
||||
<Group align="center" gap="xs" wrap="nowrap">
|
||||
<Text
|
||||
className={PlaybackSelectors.songTitle}
|
||||
component={Link}
|
||||
fw={500}
|
||||
isLink
|
||||
onClick={handleToggleFullScreenPlayer}
|
||||
onContextMenu={handleToggleContextMenu}
|
||||
overflow="hidden"
|
||||
size="sm"
|
||||
to={AppRoute.NOW_PLAYING}
|
||||
truncate
|
||||
>
|
||||
{title || '—'}
|
||||
</Text>
|
||||
{isSongDefined && (
|
||||
<ActionIcon
|
||||
icon="ellipsisVertical"
|
||||
onClick={handleToggleContextMenu}
|
||||
size="xs"
|
||||
styles={{
|
||||
root: {
|
||||
'--ai-size-xs': '1.15rem',
|
||||
},
|
||||
}}
|
||||
variant="subtle"
|
||||
/>
|
||||
)}
|
||||
</Group>
|
||||
</div>
|
||||
<div
|
||||
className={clsx(
|
||||
styles.lineItem,
|
||||
styles.secondary,
|
||||
PlaybackSelectors.songArtist,
|
||||
)}
|
||||
onClick={stopPropagation}
|
||||
>
|
||||
{artists?.map((artist, index) => (
|
||||
<React.Fragment key={`bar-${artist.id}`}>
|
||||
{index > 0 && <Separator />}
|
||||
<Text
|
||||
component={artist.id ? Link : undefined}
|
||||
fw={500}
|
||||
isLink={artist.id !== ''}
|
||||
onClick={handleToggleFullScreenPlayer}
|
||||
overflow="hidden"
|
||||
size="xs"
|
||||
to={
|
||||
artist.id
|
||||
? generatePath(
|
||||
AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL,
|
||||
{
|
||||
albumArtistId: artist.id,
|
||||
},
|
||||
)
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{artist.name || '—'}
|
||||
</Text>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
<div
|
||||
className={clsx(
|
||||
styles.lineItem,
|
||||
styles.secondary,
|
||||
PlaybackSelectors.songAlbum,
|
||||
)}
|
||||
onClick={stopPropagation}
|
||||
>
|
||||
{title || '—'}
|
||||
</Text>
|
||||
{isSongDefined && (
|
||||
<ActionIcon
|
||||
icon="ellipsisVertical"
|
||||
onClick={handleToggleContextMenu}
|
||||
size="xs"
|
||||
styles={{
|
||||
root: {
|
||||
'--ai-size-xs': '1.15rem',
|
||||
},
|
||||
}}
|
||||
variant="subtle"
|
||||
/>
|
||||
)}
|
||||
</Group>
|
||||
</div>
|
||||
<div
|
||||
className={clsx(
|
||||
styles.lineItem,
|
||||
styles.secondary,
|
||||
PlaybackSelectors.songArtist,
|
||||
)}
|
||||
onClick={stopPropagation}
|
||||
>
|
||||
{artists?.map((artist, index) => (
|
||||
<React.Fragment key={`bar-${artist.id}`}>
|
||||
{index > 0 && <Separator />}
|
||||
<Text
|
||||
component={artist.id ? Link : undefined}
|
||||
component={Link}
|
||||
fw={500}
|
||||
isLink={artist.id !== ''}
|
||||
isLink
|
||||
onClick={handleToggleFullScreenPlayer}
|
||||
overflow="hidden"
|
||||
size="xs"
|
||||
to={
|
||||
artist.id
|
||||
? generatePath(
|
||||
AppRoute.LIBRARY_ALBUM_ARTISTS_DETAIL,
|
||||
{
|
||||
albumArtistId: artist.id,
|
||||
},
|
||||
)
|
||||
: undefined
|
||||
currentSong?.albumId
|
||||
? generatePath(AppRoute.LIBRARY_ALBUMS_DETAIL, {
|
||||
albumId: currentSong.albumId,
|
||||
})
|
||||
: ''
|
||||
}
|
||||
>
|
||||
{artist.name || '—'}
|
||||
{currentSong?.album || '—'}
|
||||
</Text>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</div>
|
||||
<div
|
||||
className={clsx(
|
||||
styles.lineItem,
|
||||
styles.secondary,
|
||||
PlaybackSelectors.songAlbum,
|
||||
)}
|
||||
onClick={stopPropagation}
|
||||
>
|
||||
<Text
|
||||
component={Link}
|
||||
fw={500}
|
||||
isLink
|
||||
onClick={handleToggleFullScreenPlayer}
|
||||
overflow="hidden"
|
||||
size="xs"
|
||||
to={
|
||||
currentSong?.albumId
|
||||
? generatePath(AppRoute.LIBRARY_ALBUMS_DETAIL, {
|
||||
albumId: currentSong.albumId,
|
||||
})
|
||||
: ''
|
||||
}
|
||||
>
|
||||
{currentSong?.album || '—'}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</motion.div>
|
||||
</LayoutGroup>
|
||||
</div>
|
||||
|
||||
@@ -32,8 +32,7 @@ export const SharedFullscreenPlayerMetadata = ({
|
||||
}: SharedFullscreenPlayerMetadataProps) => {
|
||||
const currentSong = usePlayerSong();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { isPlaying: isRadioPlaying, metadata: radioMetadata, stationName } = useRadioPlayer();
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
const { metadata: radioMetadata, stationName } = useRadioPlayer();
|
||||
|
||||
const { playerItemAlignment, titleDisplayType, titleLineCount } = useFullScreenPlayerStore();
|
||||
const { playerItems } = useGeneralSettings();
|
||||
@@ -83,7 +82,7 @@ export const SharedFullscreenPlayerMetadata = ({
|
||||
};
|
||||
|
||||
const hasMetadata =
|
||||
!isPlayingRadio && playerItems.some((i) => !i.disabled && builtDataItems[i.id]);
|
||||
!isRadioActive && playerItems.some((i) => !i.disabled && builtDataItems[i.id]);
|
||||
|
||||
const showMetadata =
|
||||
playerItems.some((i) => !i.disabled && builtDataItems[i.id]) ||
|
||||
@@ -132,7 +131,7 @@ export const SharedFullscreenPlayerMetadata = ({
|
||||
size="4xl"
|
||||
speed={50}
|
||||
>
|
||||
{isPlayingRadio
|
||||
{isRadioActive
|
||||
? radioMetadata?.title || stationName || 'Radio'
|
||||
: currentSong?.name}
|
||||
</TextScrolling>
|
||||
@@ -149,14 +148,14 @@ export const SharedFullscreenPlayerMetadata = ({
|
||||
}}
|
||||
w="100%"
|
||||
>
|
||||
{isPlayingRadio
|
||||
{isRadioActive
|
||||
? radioMetadata?.title || stationName || 'Radio'
|
||||
: currentSong?.name}
|
||||
</Text>
|
||||
))}
|
||||
{showArtist && (
|
||||
<Text key="fs-artists" size="xl">
|
||||
{isPlayingRadio
|
||||
{isRadioActive
|
||||
? radioMetadata?.artist || stationName || 'Radio'
|
||||
: currentSong?.artists?.map((artist, index) => (
|
||||
<Fragment key={`fs-artist-${artist.id}`}>
|
||||
@@ -187,7 +186,7 @@ export const SharedFullscreenPlayerMetadata = ({
|
||||
</Text>
|
||||
)}
|
||||
{showAlbum &&
|
||||
(isPlayingRadio ? (
|
||||
(isRadioActive ? (
|
||||
<Text overflow="hidden" size="xl" w="100%">
|
||||
{stationName || 'Radio'}
|
||||
</Text>
|
||||
@@ -205,7 +204,7 @@ export const SharedFullscreenPlayerMetadata = ({
|
||||
{currentSong?.album}
|
||||
</Text>
|
||||
))}
|
||||
{!isPlayingRadio && hasMetadata && (
|
||||
{!isRadioActive && hasMetadata && (
|
||||
<Group justify={metadataAlignment} mt="sm" w="100%">
|
||||
{playerItems.map((i) => !i.disabled && builtDataItems[i.id])}
|
||||
</Group>
|
||||
|
||||
@@ -170,7 +170,7 @@ const SidebarImage = () => {
|
||||
const { setSideBar } = useAppStoreActions();
|
||||
const currentSong = usePlayerSong();
|
||||
const isRadioActive = useIsRadioActive();
|
||||
const { currentStationArt, isPlaying: isRadioPlaying } = useRadioPlayer();
|
||||
const { currentStationArt } = useRadioPlayer();
|
||||
const { blurExplicitImages } = useGeneralSettings();
|
||||
|
||||
const imageUrl = useItemImageUrl({
|
||||
@@ -188,7 +188,6 @@ const SidebarImage = () => {
|
||||
type: 'sidebar',
|
||||
});
|
||||
|
||||
const isPlayingRadio = isRadioActive && isRadioPlaying;
|
||||
const isSongDefined = Boolean(currentSong?.id);
|
||||
|
||||
const setFullScreenPlayerStore = useSetFullScreenPlayerStore();
|
||||
@@ -201,7 +200,7 @@ const SidebarImage = () => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
if (!currentSong || isPlayingRadio) {
|
||||
if (!currentSong || isRadioActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user