fix all imports for new structure

This commit is contained in:
jeffvli
2025-05-20 19:23:36 -07:00
parent 249eaf89f8
commit 930165d006
291 changed files with 2056 additions and 1894 deletions
+15 -6
View File
@@ -7,16 +7,25 @@ import { join } from 'path';
import { WebSocket, WebSocketServer, Server as WsServer } from 'ws';
import { deflate, gzip } from 'zlib';
import { getMainWindow } from '../../..';
import { isLinux } from '../../../utils';
import manifest from './manifest.json';
import { getMainWindow } from '/@/main/index';
import { isLinux } from '/@/main/utils';
import { QueueSong } from '/@/shared/types/domain-types';
import { ClientEvent, ServerEvent } from '/@/shared/types/remote-types';
import { PlayerRepeat, PlayerStatus, SongState } from '/@/shared/types/types';
let mprisPlayer: any | undefined;
if (isLinux()) {
mprisPlayer = require('../../linux/mpris').mprisPlayer;
async function initMpris() {
if (isLinux()) {
const mpris = await import('../../linux/mpris');
mprisPlayer = mpris.mprisPlayer;
}
}
initMpris();
interface MimeType {
css: string;
html: string;
@@ -630,8 +639,8 @@ if (mprisPlayer) {
mprisPlayer.on('loopStatus', (event: string) => {
const repeat = event === 'Playlist' ? 'all' : event === 'Track' ? 'one' : 'none';
currentState.repeat = repeat;
broadcast({ data: repeat, event: 'repeat' });
currentState.repeat = repeat as PlayerRepeat;
broadcast({ data: repeat, event: 'repeat' } as ServerEvent);
});
mprisPlayer.on('shuffle', (shuffle: boolean) => {