mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
fix: plugin load
This commit is contained in:
@ -26,7 +26,6 @@ export default builder.createRenderer(async ({ getConfig }) => {
|
||||
if (!video) return null;
|
||||
if (!wrapper) return null;
|
||||
|
||||
console.log('injectBlurVideo', songVideo, video, wrapper);
|
||||
const blurCanvas = document.createElement('canvas');
|
||||
blurCanvas.classList.add('html5-blur-canvas');
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ export default builder.createMain(({ handle, send }) => {
|
||||
if (target) target.click(undefined, BrowserWindow.fromWebContents(event.sender), event.sender);
|
||||
});
|
||||
|
||||
handle('get-menu-by-id', (_, commandId: number) => {
|
||||
handle('get-menu-by-id', (commandId: number) => {
|
||||
const result = getMenuItemById(commandId);
|
||||
|
||||
return JSON.parse(JSON.stringify(
|
||||
@ -67,7 +67,7 @@ export default builder.createMain(({ handle, send }) => {
|
||||
handle('window-unmaximize', () => win.unmaximize());
|
||||
win.on('unmaximize', () => send('window-unmaximize'));
|
||||
|
||||
handle('image-path-to-data-url', (_, imagePath: string) => {
|
||||
handle('image-path-to-data-url', (imagePath: string) => {
|
||||
const nativeImageIcon = nativeImage.createFromPath(imagePath);
|
||||
return nativeImageIcon?.toDataURL();
|
||||
});
|
||||
|
||||
@ -20,7 +20,7 @@ export default builder.createMain(({ handle, getConfig }) =>{
|
||||
revRomanized = true;
|
||||
}
|
||||
|
||||
handle('search-genius-lyrics', async (_, extractedSongInfo: SongInfo) => {
|
||||
handle('search-genius-lyrics', async (extractedSongInfo: SongInfo) => {
|
||||
const metadata = extractedSongInfo;
|
||||
return await fetchFromGenius(metadata);
|
||||
});
|
||||
|
||||
@ -24,7 +24,7 @@ export default builder.createRenderer(({ on, invoke }) => ({
|
||||
|
||||
let unregister: (() => void) | null = null;
|
||||
|
||||
on('update-song-info', (_, extractedSongInfo: SongInfo) => {
|
||||
on('update-song-info', (extractedSongInfo: SongInfo) => {
|
||||
unregister?.();
|
||||
|
||||
setTimeout(async () => {
|
||||
|
||||
@ -261,8 +261,8 @@ export default builder.createRenderer(async ({ on, getConfig, setConfig }) => {
|
||||
|
||||
document.addEventListener('apiLoaded', (e) => {
|
||||
api = e.detail;
|
||||
on('changeVolume', (_, toIncrease: boolean) => changeVolume(toIncrease));
|
||||
on('setVolume', (_, value: number) => setVolume(value));
|
||||
on('changeVolume', (toIncrease: boolean) => changeVolume(toIncrease));
|
||||
on('setVolume', (value: number) => setVolume(value));
|
||||
firstRun();
|
||||
}, { once: true, passive: true });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user