repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/utils/store.ts
src/main/utils/store.ts
// import { writeFileSync } from 'atomically' import { dialog, shell } from 'electron' import path from 'node:path' import fs from 'node:fs' import { log } from '@common/utils' type Stores = Record<string, Store> const stores: Stores = {} class Store { private readonly filePath: string private readonly dirPath:...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/utils/migrate.ts
src/main/utils/migrate.ts
import fs from 'node:fs' import { checkPath, joinPath } from '@common/utils/nodejs' import { log } from '@common/utils' import { filterMusicList, toNewMusicInfo } from '@common/utils/tools' import { APP_EVENT_NAMES, STORE_NAMES } from '@common/constants' /** * 读取配置文件 * @returns */ export const parseDataFile = async...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/utils/index.ts
src/main/utils/index.ts
import { encodePath, isUrl, throttle } from '@common/utils' import migrateSetting from '@common/utils/migrateSetting' import getStore from '@main/utils/store' import { STORE_NAMES, URL_SCHEME_RXP } from '@common/constants' import defaultSetting from '@common/defaultSetting' import defaultHotKey from '@common/defaultHot...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/utils/fontManage.ts
src/main/utils/fontManage.ts
// const { getAvailableFontFamilies } = require('electron-font-manager') // exports.getAvailableFontFamilies = getAvailableFontFamilies import { getFonts } from 'font-list' // import { getAvailableFontFamilies } from 'electron-font-manager' // const getFonts = async() => { // switch (process.platform) { // c...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/utils/request.ts
src/main/utils/request.ts
import needle, { type NeedleHttpVerbs, type NeedleOptions, type BodyData, type NeedleCallback, type NeedleResponse } from 'needle' // import progress from 'request-progress' import { httpOverHttp, httpsOverHttp } from 'tunnel' import { type ClientRequest } from 'node:http' import { getProxy } from './index' // import f...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/worker.d.ts
src/main/types/worker.d.ts
import { type workerDBSeriveTypes } from '@main/worker/dbService' declare global { // interface WorkerDBSeriveTypes { // list: typeof list // } namespace LX { type WorkerDBSeriveListTypes = workerDBSeriveTypes } }
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/common.d.ts
src/main/types/common.d.ts
import '@common/types/utils' import '@common/types/app_setting' import '@common/types/common' import '@common/types/user_api' import '@common/types/sync' import '@common/types/list' import '@common/types/list_sync' import '@common/types/download_list' import '@common/types/music' import '@common/types/player' import '@...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/app.d.ts
src/main/types/app.d.ts
/* eslint-disable no-var */ // import { Event as WinMainEvent } from '@main/modules/winMain/event' // import { Event as WinLyricEvent } from '@main/modules/winLyric/event' import { type DislikeType, type AppType, type ListType } from '@main/event' import { type DBSeriveTypes } from '@main/worker/utils' interface Lx { ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/sync_common.d.ts
src/main/types/sync_common.d.ts
type WarpSyncHandlerActions<Socket, Actions> = { [K in keyof Actions]: (...args: [Socket, ...Parameters<Actions[K]>]) => ReturnType<Actions[K]> } declare namespace LX { namespace Sync { type ServerSyncActions = WarpPromiseRecord<{ onFeatureChanged: (feature: EnabledFeatures) => void }> type Serve...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/global.d.ts
src/main/types/global.d.ts
// // declare module NodeJS { // // interface Global { // // isDev: boolean // // envParams: LX.EnvParams // // staticPath: string // // lx: Lx // // } // // } declare const webpackStaticPath: string declare const webpackUserApiPath: string
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/sync.d.ts
src/main/types/sync.d.ts
import type WS from 'ws' type DefaultEventsMap = Record<string, (...args: any[]) => void> declare global { namespace LX { namespace Sync { namespace Client { interface Socket extends WS.WebSocket { isReady: boolean data: { keyInfo: ClientKeyInfo urlInfo...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/types/db_service.d.ts
src/main/types/db_service.d.ts
declare namespace LX { namespace DBService { interface MusicInfo { id: string listId: string name: string singer: string interval: string | null source: LX.Music.MusicInfo['source'] meta: string order: number } interface MusicInfoOrder { listId: stri...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/event/AppEvent.ts
src/main/event/AppEvent.ts
import { EventEmitter } from 'events' import { saveAppHotKeyConfig, updateSetting } from '@main/utils' import type { BrowserWindow } from 'electron' export class Event extends EventEmitter { // closeAll() { // this.emit(COMMON_EVENT_NAME.closeAll) // } // initSetting() { // this.emit(COMMON_EVENT_NAME.i...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/event/index.ts
src/main/event/index.ts
import { Event as App, type Type as AppType } from './AppEvent' import { Event as List, type Type as ListType } from './ListEvent' import { Event as Dislike, type Type as DislikeType } from './DislikeEvent' export type { AppType, ListType, DislikeType, } export const createAppEvent = (): AppType => { return n...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/event/ListEvent.ts
src/main/event/ListEvent.ts
import { EventEmitter } from 'events' // import { // // getAllUserList as getAllUserListByDB, // createUserLists, // removeUserLists, // updateUserLists, // updateUserListsPosition, // musicsAdd, // musicsMove, // musicsRemove, // musicsUpdate, // musicsClear, // musicsPositionUpdate, // musicOv...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/event/DislikeEvent.ts
src/main/event/DislikeEvent.ts
import { EventEmitter } from 'events' export class Event extends EventEmitter { dislike_changed() { this.emit('dislike_changed') } /** * 覆盖整个列表数据 * @param dislikeData 列表数据 * @param isRemote 是否属于远程操作 */ async dislike_data_overwrite(dislikeData: LX.Dislike.DislikeRules, isRemote: boolean = fals...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/tray.ts
src/main/modules/tray.ts
import { Tray, Menu, nativeImage } from 'electron' import { isMac, isWin } from '@common/utils' import path from 'node:path' import { hideWindow as hideMainWindow, isExistWindow as isExistMainWindow, isShowWindow as isShowMainWindow, sendTaskbarButtonClick, showWindow as showMainWindow, } from './winMain' imp...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/index.ts
src/main/modules/index.ts
import registerUserApi from './userApi' import registerWinMain from './winMain' import registerHotKey from './hotKey' import registerTray from './tray' import registerAppMenu from './appMenu' import registerWinLyric from './winLyric' import registerCommonRenderers from './commonRenderers' let isRegistered = false expo...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/appMenu.ts
src/main/modules/appMenu.ts
import { app, Menu } from 'electron' import { isMac } from '@common/utils' export default () => { if (isMac) { const template: Electron.MenuItemConstructorOptions[] = [ { label: app.getName(), submenu: [ { label: '关于洛雪音乐', role: 'about' }, { type: 'separator' }, ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winLyric/config.ts
src/main/modules/winLyric/config.ts
import { isLinux } from '@common/utils' import { closeWindow, createWindow, getBounds, isExistWindow, alwaysOnTopTools, setBounds, setIgnoreMouseEvents, setSkipTaskbar } from './main' import { sendConfigChange } from './rendererEvent' import { buildLyricConfig, getLyricWindowBounds, initWindowSize, watchConfigKeys } fr...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winLyric/utils.ts
src/main/modules/winLyric/utils.ts
// 设置窗口位置、大小 export let minWidth = 38 export let minHeight = 38 // const updateBounds = (bounds: Bounds) => { // bounds.x = bounds.x // return bounds // } /** * * @param bounds 当前设置 * @param param 新设置(相对于当前设置) * @returns */ export const getLyricWindowBounds = (bounds: Electron.Rectangle, { x, y, w, h }: LX....
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winLyric/rendererEvent.ts
src/main/modules/winLyric/rendererEvent.ts
import { registerRendererEvents as common } from '@main/modules/commonRenderers/common' import { mainOn, mainHandle } from '@common/mainIpc' import { WIN_LYRIC_RENDERER_EVENT_NAME } from '@common/ipcNames' import { buildLyricConfig, getLyricWindowBounds } from './utils' import { sendNewDesktopLyricClient } from '@main/...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winLyric/main.ts
src/main/modules/winLyric/main.ts
import path from 'node:path' import { BrowserWindow } from 'electron' import { debounce, getPlatform, isLinux, isWin } from '@common/utils' import { initWindowSize, minHeight, minWidth } from './utils' import { mainSend } from '@common/mainIpc' import { encodePath } from '@common/utils/electron' // require('./event') ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winLyric/index.ts
src/main/modules/winLyric/index.ts
import { APP_EVENT_NAMES } from '@common/constants' import initRendererEvent, { sendMainWindowInitedEvent } from './rendererEvent' import { setLrcConfig } from './config' import { HOTKEY_DESKTOP_LYRIC } from '@common/hotKey' import { closeWindow, createWindow, isExistWindow } from './main' // import main from './main' ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/utils.ts
src/main/modules/winMain/utils.ts
// import fs from 'fs' import path from 'node:path' import { type WindowSize, windowSizeList } from '@common/config' import { nativeImage } from 'electron' export const getWindowSizeInfo = (windowSizeId: number | string): WindowSize => { return windowSizeList.find(i => i.id == windowSizeId) ?? windowSizeList[0] } c...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/main.ts
src/main/modules/winMain/main.ts
import { BrowserWindow, dialog, session } from 'electron' import path from 'node:path' import { createTaskBarButtons, getWindowSizeInfo } from './utils' import { getPlatform, isLinux, isWin } from '@common/utils' import { getProxy, openDevTools as handleOpenDevTools } from '@main/utils' import { mainSend } from '@commo...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/autoUpdate.ts
src/main/modules/winMain/autoUpdate.ts
import { autoUpdater } from 'electron-updater' import { log, isWin } from '@common/utils' import { mainOn } from '@common/mainIpc' import { isExistWindow, sendEvent } from './index' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' autoUpdater.logger = log autoUpdater.autoDownload = false // autoUpdater....
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/index.ts
src/main/modules/winMain/index.ts
import initRendererEvent, { handleKeyDown, hotKeyConfigUpdate } from './rendererEvent' import { APP_EVENT_NAMES } from '@common/constants' import { createWindow, minimize, setProgressBar, setProxy, setThumbarButtons, toggleHide, toggleMinimize } from './main' import initUpdate from './autoUpdate' import { HOTKEY_COMMO...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/hotKey.ts
src/main/modules/winMain/rendererEvent/hotKey.ts
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainHandle } from '@common/mainIpc' import { sendEvent } from '../main' // import getStore from '@common/store' // const { registerHotkey, unRegisterHotkey } = require('../modules/hotKey/utils') // mainHandle(ipcMainWindowNames.set_hot_key_conf...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/download.ts
src/main/modules/winMain/rendererEvent/download.ts
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainHandle } from '@common/mainIpc' export default () => { mainHandle<LX.Download.ListItem[]>(WIN_MAIN_RENDERER_EVENT_NAME.download_list_get, async() => { return global.lx.worker.dbService.getDownloadList() }) mainHandle<LX.Download.sa...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/process.ts
src/main/modules/winMain/rendererEvent/process.ts
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { getWebContents } from '../main' // export default () => { // } /** * 发送桌面歌词进程创建事件 * @param port 端口 */ export const sendNewDesktopLyricClient = (port: Electron.MessagePortMain) => { getWebContents().postMessage(WIN_MAIN_RENDERER_EVENT_NAM...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/music.ts
src/main/modules/winMain/rendererEvent/music.ts
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainHandle } from '@common/mainIpc' export default () => { // =========================歌词========================= mainHandle<string, LX.Player.LyricInfo>(WIN_MAIN_RENDERER_EVENT_NAME.get_palyer_lyric, async({ params: id }) => { // retur...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/sync.ts
src/main/modules/winMain/rendererEvent/sync.ts
import { mainHandle } from '@common/mainIpc' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { startServer, stopServer, getServerStatus, generateCode, connectServer, disconnectServer, getClientStatus, getServerDevices, removeServerDevice, } from '@main/modules/sync' import { sen...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/tx_decodeLyric.ts
src/main/modules/winMain/rendererEvent/tx_decodeLyric.ts
import { createInflate, constants as zlibConstants } from 'node:zlib' // import path from 'path' import { mainHandle } from '@common/mainIpc' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' // eslint-disable-next-line @typescript-eslint/dot-notation, @typescript-eslint/quotes // const require = module[...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/soundEffect.ts
src/main/modules/winMain/rendererEvent/soundEffect.ts
import { STORE_NAMES } from '@common/constants' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainOn, mainHandle } from '@common/mainIpc' import getStore from '@main/utils/store' export default () => { mainHandle<LX.SoundEffect.EQPreset[]>(WIN_MAIN_RENDERER_EVENT_NAME.get_sound_effect_eq_p...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/app.ts
src/main/modules/winMain/rendererEvent/app.ts
// const path = require('path') import { app } from 'electron' import { mainHandle, mainOn } from '@common/mainIpc' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' // import { name as defaultName } from '../../../../../package.json' import { minimize, maximize, closeWindow, showWindow, setFull...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/openAPI.ts
src/main/modules/winMain/rendererEvent/openAPI.ts
import { mainHandle } from '@common/mainIpc' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { startServer, stopServer, getStatus, } from '@main/modules/openApi' export default () => { mainHandle<LX.OpenAPI.Actions, any>(WIN_MAIN_RENDERER_EVENT_NAME.open_api_action, async({ params: data...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/kw_decodeLyric.ts
src/main/modules/winMain/rendererEvent/kw_decodeLyric.ts
import { inflate } from 'zlib' import iconv from 'iconv-lite' import { mainHandle } from '@common/mainIpc' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' const handleInflate = async(data: Buffer) => { return new Promise((resolve: (result: Buffer) => void, reject) => { inflate(data, (err, result)...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/data.ts
src/main/modules/winMain/rendererEvent/data.ts
import { STORE_NAMES } from '@common/constants' import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainOn, mainHandle } from '@common/mainIpc' import getStore from '@main/utils/store' export default () => { mainHandle<string, any>(WIN_MAIN_RENDERER_EVENT_NAME.get_data, ({ params: path }) => { ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/index.ts
src/main/modules/winMain/rendererEvent/index.ts
import { registerRendererEvents as common } from '@main/modules/commonRenderers/common' import { registerRendererEvents as list } from '@main/modules/commonRenderers/list' import { registerRendererEvents as dislike } from '@main/modules/commonRenderers/dislike' import app, { sendConfigChange } from './app' import hotKe...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/winMain/rendererEvent/userApi.ts
src/main/modules/winMain/rendererEvent/userApi.ts
import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainHandle } from '@common/mainIpc' import { getApiList, importApi, removeApi, setApi, getStatus, request, cancelRequest, setAllowShowUpdateAlert, } from '@main/modules/userApi' import { sendEvent } from '@main/modules/winMain/main...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/hotKey/utils.ts
src/main/modules/hotKey/utils.ts
import { globalShortcut } from 'electron' import { log } from '@common/utils' export const handleKeyDown = (key: string) => { if (!global.lx.hotKey.enable) return global.lx.event_app.hot_key_down({ type: 'global', key }) } const transformedKeyRxp = /(^|\+)[a-z]/g export const transformedKey = (key: string): stri...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/hotKey/rendererEvent.ts
src/main/modules/hotKey/rendererEvent.ts
import { HOTKEY_RENDERER_EVENT_NAME } from '@common/ipcNames' import { mainHandle } from '@common/mainIpc' import { init, registerHotkey, unRegisterHotkey, unRegisterHotkeyAll } from './utils' export default () => { mainHandle<LX.HotKeyActions, boolean>(HOTKEY_RENDERER_EVENT_NAME.set_config, async({ params }) => { ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/hotKey/index.ts
src/main/modules/hotKey/index.ts
import { app } from 'electron' import { unRegisterHotkeyAll } from './utils' import init from './rendererEvent' export default () => { app.on('will-quit', unRegisterHotkeyAll) init() }
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/index.ts
src/main/modules/commonRenderers/index.ts
import common from './common' import list from './list' import dislike from './dislike' export default () => { common() list() dislike() }
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/list/rendererEvent.ts
src/main/modules/commonRenderers/list/rendererEvent.ts
import { mainHandle } from '@common/mainIpc' import { PLAYER_EVENT_NAME } from '@common/ipcNames' // 列表操作事件(公共,只注册一次) export default () => { mainHandle<LX.List.UserListInfo[]>(PLAYER_EVENT_NAME.list_get, async() => { return global.lx.worker.dbService.getAllUserList() }) mainHandle<LX.List.ListActionDataOverw...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/list/winRendererEvent.ts
src/main/modules/commonRenderers/list/winRendererEvent.ts
import { PLAYER_EVENT_NAME } from '@common/ipcNames' // 发送列表操作事件到渲染进程的注册方法 // 哪个渲染进程需要接收则引入此方法注册 export const registerRendererEvents = (sendEvent: <T = any>(name: string, params?: T | undefined) => void) => { const list_data_overwrite = async(listData: LX.List.ListActionDataOverwrite) => { sendEvent<LX.List.List...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/list/index.ts
src/main/modules/commonRenderers/list/index.ts
export { registerRendererEvents } from './winRendererEvent' export { default } from './rendererEvent'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/dislike/rendererEvent.ts
src/main/modules/commonRenderers/dislike/rendererEvent.ts
import { mainHandle } from '@common/mainIpc' import { DISLIKE_EVENT_NAME } from '@common/ipcNames' // 列表操作事件(公共,只注册一次) export default () => { mainHandle<LX.Dislike.DislikeInfo>(DISLIKE_EVENT_NAME.get_dislike_music_infos, async() => { return global.lx.worker.dbService.getDislikeListInfo() }) mainHandle<LX.Dis...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/dislike/winRendererEvent.ts
src/main/modules/commonRenderers/dislike/winRendererEvent.ts
import { DISLIKE_EVENT_NAME } from '@common/ipcNames' // 发送列表操作事件到渲染进程的注册方法 // 哪个渲染进程需要接收则引入此方法注册 export const registerRendererEvents = (sendEvent: <T = any>(name: string, params?: T | undefined) => void) => { const dislike_music_add = async(listData: LX.Dislike.DislikeMusicInfo[]) => { sendEvent<LX.Dislike.Disl...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/dislike/index.ts
src/main/modules/commonRenderers/dislike/index.ts
export { registerRendererEvents } from './winRendererEvent' export { default } from './rendererEvent'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/common/rendererEvent.ts
src/main/modules/commonRenderers/common/rendererEvent.ts
import { mainHandle, mainOn } from '@common/mainIpc' import { CMMON_EVENT_NAME } from '@common/ipcNames' import { getFonts } from '@main/utils/fontManage' // 公共操作事件(公共,只注册一次) export default () => { mainHandle<LX.AppSetting>(CMMON_EVENT_NAME.get_app_setting, async() => { return global.lx.appSetting }) mainHan...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/common/winRendererEvent.ts
src/main/modules/commonRenderers/common/winRendererEvent.ts
import { CMMON_EVENT_NAME } from '@common/ipcNames' // 发送列表操作事件到渲染进程的注册方法 // 哪个渲染进程需要接收则引入此方法注册 export const registerRendererEvents = (sendEvent: <T = any>(name: string, params?: T | undefined) => void) => { const sendDeeplink = (link: string) => { sendEvent(CMMON_EVENT_NAME.deeplink, link) } const sendSyste...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/commonRenderers/common/index.ts
src/main/modules/commonRenderers/common/index.ts
export { registerRendererEvents } from './winRendererEvent' export { default } from './rendererEvent'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/openApi/index.ts
src/main/modules/openApi/index.ts
import http from 'node:http' import querystring from 'node:querystring' import type { Socket } from 'node:net' import { getAddress } from '@common/utils/nodejs' import { sendTaskbarButtonClick } from '@main/modules/winMain' const sendResponse = (res: http.ServerResponse, code = 200, msg: string | Record<any, unknown> ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/userApi/utils.ts
src/main/modules/userApi/utils.ts
import { userApis as defaultUserApis } from './config' import { STORE_NAMES } from '@common/constants' import getStore from '@main/utils/store' import zlib from 'node:zlib' let userApis: LX.UserApi.UserApiInfo[] | null let scripts = new Map<string, string>() const saveData = () => { getStore(STORE_NAMES.USER_API).s...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/userApi/main.ts
src/main/modules/userApi/main.ts
import { mainSend } from '@common/mainIpc' import { BrowserWindow } from 'electron' import fs from 'fs' import path from 'node:path' import { openDevTools as handleOpenDevTools } from '@main/utils' import USER_API_RENDERER_EVENT_NAME from './rendererEvent/name' import { getScript } from './utils' let browserWindow: El...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/userApi/index.ts
src/main/modules/userApi/index.ts
import { closeWindow } from './main' import { getUserApis, importApi as handleImportApi, removeApi as handleRemoveApi, setAllowShowUpdateAlert as saveAllowShowUpdateAlert } from './utils' import { loadApi, setAllowShowUpdateAlert as setRendererEventAllowShowUpdateAlert, init } from './rendererEvent/rendererEvent' let ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/userApi/rendererEvent/rendererEvent.ts
src/main/modules/userApi/rendererEvent/rendererEvent.ts
import { mainOn } from '@common/mainIpc' import USER_API_RENDERER_EVENT_NAME from './name' import { createWindow, getProxy, openDevTools, sendEvent } from '../main' import { getUserApis } from '../utils' import { sendShowUpdateAlert, sendStatusChange } from '@main/modules/winMain' let userApi: LX.UserApi.UserApiInfo ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/userApi/config/index.ts
src/main/modules/userApi/config/index.ts
export const userApis: LX.UserApi.UserApiInfoFull[] = []
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/dislikeEvent.ts
src/main/modules/sync/dislikeEvent.ts
export const getLocalDislikeData = async(): Promise<LX.Dislike.DislikeRules> => { return (await global.lx.worker.dbService.getDislikeListInfo()).rules } export const setLocalDislikeData = async(listData: LX.Dislike.DislikeRules) => { await global.lx.event_dislike.dislike_data_overwrite(listData, true) } export c...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/utils.ts
src/main/modules/sync/utils.ts
import { createCipheriv, createDecipheriv, publicEncrypt, privateDecrypt, constants } from 'node:crypto' import os from 'node:os' import fs from 'node:fs' import zlib from 'node:zlib' import cp from 'node:child_process' // https://stackoverflow.com/a/75309339 export const getComputerName = () => { let name: string ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/log.ts
src/main/modules/sync/log.ts
import { log as writeLog } from '@common/utils' export default { r_info(...params: any[]) { writeLog.info(...params) }, r_warn(...params: any[]) { writeLog.warn(...params) }, r_error(...params: any[]) { writeLog.error(...params) }, info(...params: any[]) { // if (global.lx.isEnableSyncLog...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/migrate.ts
src/main/modules/sync/migrate.ts
import { File } from '../../../common/constants_sync' import fs from 'node:fs' import path from 'node:path' import { exists } from './utils' interface ServerKeyInfo { clientId: string key: string deviceName: string lastSyncDate?: number snapshotKey?: string lastConnectDate?: number isMobile: boolean } ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/listEvent.ts
src/main/modules/sync/listEvent.ts
import { LIST_IDS } from '@common/constants' // 构建列表信息对象,用于统一字段位置顺序 export const buildUserListInfoFull = ({ id, name, source, sourceListId, list, locationUpdateTime }: LX.List.UserListInfoFull) => { return { id, name, source, sourceListId, locationUpdateTime, list, } } export const getLoca...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/index.ts
src/main/modules/sync/index.ts
// import Event from './event/event' import { disconnectServer } from './client' import { stopServer } from './server' // import eventNames from './event/name' export { startServer, stopServer, getStatus as getServerStatus, generateCode, getDevices as getServerDevices, removeDevice as removeServerDevice, ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/index.ts
src/main/modules/sync/server/index.ts
export { startServer, stopServer, getStatus, generateCode, getDevices, removeDevice, } from './server'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/user/data.ts
src/main/modules/sync/server/user/data.ts
import fs from 'node:fs' import path from 'node:path' import { randomBytes } from 'node:crypto' import { throttle } from '@common/utils/common' import { filterFileName, toMD5 } from '../utils' import { File } from '@common/constants_sync' import { exists } from '../../utils' interface ServerInfo { serverId: string ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/user/index.ts
src/main/modules/sync/server/user/index.ts
import { UserDataManage } from './data' import { ListManage, DislikeManage, } from '../modules' export interface UserSpace { dataManage: UserDataManage listManage: ListManage dislikeManage: DislikeManage getDecices: () => Promise<LX.Sync.ServerKeyInfo[]> removeDevice: (clientId: string) => Promise<void> ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/utils/tools.ts
src/main/modules/sync/server/utils/tools.ts
import { createCipheriv, createDecipheriv, publicEncrypt, privateDecrypt, constants } from 'node:crypto' // import { join } from 'node:path' import zlib from 'node:zlib' import type http from 'node:http' // import getStore from '@/utils/store' // import syncLog from '../../log' // import { getUserName } from '../user/d...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/utils/index.ts
src/main/modules/sync/server/utils/index.ts
import fs from 'node:fs' import crypto from 'node:crypto' export const createDirSync = (path: string) => { if (!fs.existsSync(path)) { try { fs.mkdirSync(path, { recursive: true }) } catch (e: any) { if (e.code !== 'EEXIST') { console.error('Could not set up log directory, error was: ', ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/index.ts
src/main/modules/sync/server/modules/index.ts
import { sync as listSync } from './list' import { sync as dislikeSync } from './dislike' export const callObj = Object.assign({}, listSync.handler, dislikeSync.handler, ) export const modules = { list: listSync, dislike: dislikeSync, } export { ListManage } from './list' export { DislikeManage } from './d...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/snapshotDataManage.ts
src/main/modules/sync/server/modules/list/snapshotDataManage.ts
import { throttle } from '@common/utils/common' import fs from 'node:fs' import path from 'node:path' import syncLog from '../../../log' import { getUserConfig, type UserDataManage } from '../../user/data' import { File } from '../../../../../../common/constants_sync' import { checkAndCreateDirSync } from '../../utils'...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/manage.ts
src/main/modules/sync/server/modules/list/manage.ts
import { type UserDataManage } from '../../user' import { SnapshotDataManage } from './snapshotDataManage' import { toMD5 } from '../../utils' import { getLocalListData } from '@main/modules/sync/listEvent' export class ListManage { snapshotDataManage: SnapshotDataManage constructor(userDataManage: UserDataManage...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/index.ts
src/main/modules/sync/server/modules/list/index.ts
export * as sync from './sync' export { ListManage } from './manage'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/sync/sync.ts
src/main/modules/sync/server/modules/list/sync/sync.ts
// import { SYNC_CLOSE_CODE } from '../../../../constants' import { removeSelectModeListener, sendCloseSelectMode, sendSelectMode } from '@main/modules/winMain' import { getUserSpace, getUserConfig } from '../../../user' import { buildUserListInfoFull, getLocalListData, setLocalListData } from '@main/modules/sync/listE...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/sync/localEvent.ts
src/main/modules/sync/server/modules/list/sync/localEvent.ts
import { SYNC_CLOSE_CODE } from '@common/constants_sync' import { registerListActionEvent } from '../../../../listEvent' import { getUserSpace } from '../../../user' // let socket: LX.Sync.Server.Socket | null let unregisterLocalListAction: (() => void) | null const sendListAction = async(wss: LX.Sync.Server.SocketS...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/sync/handler.ts
src/main/modules/sync/server/modules/list/sync/handler.ts
// 这个文件导出的方法将暴露给客户端调用,第一个参数固定为当前 socket 对象 // import { throttle } from '@common/utils/common' // import { sendSyncActionList } from '@main/modules/winMain' // import { SYNC_CLOSE_CODE } from '@/constants' // import { SYNC_CLOSE_CODE } from '@common/constants_sync' import { SYNC_CLOSE_CODE } from '@common/constants_sync...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/list/sync/index.ts
src/main/modules/sync/server/modules/list/sync/index.ts
export { default as handler } from './handler' export { sync } from './sync' export * from './localEvent'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/utils.ts
src/main/modules/sync/server/modules/dislike/utils.ts
import { SPLIT_CHAR } from '@common/constants' export const filterRules = (rules: string) => { const list: string[] = [] for (const item of rules.split('\n')) { if (!item) continue let [name, singer] = item.split(SPLIT_CHAR.DISLIKE_NAME) if (name) { name = name.replaceAll(SPLIT_CHAR.DISLIKE_NAME...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/snapshotDataManage.ts
src/main/modules/sync/server/modules/dislike/snapshotDataManage.ts
import { throttle } from '@common/utils/common' import fs from 'node:fs' import path from 'node:path' import syncLog from '../../../log' import { getUserConfig, type UserDataManage } from '../../user/data' import { File } from '../../../../../../common/constants_sync' import { checkAndCreateDirSync } from '../../utils'...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/manage.ts
src/main/modules/sync/server/modules/dislike/manage.ts
import { type UserDataManage } from '../../user' import { SnapshotDataManage } from './snapshotDataManage' import { toMD5 } from '../../utils' import { getLocalDislikeData } from '@main/modules/sync/dislikeEvent' export class DislikeManage { snapshotDataManage: SnapshotDataManage constructor(userDataManage: UserD...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/index.ts
src/main/modules/sync/server/modules/dislike/index.ts
export * as sync from './sync' export { DislikeManage } from './manage'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/sync/sync.ts
src/main/modules/sync/server/modules/dislike/sync/sync.ts
// import { SYNC_CLOSE_CODE } from '../../../../constants' import { removeSelectModeListener, sendCloseSelectMode, sendSelectMode } from '@main/modules/winMain' import { getUserSpace } from '../../../user' import { getLocalDislikeData, setLocalDislikeData } from '@main/modules/sync/dislikeEvent' import { SYNC_CLOSE_COD...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/sync/localEvent.ts
src/main/modules/sync/server/modules/dislike/sync/localEvent.ts
import { SYNC_CLOSE_CODE } from '@common/constants_sync' import { registerDislikeActionEvent } from '../../../../dislikeEvent' import { getUserSpace } from '../../../user' // let socket: LX.Sync.Server.Socket | null let unregisterLocalListAction: (() => void) | null const sendListAction = async(wss: LX.Sync.Server.S...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/sync/handler.ts
src/main/modules/sync/server/modules/dislike/sync/handler.ts
// 这个文件导出的方法将暴露给客户端调用,第一个参数固定为当前 socket 对象 // import { throttle } from '@common/utils/common' // import { sendSyncActionList } from '@main/modules/winMain' // import { SYNC_CLOSE_CODE } from '@/constants' // import { SYNC_CLOSE_CODE } from '@common/constants_sync' import { SYNC_CLOSE_CODE } from '@common/constants_sync...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/modules/dislike/sync/index.ts
src/main/modules/sync/server/modules/dislike/sync/index.ts
export { default as handler } from './handler' export { sync } from './sync' export * from './localEvent'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/server.ts
src/main/modules/sync/server/server/server.ts
import http, { type IncomingMessage } from 'node:http' import { WebSocketServer } from 'ws' import { registerLocalSyncEvent, callObj, sync, unregisterLocalSyncEvent } from './sync' import { authCode, authConnect } from './auth' import { SYNC_CLOSE_CODE, SYNC_CODE } from '@common/constants_sync' import { getUserSpace, r...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/auth.ts
src/main/modules/sync/server/server/auth.ts
import type http from 'http' import { aesEncrypt, aesDecrypt, rsaEncrypt, getIP, } from '../utils/tools' import querystring from 'node:querystring' import { getUserSpace, createClientKeyInfo } from '../user' import { toMD5 } from '../utils' import { getComputerName } from '../../utils' import { SYNC_CODE } from...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/index.ts
src/main/modules/sync/server/server/index.ts
export { startServer, stopServer, getStatus, generateCode, getDevices, removeDevice, } from './server'
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/sync/sync.ts
src/main/modules/sync/server/server/sync/sync.ts
import { FeaturesList } from '../../../../../../common/constants_sync' import { featureVersion, modules } from '../../modules' export const sync = async(socket: LX.Sync.Server.Socket) => { let disconnected = false socket.onClose(() => { disconnected = true }) const enabledFeatures = await socket.remote.ge...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/sync/handler.ts
src/main/modules/sync/server/server/sync/handler.ts
// 这个文件导出的方法将暴露给客户端调用,第一个参数固定为当前 socket 对象 // import { getUserSpace } from '@/user' import { FeaturesList } from '../../../../../../common/constants_sync' import { modules } from '../../modules' const handler: LX.Sync.ServerSyncHandlerActions<LX.Sync.Server.Socket> = { async onFeatureChanged(socket, feature) { /...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/sync/event.ts
src/main/modules/sync/server/server/sync/event.ts
import { modules } from '../../modules' export const registerLocalSyncEvent = async(wss: LX.Sync.Server.SocketServer) => { unregisterLocalSyncEvent() for (const module of Object.values(modules)) { module.registerEvent(wss) } } export const unregisterLocalSyncEvent = () => { for (const module of Object.val...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/server/server/sync/index.ts
src/main/modules/sync/server/server/sync/index.ts
import handler from './handler' import { callObj as _callObj } from '../../modules' export { sync } from './sync' export { modules } from '../../modules' export * from './event' export const callObj = { ...handler, ..._callObj, }
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/client/client.ts
src/main/modules/sync/client/client.ts
import WebSocket from 'ws' import { encryptMsg, decryptMsg } from './utils' import { callObj } from './sync' // import { action as commonAction } from '@root/store/modules/common' // import { getStore } from '@root/store' // import registerSyncListHandler from './syncList' import log from '../log' import { dateFormat }...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/client/utils.ts
src/main/modules/sync/client/utils.ts
import { generateKeyPair } from 'node:crypto' import { httpFetch, type RequestOptions } from '@main/utils/request' import { decodeData, encodeData } from '../utils' export const request = async(url: string, options: RequestOptions = { }) => { return httpFetch(url, { ...options, timeout: options.timeout ?? 10...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/client/auth.ts
src/main/modules/sync/client/auth.ts
import { request, generateRsaKey } from './utils' import { getSyncAuthKey, setSyncAuthKey } from './data' import log from '../log' import { aesDecrypt, aesEncrypt, getComputerName, rsaDecrypt } from '../utils' import { toMD5 } from '@common/utils/nodejs' import { SYNC_CODE } from '@common/constants_sync' const hello ...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/client/data.ts
src/main/modules/sync/client/data.ts
import fs from 'node:fs' import path from 'node:path' import { File } from '../../../../common/constants_sync' import { exists } from '../utils' let syncAuthKeys: Record<string, LX.Sync.ClientKeyInfo> const saveSyncAuthKeys = async() => { const syncAuthKeysFilePath = path.join(global.lxDataPath, File.clientDataPa...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/client/index.ts
src/main/modules/sync/client/index.ts
import handleAuth from './auth' import { connect as socketConnect, disconnect as socketDisconnect, sendSyncStatus, sendSyncMessage } from './client' // import { getSyncHost } from '@root/utils/data' import log from '../log' import { parseUrl } from './utils' import migrateData from '../migrate' import { SYNC_CODE } fro...
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false
lyswhut/lx-music-desktop
https://github.com/lyswhut/lx-music-desktop/blob/8686ecfa54452562ef2ee74697f8e8a22c9788fa/src/main/modules/sync/client/modules/index.ts
src/main/modules/sync/client/modules/index.ts
import * as list from './list' import * as dislike from './dislike' // export * as theme from './theme' export const callObj = Object.assign({}, list.handler, dislike.handler, ) export const modules = { list, dislike, } export const featureVersion = { list: 1, dislike: 1, } as const
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false