mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Fix: ratings display on player bar and mobile player (#1646)
* fix(playerbar): use settings to display ratings * fix(mobile player): use settings to display ratings
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
|||||||
useCurrentServer,
|
useCurrentServer,
|
||||||
useFullScreenPlayerStore,
|
useFullScreenPlayerStore,
|
||||||
useFullScreenPlayerStoreActions,
|
useFullScreenPlayerStoreActions,
|
||||||
|
useGeneralSettings,
|
||||||
usePlayerData,
|
usePlayerData,
|
||||||
usePlayerSong,
|
usePlayerSong,
|
||||||
useSetFullScreenPlayerStore,
|
useSetFullScreenPlayerStore,
|
||||||
@@ -377,6 +378,7 @@ export const MobileFullscreenPlayer = () => {
|
|||||||
const { currentSong: currentSongData } = usePlayerData();
|
const { currentSong: currentSongData } = usePlayerData();
|
||||||
const server = useCurrentServer();
|
const server = useCurrentServer();
|
||||||
const setFavorite = useSetFavorite();
|
const setFavorite = useSetFavorite();
|
||||||
|
const { showRatings: showRatingsSetting } = useGeneralSettings();
|
||||||
const setRating = useSetRating();
|
const setRating = useSetRating();
|
||||||
|
|
||||||
const [isPageHovered, setIsPageHovered] = useState(false);
|
const [isPageHovered, setIsPageHovered] = useState(false);
|
||||||
@@ -435,6 +437,7 @@ export const MobileFullscreenPlayer = () => {
|
|||||||
const isLyricsState = activeTab === 'lyrics';
|
const isLyricsState = activeTab === 'lyrics';
|
||||||
const isSongDefined = Boolean(currentSong?.id);
|
const isSongDefined = Boolean(currentSong?.id);
|
||||||
const showRating =
|
const showRating =
|
||||||
|
showRatingsSetting &&
|
||||||
isSongDefined &&
|
isSongDefined &&
|
||||||
(server?.type === ServerType.NAVIDROME || server?.type === ServerType.SUBSONIC);
|
(server?.type === ServerType.NAVIDROME || server?.type === ServerType.SUBSONIC);
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
useAutoDJSettings,
|
useAutoDJSettings,
|
||||||
useCurrentServer,
|
useCurrentServer,
|
||||||
useFullScreenPlayerStore,
|
useFullScreenPlayerStore,
|
||||||
|
useGeneralSettings,
|
||||||
useHotkeySettings,
|
useHotkeySettings,
|
||||||
usePlayerData,
|
usePlayerData,
|
||||||
usePlayerMuted,
|
usePlayerMuted,
|
||||||
@@ -63,10 +64,11 @@ const calculateVolumeDown = (volume: number, volumeWheelStep: number) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const RightControls = () => {
|
export const RightControls = () => {
|
||||||
|
const { showRatings } = useGeneralSettings();
|
||||||
return (
|
return (
|
||||||
<Flex align="flex-end" direction="column" h="100%" px="1rem" py="0.5rem">
|
<Flex align="flex-end" direction="column" h="100%" px="1rem" py="0.5rem">
|
||||||
<Group h="calc(100% / 3)">
|
<Group h="calc(100% / 3)">
|
||||||
<RatingButton />
|
{showRatings && <RatingButton />}
|
||||||
<AutoDJButton />
|
<AutoDJButton />
|
||||||
</Group>
|
</Group>
|
||||||
<Group align="center" gap="xs" wrap="nowrap">
|
<Group align="center" gap="xs" wrap="nowrap">
|
||||||
|
|||||||
Reference in New Issue
Block a user