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/renderer/core/useApp/compositions/usePlaySonglist.ts
src/renderer/core/useApp/compositions/usePlaySonglist.ts
import { playList } from '@renderer/core/player' import { setTempList } from '@renderer/store/list/action' import { tempList, tempListMeta } from '@renderer/store/list/state' import { getListDetail, getListDetailAll } from '@renderer/store/songList/action' const getListPlayIndex = (list: LX.Music.MusicInfoOnline[], in...
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/renderer/core/player/timeoutStop.ts
src/renderer/core/player/timeoutStop.ts
import { ref, computed, type ComputedRef } from '@common/utils/vueTools' import { isPlay } from '@renderer/store/player/state' import { appSetting } from '@renderer/store/setting' // import { interval, intervalCancel } from '@renderer/utils/ipc' import { pause } from './action' const time = ref(-1) const timeoutTool...
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/renderer/core/player/utils.ts
src/renderer/core/player/utils.ts
import { toRaw, markRawList } from '@common/utils/vueTools' // import { qualityList } from '@renderer/store' import { clearPlayedList } from '@renderer/store/player/action' import { appSetting } from '@renderer/store/setting' import { dislikeInfo } from '@renderer/store/dislikeList' import { setPowerSaveBlocker as setP...
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/renderer/core/player/action.ts
src/renderer/core/player/action.ts
import { isEmpty, setPause, setPlay, setResource, setStop } from '@renderer/plugins/player' import { isPlay, playedList, playInfo, playMusicInfo, tempPlayList, musicInfo as _musicInfo } from '@renderer/store/player/state' import { getList, clearPlayedList, clearTempPlayeList, setPlayMusicInfo, addPlayedList, ...
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/renderer/core/player/index.ts
src/renderer/core/player/index.ts
export * from './action' export * from './timeoutStop'
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/lang/i18n.ts
src/lang/i18n.ts
import { type App, ref } from 'vue' import { messages } from './index' import type { Messages, Message } from './index' type TranslateValues = Record<string, string | number | boolean> type Langs = keyof Messages export declare interface I18n { locale: Langs fallbackLocale: Langs availableLocales: Langs[] me...
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/lang/index.ts
src/lang/index.ts
import zh_cn from './zh-cn.json' import zh_tw from './zh-tw.json' import en_us from './en-us.json' type Message = Record<keyof typeof zh_cn, string> | Record<keyof typeof zh_tw, string> | Record<keyof typeof en_us, string> type Messages = Record<(typeof langs)[number]['locale'], Message> const langs = [ { 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/common/hotKey.ts
src/common/hotKey.ts
import { APP_EVENT_NAMES } from './constants' const keyName = { common: APP_EVENT_NAMES.winMainName, player: APP_EVENT_NAMES.winMainName, desktop_lyric: APP_EVENT_NAMES.winLyricName, } const hotKey = { common: { min: { name: 'min', action: 'min', type: '', }, min_toggle: { ...
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/common/config.ts
src/common/config.ts
export interface WindowSize { id: number name: string width: number height: number } export const windowSizeList: WindowSize[] = [ { id: 0, name: 'smaller', width: 828, height: 540, }, { id: 1, name: 'small', width: 920, height: 600, }, { id: 2, name: 'medium',...
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/common/ipcNames.ts
src/common/ipcNames.ts
const modules = { common: { get_env_params: 'get_env_params', deeplink: 'deeplink', clear_env_params_deeplink: 'clear_env_params_deeplink', system_theme_change: 'system_theme_change', theme_change: 'theme_change', get_system_fonts: 'get_system_fonts', get_app_setting: 'get_app_setting', ...
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/common/defaultSetting.ts
src/common/defaultSetting.ts
import path from 'node:path' import os from 'node:os' const isMac = process.platform == 'darwin' const isWin = process.platform == 'win32' const defaultSetting: LX.AppSetting = { version: '2.1.0', 'common.windowSizeId': 3, 'common.fontSize': 16, 'common.startInFullscreen': false, 'common.langId': null, '...
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/common/mainIpc.ts
src/common/mainIpc.ts
import { ipcMain } from 'electron' export function mainOn(name: string, listener: LX.IpcMainEventListener): void export function mainOn<T>(name: string, listener: LX.IpcMainEventListenerParams<T>): void export function mainOn<T>(name: string, listener: LX.IpcMainEventListenerParams<T>): void { ipcMain.on(name, (even...
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/common/rendererIpc.ts
src/common/rendererIpc.ts
import { ipcRenderer } from 'electron' export function rendererSend(name: string): void export function rendererSend<T>(name: string, params: T): void export function rendererSend<T>(name: string, params?: T): void { ipcRenderer.send(name, params) } export function rendererSendSync(name: string): void export functi...
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/common/constants.ts
src/common/constants.ts
export const URL_SCHEME_RXP = /^lxmusic:\/\// export const SPLIT_CHAR = { DISLIKE_NAME: '@', DISLIKE_NAME_ALIAS: '#', } as const export const STORE_NAMES = { APP_SETTINGS: 'config_v2', DATA: 'data', SYNC: 'sync', HOTKEY: 'hot_key', USER_API: 'user_api', LRC_RAW: 'lyrics', LRC_EDITED: 'lyrics_edited'...
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/common/constants_sync.ts
src/common/constants_sync.ts
export const ENV_PARAMS = [ 'PORT', 'BIND_IP', 'CONFIG_PATH', 'LOG_PATH', 'DATA_PATH', 'PROXY_HEADER', 'MAX_SNAPSHOT_NUM', 'LIST_ADD_MUSIC_LOCATION_TYPE', 'LX_USER_', ] as const export const LIST_IDS = { DEFAULT: 'default', LOVE: 'love', TEMP: 'temp', DOWNLOAD: 'download', PLAY_LATER: null...
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/common/error.ts
src/common/error.ts
import { log } from './utils' const ignoreErrorMessage = [ 'Possible side-effect in debug-evaluate', 'Unexpected end of input', ] process.on('uncaughtException', err => { if (ignoreErrorMessage.includes(err?.message)) return console.error('An uncaught error occurred!') console.error(err) log.error(err) })...
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/common/defaultHotKey.ts
src/common/defaultHotKey.ts
import { HOTKEY_PLAYER, HOTKEY_COMMON, HOTKEY_DESKTOP_LYRIC } from './hotKey' const local: LX.HotKeyConfig = { enable: true, keys: { 'mod+f5': { type: HOTKEY_PLAYER.toggle_play.type, name: HOTKEY_PLAYER.toggle_play.name, action: HOTKEY_PLAYER.toggle_play.action, }, 'mod+arrowleft': { ...
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/common/utils/nodejs.ts
src/common/utils/nodejs.ts
import fs from 'node:fs' import crypto from 'node:crypto' import { gzip, gunzip } from 'node:zlib' import path from 'node:path' import { networkInterfaces } from 'node:os' import { log } from '@common/utils' export const joinPath = (...paths: string[]): string => path.join(...paths) export const extname = (p: 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/common/utils/migrateSetting.ts
src/common/utils/migrateSetting.ts
import { compareVer } from './index' const oldThemeMap = { 0: 'green', 1: 'blue', 2: 'yellow', 3: 'orange', 4: 'red', 10: 'pink', 5: 'purple', 6: 'grey', 11: 'ming', 12: 'blue2', 13: 'black', 7: 'mid_autumn', 8: 'naruto', 9: 'happy_new_year', } as const export default (setting: any): Parti...
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/common/utils/renderer.ts
src/common/utils/renderer.ts
const easeInOutQuad = (t: number, b: number, c: number, d: number): number => { t /= d / 2 if (t < 1) return (c / 2) * t * t + b t-- return (-c / 2) * (t * (t - 2) - 1) + b } type Noop = () => void const noop: Noop = () => {} type ScrollElement<T> = { lx_scrollLockKey?: number lx_scrollNextParams?: [Scrol...
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/common/utils/vueRouter.ts
src/common/utils/vueRouter.ts
export { useRouter, useRoute, onBeforeRouteUpdate, onBeforeRouteLeave } from 'vue-router'
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/common/utils/tools.ts
src/common/utils/tools.ts
// 业务工具方法 export const toNewMusicInfo = (oldMusicInfo: any): LX.Music.MusicInfo => { const meta: Record<string, any> = { songId: oldMusicInfo.songmid, // 歌曲ID,local为文件路径 albumName: oldMusicInfo.albumName, // 歌曲专辑名称 picUrl: oldMusicInfo.img, // 歌曲图片链接 } const newInfo = { id: `${oldMusicInfo.source...
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/common/utils/common.ts
src/common/utils/common.ts
// 非业务工具方法 /** * 获取两个数之间的随机整数,大于等于min,小于max * @param {*} min * @param {*} max */ export const getRandom = (min: number, max: number): number => Math.floor(Math.random() * (max - min)) + min export const sizeFormate = (size: number): string => { // https://gist.github.com/thomseddon/3511330 if (!size) return ...
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/common/utils/electron.ts
src/common/utils/electron.ts
import { shell, clipboard } from 'electron' /** * 在资源管理器中打开目录 * @param {string} dir */ export const openDirInExplorer = (dir: string) => { shell.showItemInFolder(dir) } /** * 在浏览器打开URL * @param {*} url */ export const openUrl = async(url: string) => { if (!/^https?:\/\//.test(url)) return await shell.op...
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/common/utils/index.ts
src/common/utils/index.ts
import log from 'electron-log/node' export const isLinux = process.platform == 'linux' export const isWin = process.platform == 'win32' export const isMac = process.platform == 'darwin' export const isProd = process.env.NODE_ENV == 'production' export const getPlatform = (platform: NodeJS.Platform = process.platform...
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/common/utils/vueTools.ts
src/common/utils/vueTools.ts
import { ref, reactive, computed, watch, watchEffect, nextTick, onMounted, onBeforeUnmount, toRaw, useCssModule, toRef, toRefs, shallowRef, unref, markRaw, type ComputedRef, type Ref, type ShallowRef, shallowReactive, withDefaults, } from 'vue' // import { useStore } from 'vuex' ...
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/common/utils/musicMeta/index.d.ts
src/common/utils/musicMeta/index.d.ts
export interface MusicMeta { title: string artist: string | null album: string | null APIC: string | null lyrics: string | null } export function setMeta(filePath: string, meta: MusicMeta, proxy?: { host: string, port: number }): 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/common/utils/lyricUtils/util.ts
src/common/utils/lyricUtils/util.ts
const encodeNames = { '&nbsp;': ' ', '&amp;': '&', '&lt;': '<', '&gt;': '>', '&quot;': '"', '&apos;': "'", '&#039;': "'", } as const export const decodeName = (str: string | null = '') => { return str?.replace(/(?:&amp;|&lt;|&gt;|&quot;|&apos;|&#039;|&nbsp;)/gm, (s: string) => encodeNames[s as keyof ty...
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/common/utils/download/Downloader.ts
src/common/utils/download/Downloader.ts
import fs from 'fs' import path from 'path' import { EventEmitter } from 'events' import { performance } from 'perf_hooks' import { STATUS } from './util' import type http from 'http' import { request, type Options as RequestOptions } from './request' export interface Options { forceResume: boolean timeout: number...
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/common/utils/download/util.ts
src/common/utils/download/util.ts
import { httpOverHttp, httpsOverHttp } from 'tunnel' export const STATUS = { idle: 'IDLE', init: 'INIT', running: 'RUNNING', paused: 'PAUSED', stopped: 'STOPPED', completed: 'COMPLETED', error: 'ERROR', failed: 'FAILED', } as const const httpsRxp = /^https:/ export const getRequestAgent = (url: 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/common/utils/download/index.ts
src/common/utils/download/index.ts
import Downloader, { type Options as DownloaderOptions } from './Downloader' import { getRequestAgent } from './util' import { sizeFormate } from '@common/utils' import type http from 'http' // these are the default options // const options = { // method: 'GET', // Request Method Verb // // Custom HTTP Header ex: ...
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/common/utils/download/request.ts
src/common/utils/download/request.ts
import { URL } from 'url' import http from 'http' import https from 'https' export interface Options { method: 'get' | 'head' | 'delete' | 'patch' | 'post' | 'put' params?: Record<string, string> // body?: Record<string, string> headers?: Record<string, string> timeout?: number agent?: http.Agent } const ...
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/common/types/desktop_lyric.d.ts
src/common/types/desktop_lyric.d.ts
declare namespace LX { namespace DesktopLyric { interface Config { 'desktopLyric.enable': LX.AppSetting['desktopLyric.enable'] 'desktopLyric.isLock': LX.AppSetting['desktopLyric.isLock'] 'desktopLyric.isAlwaysOnTop': LX.AppSetting['desktopLyric.isAlwaysOnTop'] 'desktopLyric.isAlwaysOnTopLo...
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/common/types/dislike_list_sync.d.ts
src/common/types/dislike_list_sync.d.ts
declare namespace LX { namespace Sync { namespace Dislike { interface ListInfo { lastSyncDate?: number snapshotKey: string } interface SyncActionBase <A> { action: A } interface SyncActionData<A, D> extends SyncActionBase<A> { data: D } t...
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/common/types/download_list.d.ts
src/common/types/download_list.d.ts
import { type Message } from '@root/lang' // interface DownloadList { // } declare global { namespace LX { namespace Download { type DownloadTaskStatus = 'run' | 'waiting' | 'pause' | 'error' | 'completed' type FileExt = 'mp3' | 'flac' | 'wav' | 'ape' interface Prog...
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/common/types/user_api.d.ts
src/common/types/user_api.d.ts
declare namespace LX { namespace UserApi { type UserApiSourceInfoType = 'music' type UserApiSourceInfoActions = 'musicUrl' | 'lyric' | 'pic' interface UserApiSourceInfo { name: string type: UserApiSourceInfoType actions: UserApiSourceInfoActions[] qualitys: LX.Quality[] } ...
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/common/types/common.d.ts
src/common/types/common.d.ts
// import './app_setting' declare namespace LX { interface CmdParams { /** * 搜索,启动软件时自动在搜索框搜索指定的内容,例如:-search="突然的自我 - 伍佰" */ search?: string /** * 禁用硬件加速启动 */ dha?: boolean /** * 以非透明模式启动 */ dt?: boolean /** * 禁用硬件媒体密钥处理 */ dhmkh?: 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/common/types/ipc_main.d.ts
src/common/types/ipc_main.d.ts
declare namespace LX { interface IpcMainEvent { event: Electron.IpcMainEvent } interface IpcMainEventParams<T> { event: Electron.IpcMainEvent params: T } type IpcMainEventListener = (params: LX.IpcMainEvent) => void type IpcMainEventListenerParams<T> = (params: LX.IpcMainEventParams<T>) => 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/common/types/list_sync.d.ts
src/common/types/list_sync.d.ts
declare namespace LX { namespace Sync { namespace List { interface ListInfo { lastSyncDate?: number snapshotKey: string } type ActionList = LX.Sync.SyncAction<'list_data_overwrite', LX.List.ListActionDataOverwrite> | SyncAction<'list_create', LX.List.ListActionAdd> ...
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/common/types/music.d.ts
src/common/types/music.d.ts
declare namespace LX { namespace Music { interface MusicQualityType { // {"type": "128k", size: "3.56M"} type: LX.Quality size: string | null } interface MusicQualityTypeKg { // {"type": "128k", size: "3.56M"} type: LX.Quality size: string | null hash: string } type _...
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/common/types/app_setting.d.ts
src/common/types/app_setting.d.ts
import type { I18n } from '../../lang/i18n' declare global { declare namespace LX { type AddMusicLocationType = 'top' | 'bottom' interface AppSetting { version: string /** * 窗口大小id */ 'common.windowSizeId': number /** * 窗口大小id */ 'common.fontSize'...
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/common/types/utils.d.ts
src/common/types/utils.d.ts
type MakeOptional<Type, Key extends keyof Type> = Omit<Type, Key> & Partial<Pick<Type, Key>> type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]; } type Modify<T, R> = Omit<T, keyof R> & R // type UndefinedOrNever = undefined type Actions<T extends { action: string, data?: any }...
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/common/types/sync.d.ts
src/common/types/sync.d.ts
declare namespace LX { namespace Sync { interface EnableServer { enable: boolean port: string } interface EnableClient { enable: boolean host: string authCode?: string } interface SyncActionBase <A> { action: A } interface SyncActionData<A, D> extends ...
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/common/types/dislike_list.d.ts
src/common/types/dislike_list.d.ts
declare namespace LX { namespace Dislike { // interface ListItemMusicText { // id?: string // // type: 'music' // name: string | null // singer: string | null // } // interface ListItemMusic { // id?: number // type: 'musicId' // musicId: string // meta: L...
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/common/types/config_files.d.ts
src/common/types/config_files.d.ts
declare namespace LX { namespace ConfigFile { interface MyListInfoPart { type: 'playListPart_v2' data: LX.List.MyDefaultListInfoFull | LX.List.MyLoveListInfoFull | LX.List.UserListInfoFull } } }
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/common/types/list.d.ts
src/common/types/list.d.ts
declare namespace LX { namespace List { interface UserListInfo { id: string name: string // list: LX.Music.MusicInfo[] source?: LX.OnlineSource sourceListId?: string // position?: number locationUpdateTime: number | null } interface MyDefaultListInfo { id: ...
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/common/types/shims_vue.d.ts
src/common/types/shims_vue.d.ts
// declare module '*.vue' { // import { App } from 'vue' // export default App.Component // } declare module '*.vue' { import { type Component } from 'vue' const component: Component export default component }
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/common/types/ipc_renderer.d.ts
src/common/types/ipc_renderer.d.ts
declare namespace LX { interface IpcRendererEvent { event: Electron.IpcRendererEvent } interface IpcRendererEventParams<T> { event: Electron.IpcRendererEvent params: T } type IpcRendererEventListener = (params: LX.IpcRendererEvent) => any type IpcRendererEventListenerParams<T> = (params: LX.IpcR...
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/common/types/sound_effect.d.ts
src/common/types/sound_effect.d.ts
declare namespace LX { namespace SoundEffect { interface EQPreset { id: string name: string hz31: number hz62: number hz125: number hz250: number hz500: number hz1000: number hz2000: number hz4000: number hz8000: number hz16000: number } ...
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/common/types/music_metadata.d.ts
src/common/types/music_metadata.d.ts
import { type IAudioMetadata as iAudioMetadata, } from 'music-metadata' declare global { namespace LX { namespace MusicMetadataModule { type IAudioMetadata = iAudioMetadata } } }
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/common/types/theme.d.ts
src/common/types/theme.d.ts
declare namespace LX { interface ThemeColors { '--color-000': string '--color-050': string '--color-100': string '--color-150': string '--color-200': string '--color-250': string '--color-300': string '--color-350': string '--color-400': string '--color-450': string '--col...
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/common/types/player.d.ts
src/common/types/player.d.ts
declare namespace LX { namespace Player { interface ProgressBarOptions { progress: number mode?: Electron.ProgressBarOptions['mode'] } type StatusButtonActions = 'unCollect' | 'collect' | 'prev' | 'pause' | 'play' | 'next' | 'seek' | 'volume' | 'mute' inte...
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/common/types/open_api.d.ts
src/common/types/open_api.d.ts
declare namespace LX { namespace OpenAPI { interface Status { status: boolean message: string address: string } interface EnableServer { enable: boolean port: string bindLan: boolean } interface ActionBase <A> { action: A } interface ActionData<A,...
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/renderer-lyric/main.ts
src/renderer-lyric/main.ts
import { createApp } from 'vue' import { i18nPlugin } from './plugins/i18n' import mountComponents from './components' import App from './App.vue' import '@root/common/error' import { getSetting, onMainWindowInited, onSettingChanged, sendConnectMainWindowEvent } from './utils/ipc' import { initSetting, mergeSetting...
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/renderer-lyric/store/action.ts
src/renderer-lyric/store/action.ts
import { setting, musicInfo, isPlay } from './state' import { updateSetting as saveSetting } from '@lyric/utils/ipc' export const initSetting = (newSetting: LX.DesktopLyric.Config) => { mergeSetting(newSetting) } export const mergeSetting = (newSetting: Partial<LX.DesktopLyric.Config>) => { for (const [key, value...
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/renderer-lyric/store/lyric.ts
src/renderer-lyric/store/lyric.ts
import { markRaw, reactive } from '@common/utils/vueTools' export const lyrics = markRaw<{ lyric: string tlyric: string | null rlyric: string | null lxlyric: string | null }>({ lyric: '', tlyric: '', rlyric: '', lxlyric: '', }) interface Line { text: string time: number extendedLyrics: 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/renderer-lyric/store/state.ts
src/renderer-lyric/store/state.ts
import { ref, shallowReactive } from '@common/utils/vueTools' export const setting = shallowReactive<LX.DesktopLyric.Config>({ 'desktopLyric.enable': false, 'desktopLyric.isLock': false, 'desktopLyric.isAlwaysOnTop': false, 'desktopLyric.isAlwaysOnTopLoop': false, 'desktopLyric.isShowTaskbar': true, 'deskt...
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/renderer-lyric/useApp/useHoverHide.ts
src/renderer-lyric/useApp/useHoverHide.ts
import { computed, ref } from '@common/utils/vueTools' import { setting } from '@lyric/store/state' let mouseCheckTools: { x: number y: number preX: number preY: number timeout: NodeJS.Timeout | null handleCheck: (setShow: () => void) => void handleMove: (x: number, y: number, setShow: () => void) => voi...
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/renderer-lyric/useApp/usePauseHide.ts
src/renderer-lyric/useApp/usePauseHide.ts
import { ref, watch } from '@common/utils/vueTools' import { isPlay, setting } from '@lyric/store/state' export default () => { let unWatch: (() => void) | null = null let isHide = ref(false) let timeout: NodeJS.Timeout | null = null const clearIntv = () => { if (!timeout) return clearTimeout(timeout) ...
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/renderer-lyric/useApp/useTheme.ts
src/renderer-lyric/useApp/useTheme.ts
import { onBeforeUnmount, watch } from '@common/utils/vueTools' import { setting } from '@lyric/store/state' import { onThemeChange } from '@lyric/utils/ipc' import { RGB_Alpha_Shade } from '@common/theme/colorUtils' export default () => { const rThemeChange = onThemeChange(({ params: setting }) => { window.setT...
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/renderer-lyric/useApp/useLyric.ts
src/renderer-lyric/useApp/useLyric.ts
import { watch } from '@common/utils/vueTools' import { setLyric, setVertical, setPlaybackRate } from '@lyric/core/lyric' import { getStatus } from '@lyric/core/mainWindowChannel' import { isPlay, setting } from '@lyric/store/state' export default () => { watch(() => setting['player.isShowLyricTranslation'], setLyri...
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/renderer-lyric/useApp/useCommon.ts
src/renderer-lyric/useApp/useCommon.ts
import { watch } from '@common/utils/vueTools' import { setting } from '@lyric/store/state' export default () => { watch(() => setting['common.langId'], (id) => { if (!id) return window.i18n.setLanguage(id) window.setLang(id) }) }
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/renderer-lyric/useApp/useWindowSize.ts
src/renderer-lyric/useApp/useWindowSize.ts
import { setting } from '@lyric/store/state' import { onBeforeUnmount, onMounted } from '@common/utils/vueTools' import { setWindowBounds } from '@lyric/utils/ipc' type Origin = 'left' | 'top' | 'right' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' export default () => { const resize: { ...
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/renderer-lyric/utils/ipc.ts
src/renderer-lyric/utils/ipc.ts
import { rendererSend, rendererInvoke, rendererOn, rendererOff } from '@common/rendererIpc' import { CMMON_EVENT_NAME, WIN_LYRIC_RENDERER_EVENT_NAME } from '@common/ipcNames' type RemoveListener = () => void export const getSetting = async() => { return rendererInvoke<LX.DesktopLyric.Config>(WIN_LYRIC_RENDERER_EVEN...
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/renderer-lyric/plugins/i18n.ts
src/renderer-lyric/plugins/i18n.ts
import type { I18n } from '@root/lang' import { createI18n, i18nPlugin, useI18n } from '@root/lang' window.i18n = createI18n() export { i18nPlugin, useI18n, } export type { I18n }
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/renderer-lyric/types/common.d.ts
src/renderer-lyric/types/common.d.ts
// import '@common/types/app_setting' // import '@common/types/common' // import '@common/types/user_api' // import '@common/types/sync' // import '@common/types/music' // import '@common/types/list' // import '@common/types/download_list' // import '@common/types/player' import '@common/types/shims_vue' // import '@co...
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/renderer-lyric/types/app.d.ts
src/renderer-lyric/types/app.d.ts
import { type I18n } from '@lyric/plugins/i18n' declare global { interface Window { ELECTRON_DISABLE_SECURITY_WARNINGS?: string i18n: I18n lxData: any setTheme: (colors: Record<string, string>) => void setLang: (lang?: string) => void setLyricColor: (colors: Record<string, string>) => 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/renderer-lyric/core/mainWindowChannel.ts
src/renderer-lyric/core/mainWindowChannel.ts
import { onProvideMainWindowChannel } from '@lyric/utils/ipc' import { onBeforeUnmount } from '@common/utils/vueTools' import { setMusicInfo, setIsPlay } from '../store/action' import { pause, play, setLyric, setLyricOffset, setPlaybackRate, stop } from './lyric' import { lyrics } from '@lyric/store/lyric' let mainWin...
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/renderer-lyric/core/lyric.ts
src/renderer-lyric/core/lyric.ts
import Lyric from '@common/utils/lyric-font-player' import { markRawList } from '@common/utils/vueTools' import { setLines, setOffset, setTempOffset, setText, lyrics } from '@lyric/store/lyric' import { musicInfo, setting } from '@lyric/store/state' let lrc: Lyric export const init = () => { lrc = new Lyric({ 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/index-dev.ts
src/main/index-dev.ts
/** * This file is used specifically and only for development. It installs * `electron-debug` & `vue-devtools`. There shouldn't be any need to * modify this file, but it can be used to extend your development * environment. */ import { app } from 'electron' import electronDebug from 'electron-debug' import inst...
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/app.ts
src/main/app.ts
import path from 'node:path' import { existsSync, mkdirSync, renameSync } from 'fs' import { app, shell, screen, nativeTheme, dialog } from 'electron' import { URL_SCHEME_RXP } from '@common/constants' import { getTheme, initHotKey, initSetting, parseEnvParams } from './utils' import { navigationUrlWhiteList } from '@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/index.ts
src/main/index.ts
import { app } from 'electron' import './utils/logInit' import '@common/error' import { initGlobalData, initSingleInstanceHandle, applyElectronEnvParams, setUserDataPath, registerDeeplink, listenerAppEvent, } from './app' import { isLinux } from '@common/utils' import { initAppSetting } from '@main/app' 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/worker/index.ts
src/main/worker/index.ts
import { createDBServiceWorker } from './utils' export default () => { return { dbService: createDBServiceWorker(), } }
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/worker/dbService/tables.ts
src/main/worker/dbService/tables.ts
// export const sql = ` // CREATE TABLE "db_info" ( // "id" INTEGER NOT NULL UNIQUE, // "field_name" TEXT, // "field_value" TEXT, // PRIMARY KEY("id" AUTOINCREMENT) // ); // CREATE TABLE "my_list" ( // "id" TEXT NOT NULL, // "name" TEXT NOT NULL, // "source" TEXT, // "sourceListId...
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/worker/dbService/verifyDB.ts
src/main/worker/dbService/verifyDB.ts
import type Database from 'better-sqlite3' import tables from './tables' const rxp = /\n|\s|;|--.+/g export default (db: Database.Database) => { const result = db.prepare<[]>('SELECT type,name,tbl_name,sql FROM "main".sqlite_master WHERE sql NOT NULL;').all() as Array<{ type: string, name: string, tbl_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/worker/dbService/db.ts
src/main/worker/dbService/db.ts
import Database from 'better-sqlite3' import path from 'path' import tables, { DB_VERSION } from './tables' import verifyDB from './verifyDB' import migrateData from './migrate' let db: Database.Database const initTables = (db: Database.Database) => { db.exec(` ${Array.from(tables.values()).join('\n')} INS...
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/worker/dbService/migrate.ts
src/main/worker/dbService/migrate.ts
import type Database from 'better-sqlite3' import tables, { DB_VERSION } from './tables' // const migrateV1 = (db: Database.Database) => { // const sql = ` // DROP TABLE "main"."download_list"; // CREATE TABLE "download_list" ( // "id" TEXT NOT NULL, // "isComplate" INTEGER NOT NULL, // "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/worker/dbService/index.ts
src/main/worker/dbService/index.ts
import { init } from './db' import { exposeWorker } from '../utils/worker' import { list, lyric, music_url, music_other_source, download, dislike_list } from './modules/index' const common = { init, } exposeWorker(Object.assign(common, list, lyric, music_url, music_other_source, download, dislike_list)) export ty...
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/worker/dbService/modules/index.ts
src/main/worker/dbService/modules/index.ts
export * as list from './list' export * as lyric from './lyric' export * as music_url from './music_url' export * as music_other_source from './music_other_source' export * as download from './download' export * as dislike_list from './dislike_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/worker/dbService/modules/dislike_list/dbHelper.ts
src/main/worker/dbService/modules/dislike_list/dbHelper.ts
// import type Database from 'better-sqlite3' import { getDB } from '../../db' import { createQueryStatement, createInsertStatement, // createDeleteStatement, // createUpdateStatement, createClearStatement, } from './statements' /** * 查询不喜欢歌曲列表 */ export const queryDislikeList = () => { const queryStatem...
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/worker/dbService/modules/dislike_list/statements.ts
src/main/worker/dbService/modules/dislike_list/statements.ts
import { getDB } from '../../db' /** * 创建不喜欢列表查询语句 * @returns 查询语句 */ export const createQueryStatement = () => { const db = getDB() return db.prepare<[]>(` SELECT "content" FROM dislike_list WHERE "type"='music' `) } /** * 创建不喜欢记录插入语句 * @returns 插入语句 */ export const createInsertStatement = ()...
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/worker/dbService/modules/dislike_list/index.ts
src/main/worker/dbService/modules/dislike_list/index.ts
import { SPLIT_CHAR } from '@common/constants' import { queryDislikeList, insertDislikeList, overwirteDislikeList, // updateDislikeList, // deleteDislikeList, // clearDislikeList, } from './dbHelper' // let dislikeInfo: LX.Dislike.DislikeInfo const toDBDislikeInfo = (musicInfos: string[]): LX.DBService.Di...
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/worker/dbService/modules/music_url/dbHelper.ts
src/main/worker/dbService/modules/music_url/dbHelper.ts
import { getDB } from '../../db' import { createQueryStatement, createInsertStatement, createDeleteStatement, // createUpdateStatement, createClearStatement, createCountStatement, } from './statements' /** * 查询歌曲url * @param id 歌曲id * @returns url */ export const queryMusicUrl = (id: string) => { con...
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/worker/dbService/modules/music_url/statements.ts
src/main/worker/dbService/modules/music_url/statements.ts
import { getDB } from '../../db' /** * 创建歌曲url查询语句 * @returns 查询语句 */ export const createQueryStatement = () => { const db = getDB() return db.prepare<[string]>(` SELECT "url" FROM "main"."music_url" WHERE "id"=? `) } /** * 创建歌曲url插入语句 * @returns 插入语句 */ export const createInsertStatement = ...
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/worker/dbService/modules/music_url/index.ts
src/main/worker/dbService/modules/music_url/index.ts
import { queryMusicUrl, insertMusicUrl, deleteMusicUrl, clearMusicUrl, countMusicUrl, } from './dbHelper' /** * 获取歌曲url * @param id 歌曲id * @returns 歌曲url */ export const getMusicUrl = (id: string): string | null => { const url = queryMusicUrl(id) return url } /** * 保存歌曲url * @param urlInfos url信息...
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/worker/dbService/modules/list/dbHelper.ts
src/main/worker/dbService/modules/list/dbHelper.ts
import { getDB } from '../../db' import { createListQueryStatement, createListInsertStatement, createListDeleteStatement, createListClearStatement, createListUpdateStatement, createMusicInfoQueryStatement, createMusicInfoInsertStatement, createMusicInfoUpdateStatement, createMusicInfoDeleteStatement, ...
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/worker/dbService/modules/list/statements.ts
src/main/worker/dbService/modules/list/statements.ts
import { getDB } from '../../db' /** * 创建列表查询语句 * @returns 查询语句 */ export const createListQueryStatement = () => { const db = getDB() return db.prepare<[]>(` SELECT "id", "name", "source", "sourceListId", "position", "locationUpdateTime" FROM "main"."my_list" `) } /** * 创建列表插入语句 * @returns 插入语句 ...
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/worker/dbService/modules/list/index.ts
src/main/worker/dbService/modules/list/index.ts
import { LIST_IDS } from '@common/constants' import { arrPush, arrPushByPosition, arrUnshift } from '@common/utils/common' import { deleteUserLists, insertUserLists, insertMusicInfoList, insertMusicInfoListAndRefreshOrder, moveMusicInfo, moveMusicInfoAndRefreshOrder, overwriteListData, overwriteMusicInf...
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/worker/dbService/modules/lyric/dbHelper.ts
src/main/worker/dbService/modules/lyric/dbHelper.ts
import { getDB } from '../../db' import { createLyricQueryStatement, createRawLyricQueryStatement, createRawLyricInsertStatement, createRawLyricDeleteStatement, createRawLyricUpdateStatement, createRawLyricClearStatement, createEditedLyricQueryStatement, createEditedLyricInsertStatement, createEditedL...
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/worker/dbService/modules/lyric/statements.ts
src/main/worker/dbService/modules/lyric/statements.ts
import { getDB } from '../../db' const RAW_LYRIC = 'raw' const EDITED_LYRIC = 'edited' /** * 创建歌词查询语句 * @returns 查询语句 */ export const createLyricQueryStatement = () => { const db = getDB() return db.prepare<[string]>(` SELECT "type", "text", "source" FROM "main"."lyric" WHERE "id"=? `) } /** ...
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/worker/dbService/modules/lyric/index.ts
src/main/worker/dbService/modules/lyric/index.ts
import { queryLyric, queryRawLyric, insertRawLyric, deleteRawLyric, updateRawLyric, clearRawLyric, queryEditedLyric, insertEditedLyric, deleteEditedLyric, updateEditedLyric, clearEditedLyric, countEditedLyric, countRawLyric, } from './dbHelper' const keys = ['lyric', 'tlyric', 'rlyric', 'lxly...
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/worker/dbService/modules/music_other_source/dbHelper.ts
src/main/worker/dbService/modules/music_other_source/dbHelper.ts
import { getDB } from '../../db' import { createMusicInfoQueryStatement, createMusicInfoInsertStatement, createMusicInfoDeleteStatement, createMusicInfoClearStatement, createCountStatement, } from './statements' /** * 查询歌曲信息 * @param id 歌曲id * @returns 歌曲信息 */ export const queryMusicInfo = (id: 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/worker/dbService/modules/music_other_source/statements.ts
src/main/worker/dbService/modules/music_other_source/statements.ts
import { getDB } from '../../db' /** * 创建歌曲信息查询语句 * @returns 查询语句 */ export const createMusicInfoQueryStatement = () => { const db = getDB() return db.prepare<[string]>(` SELECT "id", "name", "singer", "source", "meta" FROM "main"."music_info_other_source" WHERE source_id=? ORDER BY "order" ASC...
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/worker/dbService/modules/music_other_source/index.ts
src/main/worker/dbService/modules/music_other_source/index.ts
import { queryMusicInfo, insertMusicInfo, deleteMusicInfo, clearMusicInfo, countMusicInfo, } from './dbHelper' const toDBMusicInfo = (id: string, musicInfos: LX.Music.MusicInfo[]): LX.DBService.MusicInfoOtherSource[] => { return musicInfos.map((info, index) => { return { ...info, meta: JSO...
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/worker/dbService/modules/download/dbHelper.ts
src/main/worker/dbService/modules/download/dbHelper.ts
import { getDB } from '../../db' import { createQueryStatement, createInsertStatement, createDeleteStatement, createUpdateStatement, createUpdatePositionStatement, createClearStatement, } from './statements' /** * 查询下载歌曲列表 */ export const queryDownloadList = () => { const queryStatement = createQuerySt...
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/worker/dbService/modules/download/statements.ts
src/main/worker/dbService/modules/download/statements.ts
import { getDB } from '../../db' /** * 创建下载列表查询语句 * @returns 查询语句 */ export const createQueryStatement = () => { const db = getDB() return db.prepare<[]>(` SELECT "id", "isComplate", "status", "statusText", "progress_downloaded", "progress_total", "url", "quality", "ext", "fileName", "filePath", "musicInfo"...
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/worker/dbService/modules/download/index.ts
src/main/worker/dbService/modules/download/index.ts
import { arrPush, arrUnshift } from '@common/utils/common' import { queryDownloadList, insertDownloadList, updateDownloadList, deleteDownloadList, clearDownloadList, } from './dbHelper' let list: LX.Download.ListItem[] const toDBDownloadInfo = (musicInfos: LX.Download.ListItem[], offset: number = 0): LX.DBS...
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/worker/utils/index.ts
src/main/worker/utils/index.ts
import { Worker } from 'node:worker_threads' import * as Comlink from 'comlink' import nodeEndpoint from 'comlink/dist/esm/node-adapter' export type DBSeriveTypes = Comlink.Remote<LX.WorkerDBSeriveListTypes> export const createDBServiceWorker = () => { const worker: Worker = new Worker(new URL( /* webpackChunkN...
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/worker/utils/worker.ts
src/main/worker/utils/worker.ts
import worker from 'node:worker_threads' import * as Comlink from 'comlink' import nodeEndpoint from 'comlink/dist/esm/node-adapter' export const exposeWorker = (obj: any) => { if (worker.parentPort == null) return Comlink.expose(obj, nodeEndpoint(worker.parentPort)) }
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/logInit.ts
src/main/utils/logInit.ts
import log from 'electron-log/node' log.transports.file.level = 'info' // log.initialize()
typescript
Apache-2.0
8686ecfa54452562ef2ee74697f8e8a22c9788fa
2026-01-04T15:37:58.950548Z
false