dsh-music-player 0.5.1 → 0.5.2
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/lib/client.js +16 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -710,6 +710,10 @@ window.__ModuleLoader__.load({
|
|
|
710
710
|
let shuffleQueue = [];
|
|
711
711
|
let shufflePos = -1;
|
|
712
712
|
let shuffleScopeKey = null;
|
|
713
|
+
// 在线 QQ 队列连续失败的跳过次数:某首歌因版权下架/拿不到地址而触发
|
|
714
|
+
// <audio> error 时自动跳到下一首;连续跳过次数达到队列长度(整列都试过)
|
|
715
|
+
// 即停止报错——且停止后不再 step,杜绝无限循环跳歌。成功播放(onPlay)清零。
|
|
716
|
+
let qqErrorSkipCount = 0;
|
|
713
717
|
function buildShuffleQueue(anchorId) {
|
|
714
718
|
const ids = activeIds();
|
|
715
719
|
// Fisher-Yates
|
|
@@ -1310,7 +1314,7 @@ window.__ModuleLoader__.load({
|
|
|
1310
1314
|
set({ duration: (bookTimeBase() + audio.duration) });
|
|
1311
1315
|
}
|
|
1312
1316
|
};
|
|
1313
|
-
const onPlay = () => { set({ playing: true, error: null }); acquireWakeLock(); };
|
|
1317
|
+
const onPlay = () => { qqErrorSkipCount = 0; set({ playing: true, error: null }); acquireWakeLock(); };
|
|
1314
1318
|
const onPause = () => { set({ playing: false }); savePlayback(); releaseWakeLock(); };
|
|
1315
1319
|
const onEnded = () => {
|
|
1316
1320
|
// A novel plays chunk-by-chunk: when a chunk ends, auto-advance to the
|
|
@@ -1359,6 +1363,17 @@ window.__ModuleLoader__.load({
|
|
|
1359
1363
|
}).catch(() => {});
|
|
1360
1364
|
}
|
|
1361
1365
|
} else {
|
|
1366
|
+
// 在线 QQ 队列:某首歌因版权下架/拿不到播放地址而加载失败时,自动
|
|
1367
|
+
// 跳到下一首继续播放(不因单曲失败中断整个队列);只有队列里就这一
|
|
1368
|
+
// 首、或连续跳过次数已达队列长度(整列都试过)才停下报错——且停止后
|
|
1369
|
+
// 不再 step,杜绝无限循环跳歌。
|
|
1370
|
+
const isQQTrack = store.currentId !== null && String(store.currentId).startsWith('qq:');
|
|
1371
|
+
const qLen = (store.qqQueue || []).length;
|
|
1372
|
+
if (isQQTrack && qLen > 1 && qqErrorSkipCount < qLen) {
|
|
1373
|
+
qqErrorSkipCount++;
|
|
1374
|
+
step(1);
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1362
1377
|
set({ error: '音频加载或解码失败', playing: false });
|
|
1363
1378
|
}
|
|
1364
1379
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-music-player",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "DeepSeek Harness 本地音乐 + AI 讲书插件:Host 扫描音乐目录并以 HTTP 流式提供音频、解析 .txt 小说结构并经 MiMo TTS 合成朗读,浏览器侧提供播放条/播放面板/章节目录跳转/多声音选择/实时频谱,并注册 music_play 模型工具",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|