mirror of
https://github.com/jeffvli/feishin.git
synced 2026-06-17 08:54:27 +02:00
Lyrics Improvements
- Make the settings text actually consistent with behavior - Add metadata (artist/track name) for fetched tracks - Add ability to remove incorrectly fetched lyric - Add lyric fetch cache; save the last 10 fetches - Add ability to change offset in full screen, add more comments
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import { useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { LyricLine } from '/@/renderer/features/lyrics/lyric-line';
|
||||
import { LyricOverride } from '/@/renderer/api/types';
|
||||
import { LyricSkip } from '/@/renderer/features/lyrics/lyric-skip';
|
||||
|
||||
interface UnsynchronizedLyricsProps {
|
||||
lyrics: string;
|
||||
onRemoveLyric: () => void;
|
||||
override: LyricOverride | null;
|
||||
source: string | null;
|
||||
}
|
||||
|
||||
@@ -11,7 +15,12 @@ const UnsynchronizedLyricsContainer = styled.div`
|
||||
padding: 5rem 0;
|
||||
`;
|
||||
|
||||
export const UnsynchronizedLyrics = ({ lyrics, source }: UnsynchronizedLyricsProps) => {
|
||||
export const UnsynchronizedLyrics = ({
|
||||
onRemoveLyric,
|
||||
lyrics,
|
||||
override,
|
||||
source,
|
||||
}: UnsynchronizedLyricsProps) => {
|
||||
const lines = useMemo(() => {
|
||||
return lyrics.split('\n');
|
||||
}, [lyrics]);
|
||||
@@ -24,6 +33,15 @@ export const UnsynchronizedLyrics = ({ lyrics, source }: UnsynchronizedLyricsPro
|
||||
text={`Lyrics provided by ${source}`}
|
||||
/>
|
||||
)}
|
||||
{override && (
|
||||
<>
|
||||
<LyricLine
|
||||
className="lyric-credit"
|
||||
text={`(Matched as ${override.title} by ${override.artist})`}
|
||||
/>
|
||||
<LyricSkip onClick={onRemoveLyric} />
|
||||
</>
|
||||
)}
|
||||
{lines.map((text, idx) => (
|
||||
<LyricLine
|
||||
key={idx}
|
||||
|
||||
Reference in New Issue
Block a user