mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 02:51:46 +00:00
fix(api-server): repeat event listener
This commit is contained in:
@ -24,9 +24,10 @@ export const backend = createBackend<BackendType, APIServerConfig>({
|
||||
this.songInfo = songInfo;
|
||||
});
|
||||
|
||||
ctx.ipc.on('ytmd:player-api-loaded', () =>
|
||||
ctx.ipc.send('ytmd:setup-time-changed-listener'),
|
||||
);
|
||||
ctx.ipc.on('ytmd:player-api-loaded', () => {
|
||||
ctx.ipc.send('ytmd:setup-time-changed-listener');
|
||||
ctx.ipc.send('ytmd:setup-repeat-changed-listener');
|
||||
});
|
||||
|
||||
ctx.ipc.on(
|
||||
'ytmd:repeat-changed',
|
||||
@ -59,6 +60,12 @@ export const backend = createBackend<BackendType, APIServerConfig>({
|
||||
|
||||
this.app.use('*', cors());
|
||||
|
||||
// for web remote control
|
||||
this.app.use('*', async (ctx, next) => {
|
||||
ctx.header('Access-Control-Request-Private-Network', 'true');
|
||||
await next();
|
||||
});
|
||||
|
||||
// middlewares
|
||||
this.app.use('/api/*', async (ctx, next) => {
|
||||
if (config.authStrategy !== AuthStrategy.NONE) {
|
||||
|
||||
Reference in New Issue
Block a user