From 46cc1a635f1f22884d7d8ffe870b93766e6b7835 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Sat, 3 Feb 2024 21:22:03 -0800 Subject: [PATCH] address changes --- .../api/jellyfin/jellyfin-controller.ts | 2 +- .../api/subsonic/subsonic-controller.ts | 2 +- .../features/lyrics/lyrics-actions.tsx | 21 ++++++++++++++++++- src/renderer/features/lyrics/lyrics.tsx | 15 ++++--------- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/renderer/api/jellyfin/jellyfin-controller.ts b/src/renderer/api/jellyfin/jellyfin-controller.ts index 5a1369a2..52cf298b 100644 --- a/src/renderer/api/jellyfin/jellyfin-controller.ts +++ b/src/renderer/api/jellyfin/jellyfin-controller.ts @@ -954,7 +954,7 @@ const getServerInfo = async (args: ServerInfoArgs): Promise => { const res = await jfApiClient(apiClientProps).getServerInfo(); if (res.status !== 200) { - throw new Error('Failed to get song detail'); + throw new Error('Failed to get server info'); } return { id: apiClientProps.server?.id, version: res.body.Version }; diff --git a/src/renderer/api/subsonic/subsonic-controller.ts b/src/renderer/api/subsonic/subsonic-controller.ts index 875b971e..b67200e8 100644 --- a/src/renderer/api/subsonic/subsonic-controller.ts +++ b/src/renderer/api/subsonic/subsonic-controller.ts @@ -411,7 +411,7 @@ export const getStructuredLyrics = async ( }); if (res.status !== 200) { - throw new Error('Failed to get server extensions'); + throw new Error('Failed to get structured lyrics'); } const lyrics = res.body.lyricsList?.structuredLyrics; diff --git a/src/renderer/features/lyrics/lyrics-actions.tsx b/src/renderer/features/lyrics/lyrics-actions.tsx index 3ce52b13..b9edc708 100644 --- a/src/renderer/features/lyrics/lyrics-actions.tsx +++ b/src/renderer/features/lyrics/lyrics-actions.tsx @@ -1,4 +1,4 @@ -import { Box, Group } from '@mantine/core'; +import { Box, Center, Group, Select, SelectItem } from '@mantine/core'; import isElectron from 'is-electron'; import { useTranslation } from 'react-i18next'; import { RiAddFill, RiSubtractFill } from 'react-icons/ri'; @@ -13,15 +13,22 @@ import { } from '/@/renderer/store'; interface LyricsActionsProps { + index: number; + languages: SelectItem[]; + onRemoveLyric: () => void; onResetLyric: () => void; onSearchOverride: (params: LyricsOverride) => void; + setIndex: (idx: number) => void; } export const LyricsActions = ({ + index, + languages, onRemoveLyric, onResetLyric, onSearchOverride, + setIndex, }: LyricsActionsProps) => { const { t } = useTranslation(); const currentSong = useCurrentSong(); @@ -42,6 +49,18 @@ export const LyricsActions = ({ return ( + {languages.length > 1 && ( +
+ setIndex(parseInt(value!, 10))} - /> - )} -