From d38c846e807faafb504ce9210eb8a0e755f9c4d9 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 5 Jun 2023 02:42:25 -0700 Subject: [PATCH] Update lyric fetcher return types --- src/main/features/core/lyrics/genius.ts | 8 +++++--- src/main/features/core/lyrics/netease.ts | 8 +++++--- src/renderer/api/types.ts | 3 ++- src/renderer/features/lyrics/synchronized-lyrics.tsx | 2 +- src/renderer/features/lyrics/unsynchronized-lyrics.tsx | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/features/core/lyrics/genius.ts b/src/main/features/core/lyrics/genius.ts index c5851d05..1abaa3cd 100644 --- a/src/main/features/core/lyrics/genius.ts +++ b/src/main/features/core/lyrics/genius.ts @@ -1,6 +1,7 @@ import axios, { AxiosResponse } from 'axios'; import { load } from 'cheerio'; import type { InternetProviderLyricResponse, QueueSong } from '/@/renderer/api/types'; +import { LyricSource } from '../../../../renderer/types'; const SEARCH_URL = 'https://genius.com/api/search/song'; @@ -8,7 +9,7 @@ const SEARCH_URL = 'https://genius.com/api/search/song'; interface GeniusResponse { artist: string; - title: string; + name: string; url: string; } @@ -34,7 +35,7 @@ async function getSongURL(metadata: QueueSong): Promise { @@ -37,7 +38,7 @@ async function getSongId(metadata: QueueSong): Promise; diff --git a/src/renderer/features/lyrics/synchronized-lyrics.tsx b/src/renderer/features/lyrics/synchronized-lyrics.tsx index d7e542f4..8342b897 100644 --- a/src/renderer/features/lyrics/synchronized-lyrics.tsx +++ b/src/renderer/features/lyrics/synchronized-lyrics.tsx @@ -279,7 +279,7 @@ export const SynchronizedLyrics = ({ <> diff --git a/src/renderer/features/lyrics/unsynchronized-lyrics.tsx b/src/renderer/features/lyrics/unsynchronized-lyrics.tsx index d5780097..8a95b6b7 100644 --- a/src/renderer/features/lyrics/unsynchronized-lyrics.tsx +++ b/src/renderer/features/lyrics/unsynchronized-lyrics.tsx @@ -37,7 +37,7 @@ export const UnsynchronizedLyrics = ({ <>