dsh-music-panel 0.3.12 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.13
4
+
5
+ ### 修复
6
+
7
+ - 「在文件夹中显示」在 Windows 上没有定位到文件:explorer 参数改为 `/select,"C:\path\file"`(引号紧贴逗号),并用 `windowsVerbatimArguments` 原样传参,避免 Node 重新加引号/转义导致 explorer 忽略 `/select`
8
+
3
9
  ## 0.3.12
4
10
 
5
11
  ### 变更
package/lib/routes.js CHANGED
@@ -403,13 +403,20 @@ export function createRoutes({ settings, library, playlists, stats, playback, fa
403
403
  const file = await resolveTrack(body?.path, config.roots)
404
404
  if (file === null) return fail(res, 404, 'NOT_FOUND', '文件不在已配置的音乐目录内')
405
405
  try {
406
+ // Explorer parses its command line itself: the reliable form is
407
+ // `/select,"C:\path\file.mp3"` with quotes hugging the comma. Node
408
+ // would re-quote/escape that argument, so pass it verbatim.
406
409
  const opener =
407
410
  process.platform === 'win32'
408
- ? { name: 'explorer.exe', args: ['/select,' + file] }
411
+ ? { name: 'explorer.exe', args: ['/select,"' + file + '"'], verbatim: true }
409
412
  : process.platform === 'darwin'
410
- ? { name: 'open', args: ['-R', file] }
411
- : { name: 'xdg-open', args: [dirname(file)] }
412
- const child = spawn(opener.name, opener.args, { detached: true, stdio: 'ignore' })
413
+ ? { name: 'open', args: ['-R', file], verbatim: false }
414
+ : { name: 'xdg-open', args: [dirname(file)], verbatim: false }
415
+ const child = spawn(opener.name, opener.args, {
416
+ detached: true,
417
+ stdio: 'ignore',
418
+ windowsVerbatimArguments: opener.verbatim,
419
+ })
413
420
  // Without this listener an ENOENT would surface as an unhandled error.
414
421
  child.on('error', () => {})
415
422
  child.unref()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-music-panel",
3
- "version": "0.3.12",
3
+ "version": "0.3.13",
4
4
  "type": "module",
5
5
  "description": "Local music library for DeepSeek Harness: scan a folder, browse tracks with cover art and tags, and play through a sidebar-panel player with loop, shuffle and volume. · DSH 本地音乐插件:扫描音乐目录、读取封面与标签、侧栏入口 + 全屏播放器。",
6
6
  "license": "MIT",