mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 20:31: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;
|
this.songInfo = songInfo;
|
||||||
});
|
});
|
||||||
|
|
||||||
ctx.ipc.on('ytmd:player-api-loaded', () =>
|
ctx.ipc.on('ytmd:player-api-loaded', () => {
|
||||||
ctx.ipc.send('ytmd:setup-time-changed-listener'),
|
ctx.ipc.send('ytmd:setup-time-changed-listener');
|
||||||
);
|
ctx.ipc.send('ytmd:setup-repeat-changed-listener');
|
||||||
|
});
|
||||||
|
|
||||||
ctx.ipc.on(
|
ctx.ipc.on(
|
||||||
'ytmd:repeat-changed',
|
'ytmd:repeat-changed',
|
||||||
@ -59,6 +60,12 @@ export const backend = createBackend<BackendType, APIServerConfig>({
|
|||||||
|
|
||||||
this.app.use('*', cors());
|
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
|
// middlewares
|
||||||
this.app.use('/api/*', async (ctx, next) => {
|
this.app.use('/api/*', async (ctx, next) => {
|
||||||
if (config.authStrategy !== AuthStrategy.NONE) {
|
if (config.authStrategy !== AuthStrategy.NONE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user