dsh-bili-watch 0.3.0 → 0.3.1
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/README.md +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/tools/look.mjs +9 -9
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ dsh plugin --profile web add dsh-bili-watch@latest
|
|
|
45
45
|
dsh plugin --profile web remove dsh-bili-watch
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
升级后重启 DSH。`deps/` 在包目录内,卸载或重装会连模型、环境一起删掉(**登录凭证不在 `deps/`**,它已经搬到 `$DSH_HOME/bili-watch
|
|
48
|
+
升级后重启 DSH。`deps/` 在包目录内,卸载或重装会连模型、环境一起删掉(**登录凭证不在 `deps/`**,它已经搬到 `$DSH_HOME/bili-watch/`)。**面板里调过的东西也在 `deps/` 里**——`deps-config.json`(5 个调优参数与自定义缓存路径)、`cache-config.json`、`ui-config.json`、`seen.md`,卸载前先拷出来,重装后原样放回;把 `BILI_WATCH_SEEN` 指到包外可以保住「已看过」记录。**注意 `BILI_WATCH_PROJ` 只影响运行时查找顺序,不影响 `fetch-deps` 的安装位置**——`fetch-deps` 永远装进包内 `deps/`,而且查找时 `deps/` 优先,所以「指到包外」这一步要真的生效,得先让包内 `deps/.venv-*` 不存在。**抽帧缓存根在包目录外**(默认 `~/.dsh/bili-watch/cache`,即 `$DSH_HOME/bili-watch/cache`;自定义过 `BILI_WATCH_CACHE` 就指到你自己设的位置,插件会在那个目录下再建一层 `bili-watch-cache/` 当缓存根),`dsh plugin remove` 不会动它,卸载后需手动删这个缓存目录。**只删 `cache/` 这一层:登录凭证是它的兄弟文件 `$DSH_HOME/bili-watch/credential.json`,删了要重新扫码。** 日常清理在面板里逐项删即可。
|
|
49
49
|
|
|
50
50
|
## 模块架构
|
|
51
51
|
|
package/index.js
CHANGED
|
@@ -248,19 +248,19 @@ const OWN_CACHE_DIRS = new Set(['_logs', 'frames', 'sheets', 'sheet-tmp', 'subst
|
|
|
248
248
|
function hasBvLayout(dir) {
|
|
249
249
|
// 判据一:我们写过的标记(新用户、二次运行都靠它)
|
|
250
250
|
try { if (existsSync(join(dir, CACHE_MARK))) return true } catch {}
|
|
251
|
-
// 判据二(
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
//
|
|
251
|
+
// 判据二(2026-10-28 W-01 改):BV* 目录 **且** 该目录里有我们自己写的 meta.json。
|
|
252
|
+
// N05-A1 那版用「BV* + frames/asr/_logs 之一」,实测仍会误判:用户素材库只要同时有 BV 目录和
|
|
253
|
+
// 一个 frames 目录,clean 就把 BV 目录整片删掉(rc=0、无警告),还顺手写下 .bili-watch-root 自我固化,
|
|
254
|
+
// 此后永远走删的那条路、不会自己纠正。frames/asr/_logs 是通用名,等于拿别人的东西证明自己的身份;
|
|
255
|
+
// meta.json 只有 writeMeta() 会写,用户素材库不会有。
|
|
255
256
|
// 口径必须与 tools/look.mjs 的同名函数逐字一致,否则面板与 CLI 判据分叉。
|
|
256
|
-
let hasBv = false
|
|
257
|
-
let hasWork = false
|
|
258
257
|
try {
|
|
259
258
|
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
260
259
|
if (!e.isDirectory()) continue
|
|
261
|
-
if (
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
if (!/^BV[0-9A-Za-z]{10}/i.test(e.name)) continue
|
|
261
|
+
try {
|
|
262
|
+
if (existsSync(join(dir, e.name, 'meta.json'))) return true
|
|
263
|
+
} catch {}
|
|
264
264
|
}
|
|
265
265
|
} catch {}
|
|
266
266
|
return false
|
package/package.json
CHANGED
package/tools/look.mjs
CHANGED
|
@@ -69,18 +69,18 @@ const OWN_CACHE_DIRS = new Set(['_logs', 'frames', 'sheets', 'sheet-tmp', 'subst
|
|
|
69
69
|
function hasBvLayout(dir) {
|
|
70
70
|
// 判据一:我们写过的标记(新用户、二次运行都靠它)
|
|
71
71
|
try { if (existsSync(join(dir, CACHE_MARK))) return true } catch {}
|
|
72
|
-
// 判据二(
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
let hasWork = false
|
|
72
|
+
// 判据二(2026-10-28 W-01 改):BV* 目录 **且** 该目录里有我们自己写的 meta.json。
|
|
73
|
+
// N05-A1 那版用「BV* + frames/asr/_logs 之一」,实测仍会误判:用户素材库只要同时有 BV 目录和
|
|
74
|
+
// 一个 frames 目录,clean 就把 BV 目录整片删掉(rc=0、无警告),还顺手写下 .bili-watch-root 自我固化,
|
|
75
|
+
// 此后永远走删的那条路、不会自己纠正。frames/asr/_logs 是通用名,等于拿别人的东西证明自己的身份;
|
|
76
|
+
// meta.json 只有 writeMeta() 会写,用户素材库不会有。
|
|
78
77
|
try {
|
|
79
78
|
for (const e of readdirSync(dir, { withFileTypes: true })) {
|
|
80
79
|
if (!e.isDirectory()) continue
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
if (!/^BV[0-9A-Za-z]{10}/i.test(e.name)) continue
|
|
81
|
+
try {
|
|
82
|
+
if (existsSync(join(dir, e.name, 'meta.json'))) return true
|
|
83
|
+
} catch {}
|
|
84
84
|
}
|
|
85
85
|
} catch {}
|
|
86
86
|
return false
|