Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugins/lx-music-ztools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 更新日志

## 0.1.3 - 2026-12-03

- 修复 Windows x64 上部分 ZTools 宿主缺少 `node:sqlite` 时 LX Music 无法启动的问题。安装包自带 SQLite 兼容驱动,继续使用原有的本地曲库文件和事务。
- 兼容不能通过 CommonJS 加载 ESM 的宿主,保留本地音乐标签读取。

## 0.1.2 - 2026-11-11

- 修复“字体大小”只更新根字号、正文和搜索框仍固定像素的问题:恢复上游PostCSS px→rem构建规则,同时保持文字层级及配套间距缩放。
Expand Down
4 changes: 2 additions & 2 deletions plugins/lx-music-ztools/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LX Music for ZTools

LX Music 2.12.6 的第三方 ZTools 原生移植,目标版本 **0.1.2**。保留原 LX 界面、播放器、音源管理、搜索、列表、下载与同步流程,业务服务运行在插件中,无需另装或启动 LX 桌面应用。此项目不是 LX 官方发行版,不附带第三方音源。
LX Music 2.12.6 的第三方 ZTools 原生移植,目标版本 **0.1.3**。保留原 LX 界面、播放器、音源管理、搜索、列表、下载与同步流程,业务服务运行在插件中,无需另装或启动 LX 桌面应用。此项目不是 LX 官方发行版,不附带第三方音源。

Windows x64 为首验平台。当前已验证原播放器、本地 MP3/FLAC/WAV 与 DSP、受控搜索/榜单/歌单、下载与标签、备份、原桌面歌词、开放 API,以及与官方 LX 2.12.6 的双向同步。真实用户音源样本中已完成一次真实播放和下载;这些结果有明确范围,不能推导所有源或平台均可用。**核心播放/下载检查点已通过30分钟后台与50次进出测试;最终ZIP回归另记。0.1.2通过源码仓库及ZTools插件中心更新流程提交,市场版本以审核合并结果为准。** 完整矩阵见 [功能与验证状态](docs/ztools/compatibility.md)。

Expand All @@ -12,7 +12,7 @@ npm run build:ztools
npm run pack:ztools
```

目标 ZIP 为 `dist-ztools/lx-music-ztools-0.1.2.zip`,校验值保存到同名 `.zip.sha256`。版本以包内 `plugin.json` 为准,构建回执为 `build-info.json`。相同构建输入按固定顺序和时间戳打包,可比较 ZIP SHA256;不承诺不同机器或依赖版本产生相同字节。
目标 ZIP 为 `dist-ztools/lx-music-ztools-0.1.3.zip`,校验值保存到同名 `.zip.sha256`。版本以包内 `plugin.json` 为准,构建回执为 `build-info.json`。相同构建输入按固定顺序和时间戳打包,可比较 ZIP SHA256;不承诺不同机器或依赖版本产生相同字节。

在 ZTools「设置 → 插件应用 → 导入本地插件」选择 ZIP,确认安装并启用,输入「洛雪音乐」「LX Music」或 `lxmusic` 打开。也可把 `src-ztools/plugin.json` 注册为开发项目后安装。隔离测试实例中的安装记录不会自动出现在日常实例。播放器入口是 `dist/lx.html`,运行包包含独立依赖,不需要开发服务器或源码目录的 `node_modules`。

Expand Down
7 changes: 4 additions & 3 deletions plugins/lx-music-ztools/build-config/ztools/package.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const path = require('node:path')
const assert = require('node:assert/strict')
const { createHash } = require('node:crypto')
const allowed = ['plugin.json', 'logo.png', 'LICENSE', 'NOTICE', 'THIRD-PARTY-NOTICES.txt', 'native-jobs.html', 'dist', 'preload']
const required = ['plugin.json', 'logo.png', 'LICENSE', 'NOTICE', 'THIRD-PARTY-NOTICES.txt', 'native-jobs.html', 'dist/lx.html', 'dist/lyric.html', 'dist/lx-assets.json', 'dist/source-worker.js', 'dist/pitch_shifter.audioWorklet.js', 'preload/services.js', 'preload/lyric.cjs', 'preload/native-jobs.cjs', 'preload/runtime/index.cjs', 'preload/package-lock.json']
const sqliteBinding = 'preload/node_modules/@libsql/win32-x64-msvc/index.node'
const required = ['plugin.json', 'logo.png', 'LICENSE', 'NOTICE', 'THIRD-PARTY-NOTICES.txt', 'native-jobs.html', 'dist/lx.html', 'dist/lyric.html', 'dist/lx-assets.json', 'dist/source-worker.js', 'dist/pitch_shifter.audioWorklet.js', 'preload/services.js', 'preload/lyric.cjs', 'preload/native-jobs.cjs', 'preload/runtime/index.cjs', 'preload/package-lock.json', sqliteBinding]
function hash(file) { return createHash('sha256').update(fs.readFileSync(file)).digest('hex') }
function walk(root, prefix = '') {
return fs.readdirSync(path.join(root, prefix), { withFileTypes: true }).flatMap(entry => {
Expand All @@ -23,7 +24,7 @@ function verifyPackage(root, { receipt = true } = {}) {
const assets = JSON.parse(fs.readFileSync(path.join(root, 'dist/lx-assets.json'), 'utf8'))
for (const file of assets) assert.ok(fs.existsSync(path.join(root, 'dist', file)), '缺少前端资源:' + file)
const files = walk(root)
assert.ok(!files.some(file => /\.(?:node|sqlite(?:-wal|-shm)?|part)$/i.test(file)), '安装包含原生二进制或用户数据')
assert.ok(!files.some(file => file !== sqliteBinding && /\.(?:node|sqlite(?:-wal|-shm)?|part)$/i.test(file)), '安装包含未声明的原生二进制或用户数据')
const runtime = path.join(root, 'preload')
const findDependency = (from, name) => {
let directory = from
Expand Down Expand Up @@ -59,7 +60,7 @@ function assemble({ source, destination }) {
for (const file of allowed) copy(path.join(source, file), path.join(destination, file))
const files = verifyPackage(destination, { receipt: false }).sort()
const manifest = JSON.parse(fs.readFileSync(path.join(destination, 'plugin.json'), 'utf8'))
fs.writeFileSync(path.join(destination, 'build-info.json'), JSON.stringify({ plugin: { name: manifest.name, version: manifest.version }, upstream: { version: '2.12.6', baseline: '323e4bac' }, runtime: { sqlite: 'node:sqlite', standalone: true }, files: Object.fromEntries(files.map(file => [file, hash(path.join(destination, file))])) }, null, 2))
fs.writeFileSync(path.join(destination, 'build-info.json'), JSON.stringify({ plugin: { name: manifest.name, version: manifest.version }, upstream: { version: '2.12.6', baseline: '323e4bac' }, runtime: { sqlite: 'node:sqlite', sqliteFallback: 'libsql (Windows x64)', standalone: true }, files: Object.fromEntries(files.map(file => [file, hash(path.join(destination, file))])) }, null, 2))
verifyPackage(destination)
return { root: destination, files: files.length, manifest }
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/lx-music-ztools/docs/ztools/host-capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| --- | --- | --- |
| 音乐窗口 | 单实例插件视图,保留原 LX UI;窗口大小/全屏/分离/关闭由宿主管理 | 不复制原 LX 独立应用窗口、托盘和更新器;主页面桌面窗口按钮隐藏 |
| 生命周期 | 进入/重入复用实例;隐藏保持播放器和已启用服务;终止清理 | 核心服务已通过41.4.0下30分钟/50次往返;宿主退出/终止不继续播放 |
| 设备本地存储 | `getPath('pluginData')` + 内置 `node:sqlite`,复用原 SQL 模型 | 不附带 better-sqlite3 原生二进制,不依赖 ZTools 账号云数据库;旧宿主需实际能力检测 |
| 设备本地存储 | `getPath('pluginData')` 中的同一个 SQLite 文件。优先使用内置 `node:sqlite`,Windows x64 宿主缺少该能力时使用随包提供的 libSQL 驱动 | 曲库保存在当前设备,跨设备通过 LX 同步或备份迁移 |
| 文件操作 | 公开文件/目录对话框授予 canonical 路径能力,可信 preload 操作 | 不把全部硬盘读写权交给音源;导入备份的路径需重新授权 |
| 音源 | 可信 loopback frame 创建 CSP 浏览器 Worker,HTTP/取消走消息桥 | 无 Node/宿主 API/DOM;禁止把原始用户音源放进仓库、产品包或第三方许可文件 |
| 下载与元数据 | 本地 hard link/rename 与身份校验;隐藏、宿主拥有的临时窗口运行 metadata job | 所有新下载需 hard link;临时元数据窗口不执行用户音源,不能把附加 renderer 算另一个播放器 |
Expand Down
6 changes: 3 additions & 3 deletions plugins/lx-music-ztools/docs/ztools/installation.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# 安装、使用与数据迁移

适用目标:0.1.2,Windows x64,第三方原生移植版。实际宿主验证组合及尚未完成的项目见 [兼容矩阵](compatibility.md)。当前版本不作市场已上架声明。
适用目标:0.1.3,Windows x64,第三方原生移植版。实际宿主验证组合及尚未完成的项目见 [兼容矩阵](compatibility.md)。

## 安装本地包

1. 源码构建执行 `npm ci`、`npm run build:ztools`、`npm run pack:ztools`。构建安装插件独立运行依赖并检查资源与许可。
2. 在 `dist-ztools/` 找到 `lx-music-ztools-0.1.2.zip` 及 `.zip.sha256`。用 `Get-FileHash -Algorithm SHA256` 比对旁边校验值;包内 `build-info.json` 记录文件清单与逐文件 SHA256。
2. 在 `dist-ztools/` 找到 `lx-music-ztools-0.1.3.zip` 及 `.zip.sha256`。用 `Get-FileHash -Algorithm SHA256` 比对旁边校验值。包内 `build-info.json` 记录文件清单与逐文件 SHA256。
3. 打开 ZTools「设置 → 插件应用 → 导入本地插件」,选择 ZIP,确认安装、启用。
4. 搜索 `lxmusic`、「LX Music」或「洛雪音乐」打开。首次阅读并接受原使用协议,再导入自己的音源。

开发方式是注册 `src-ztools/plugin.json`,随后安装并启用开发项目。生成文件、选中目录或在隔离测试实例安装均不会自动安装到日常使用的 ZTools。默认播放器入口为 `dist/lx.html`,`dist/index.html` 是诊断页。

从旧版更新后,终止当前已打开的LX插件,再通过`lxmusic`重新进入,确保加载新样式。0.1.2恢复了六档字体大小的实际文字缩放,旧页面不会自动替换内存中的样式。

运行包自带 `preload/node_modules`,不依赖开发目录或另装 LX 桌面版。不支持内置 `node:sqlite` 或缺少所需公开 API 的宿主会报告错误;当前不承诺所有旧版 ZTools 兼容。
运行包自带 `preload/node_modules`。宿主缺少可用的 `node:sqlite` 时,插件加载随包提供的 Windows x64 SQLite 兼容驱动,继续读写同一个 `lx-ztools.data.sqlite` 文件。

## 导入与选择音源

Expand Down
4 changes: 2 additions & 2 deletions plugins/lx-music-ztools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/lx-music-ztools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lx-music-ztools",
"version": "0.1.2",
"version": "0.1.3",
"description": "LX Music native ZTools port with isolated custom sources, downloads and LX sync",
"type": "module",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions plugins/lx-music-ztools/scripts/build-notices.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { resolve, dirname, join, basename } from 'node:path'
// source-worker tools. Runtime modules also retain their own original licenses.
const packages = new Map()
const missingLicenseFiles = { '@vue/devtools-api@6.6.4': 'build-config/ztools/licenses/vue-devtools-api-6.6.4.txt' }
const sqliteBinding = '@libsql/win32-x64-msvc'
function locate(from, name) {
let current = from
while (true) {
Expand All @@ -23,6 +24,7 @@ function collect(file) {
if (Object.hasOwn(info.optionalDependencies || {}, name)) continue
collect(locate(dirname(file), name))
}
if (info.name === 'libsql') collect(locate(dirname(file), sqliteBinding))
}
for (const root of ['package.json', 'src-ztools/preload/package.json']) {
const file = resolve(root), info = JSON.parse(readFileSync(file, 'utf8'))
Expand All @@ -40,6 +42,7 @@ for (const [file, info] of packages) {
const content = readme && readFileSync(join(dirname(file), readme.name), 'utf8')
const license = content && /^#{1,6}\s+Licen[cs]e\s*$/im.exec(content)
if (missingLicenseFiles[id]) texts.push(readFileSync(missingLicenseFiles[id], 'utf8').trim())
else if (info.name === sqliteBinding) texts.push(readFileSync(join(dirname(locate(dirname(file), 'libsql')), 'LICENSE'), 'utf8').trim())
else if (license) texts.push(`--- ${readme.name} (License section) ---\n${content.slice(license.index).trim()}`)
else throw new Error('Missing dependency license text: ' + id + ' (' + basename(dirname(file)) + ')')
}
Expand Down
Loading
Loading