forked from th-ch/youtube-music
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Plugin File * Added Logic * Known issue * Finished Backend part * Before cleanup * Added Style Removed log * Fixed time and visibility issues * Changed lyrics style * Changed way lyrics are selected * Fix * Added style lyrics options * Cleanup * Fix lyrics styling Changed how lyrics status are changed * Moved code to make file more readable * Change Tab Size * Fixed issue with overlapping lyrics * Removed debug console.log * Added style adaptation for music videos * Changed file indent * Revered back to original pnpm file * Removed unnecessary option * Fix lyrics status bug Removed leftover logs * Started to implement fetching for genius lyrics * feat(synced-lyrics): add `addedVersion` field * Made changes according to feedbacks * fix: add a delay of 300ms to the current time - Since the transition takes 300ms, we need to add a delay of 300ms to the current time * Removed test about genius.com scraping * Removed 300ms delay * chore: cleaned up the code * Specified path and variable * chore: always enable lyrics tab * chore: use SolidJS to render the lyrics * chore: remove useless signal * chore: feature-parity with original PR (+some nice stuff) * recreate lock file * show json decode error * feat(synced-lyrics): improve ui - Change type assertion code - Replace span to `yt-formatted-string` - Add refetch button * chore: make the lyric styling a solidjs effect * feat: i18n * chore: apply suggestion --------- Co-authored-by: Su-Yong <[email protected]> Co-authored-by: JellyBrick <[email protected]> Co-authored-by: Angelos Bouklis <[email protected]>
- Loading branch information
Showing
19 changed files
with
977 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import style from './style.css?inline'; | ||
import { createPlugin } from '@/utils'; | ||
|
||
import { SyncedLyricsPluginConfig } from './types'; | ||
|
||
import { menu } from './menu'; | ||
import { renderer } from './renderer'; | ||
|
||
import { t } from '@/i18n'; | ||
|
||
export default createPlugin({ | ||
name: () => t('plugins.synced-lyrics.name'), | ||
description: () => t('plugins.synced-lyrics.description'), | ||
authors: ['Non0reo', 'ArjixWasTaken'], | ||
restartNeeded: true, | ||
addedVersion: '3.4.X', | ||
config: { | ||
preciseTiming: true, | ||
showLyricsEvenIfInexact: true, | ||
showTimeCodes: false, | ||
defaultTextString: '♪', | ||
lineEffect: 'scale', | ||
} as SyncedLyricsPluginConfig, | ||
|
||
menu, | ||
renderer, | ||
stylesheets: [style], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import { MenuItemConstructorOptions } from 'electron'; | ||
|
||
import { MenuContext } from '@/types/contexts'; | ||
import { SyncedLyricsPluginConfig } from './types'; | ||
|
||
export const menu = async ({ | ||
getConfig, | ||
setConfig, | ||
}: MenuContext<SyncedLyricsPluginConfig>): Promise< | ||
MenuItemConstructorOptions[] | ||
> => { | ||
const config = await getConfig(); | ||
|
||
return [ | ||
{ | ||
label: 'Make the lyrics perfectly synced', | ||
toolTip: | ||
'Calculate to the milisecond the display of the next line (can have a small impact on performance)', | ||
type: 'checkbox', | ||
checked: config.preciseTiming, | ||
click(item) { | ||
setConfig({ | ||
preciseTiming: item.checked, | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: 'Line effect', | ||
toolTip: 'Choose the effect to apply to the current line', | ||
type: 'submenu', | ||
submenu: [ | ||
{ | ||
label: 'Scale', | ||
toolTip: 'Scale the current line', | ||
type: 'radio', | ||
checked: config.lineEffect === 'scale', | ||
click() { | ||
setConfig({ | ||
lineEffect: 'scale', | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: 'Offset', | ||
toolTip: 'Offset on the right the current line', | ||
type: 'radio', | ||
checked: config.lineEffect === 'offset', | ||
click() { | ||
setConfig({ | ||
lineEffect: 'offset', | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: 'Focus', | ||
toolTip: 'Make only the current line white', | ||
type: 'radio', | ||
checked: config.lineEffect === 'focus', | ||
click() { | ||
setConfig({ | ||
lineEffect: 'focus', | ||
}); | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
label: 'Default character between lyrics', | ||
toolTip: 'Choose the default string to use for the gap between lyrics', | ||
type: 'submenu', | ||
submenu: [ | ||
{ | ||
label: '♪', | ||
type: 'radio', | ||
checked: config.defaultTextString === '♪', | ||
click() { | ||
setConfig({ | ||
defaultTextString: '♪', | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: '[SPACE]', | ||
type: 'radio', | ||
checked: config.defaultTextString === ' ', | ||
click() { | ||
setConfig({ | ||
defaultTextString: ' ', | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: '...', | ||
type: 'radio', | ||
checked: config.defaultTextString === '...', | ||
click() { | ||
setConfig({ | ||
defaultTextString: '...', | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: '———', | ||
type: 'radio', | ||
checked: config.defaultTextString === '———', | ||
click() { | ||
setConfig({ | ||
defaultTextString: '———', | ||
}); | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
label: 'Show time codes', | ||
toolTip: 'Show the time codes next to the lyrics', | ||
type: 'checkbox', | ||
checked: config.showTimeCodes, | ||
click(item) { | ||
setConfig({ | ||
showTimeCodes: item.checked, | ||
}); | ||
}, | ||
}, | ||
{ | ||
label: 'Show lyrics even if inexact', | ||
toolTip: | ||
'If the song is not found, the plugin tries again with a different search query.\nThe result from the second attempt may not be exact.', | ||
type: 'checkbox', | ||
checked: config.showLyricsEvenIfInexact, | ||
click(item) { | ||
setConfig({ | ||
showLyricsEvenIfInexact: item.checked, | ||
}); | ||
}, | ||
}, | ||
]; | ||
}; |
Oops, something went wrong.