@oxiaom/adoremix 1.0.55 → 1.0.56

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxiaom/adoremix",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "AdoreMix broadcast server - cross-platform installer, runner and service manager",
5
5
  "bin": {
6
6
  "adoremix": "./bin/adoremix.js"
@@ -41,7 +41,8 @@
41
41
  "templates",
42
42
  "tts",
43
43
  "webui",
44
- "config-manager"
44
+ "config-manager",
45
+ "audio8-assets"
45
46
  ],
46
47
  "keywords": [
47
48
  "adoremix",
@@ -296,7 +296,8 @@ function install(opts) {
296
296
  // 检查 config.ini 是否有预托管模型(audio8_model_dir)
297
297
  let modelDir = '';
298
298
  try {
299
- const cfg = require(path.join(__dirname, '..', 'src', 'config'));
299
+ // 从主包内置 src/config 读取(避免 tts/src/config 这种错误路径)
300
+ const cfg = require(path.join(__dirname, '..', '..', 'src', 'config'));
300
301
  const wd = opts.workdir || process.env.ADOREMIX_WORKDIR || path.join(os.homedir(), '.local', 'share', 'adoremix');
301
302
  modelDir = cfg.getConfigValue(wd, 'TTS.audio8_model_dir') || '';
302
303
  } catch (e) {}
@@ -311,30 +312,45 @@ function install(opts) {
311
312
  }
312
313
  }
313
314
 
314
- // 拉 Audio8_TTS 源码:先试 git clone(多个镜像),全失败再走 codeload tarball(最后备选)
315
- const MIRRORS = [
316
- AUDIO8_REPO, // 官方 https
317
- 'https://ghproxy.cn/https://github.com/Audio8-AI/Audio8_TTS.git', // 国内代理
318
- 'https://hub.fastgit.xyz/Audio8-AI/Audio8_TTS.git' // fastgit 镜像
319
- ];
315
+ // 拉 Audio8_TTS 源码:先试内置 tarball(主包 audio8-assets/audio8-tts.tgz,离线),再 git 镜像,最后 codeload
320
316
  let cloned = false;
321
- for (let attempt = 1; attempt <= 2; attempt++) {
322
- for (const url of MIRRORS) {
323
- try {
324
- logger.log(`=== 克隆 Audio8_TTS(第 ${attempt} 次尝试): ${url} ===`);
325
- execSync(`rm -rf ~/audio8_temp && git clone --depth=1 "${url}" ~/audio8_temp 2>&1 | tail -3`, { stdio: 'inherit', shell: '/bin/bash' });
326
- execSync(`bash -c "cd ~/audio8_temp && (shopt -s dotglob; mv -- * ~/audio8/ 2>/dev/null || true)"`, { stdio: 'inherit', shell: '/bin/bash' });
327
- execSync('rm -rf ~/audio8_temp', { stdio: 'ignore', shell: '/bin/bash' });
328
- cloned = true;
329
- break;
330
- } catch (e) {
331
- logger.warn(`克隆失败(${url.slice(0, 60)}...): ${String(e.message).slice(0, 100)}`);
317
+ // 1) 主包内置 tarball(最稳,完全离线)
318
+ const BUNDLED_TARBALL = path.join(__dirname, '..', '..', 'audio8-assets', 'audio8-tts.tgz');
319
+ if (fs.existsSync(BUNDLED_TARBALL)) {
320
+ try {
321
+ logger.log('=== 使用主包内置 Audio8_TTS tarball(离线) ===');
322
+ execSync(`rm -rf ~/audio8 && mkdir -p ~/audio8 && tar xzf "${BUNDLED_TARBALL}" --strip-components=1 -C ~/audio8 && ls ~/audio8 | head -3`, { stdio: 'inherit', shell: '/bin/bash' });
323
+ cloned = true;
324
+ } catch (e) {
325
+ logger.warn('内置 tarball 解压失败:' + e.message);
326
+ }
327
+ } else {
328
+ logger.warn(`主包内置 tarball 不存在:${BUNDLED_TARBALL}`);
329
+ }
330
+ // 2) Git 镜像(fallback)
331
+ if (!cloned) {
332
+ const MIRRORS = [
333
+ AUDIO8_REPO,
334
+ 'https://ghproxy.cn/https://github.com/Audio8-AI/Audio8_TTS.git',
335
+ 'https://hub.fastgit.xyz/Audio8-AI/Audio8_TTS.git'
336
+ ];
337
+ for (let attempt = 1; attempt <= 2 && !cloned; attempt++) {
338
+ for (const url of MIRRORS) {
339
+ try {
340
+ logger.log(`=== 克隆 Audio8_TTS(第 ${attempt} 次): ${url} ===`);
341
+ execSync(`rm -rf ~/audio8_temp && git clone --depth=1 "${url}" ~/audio8_temp 2>&1 | tail -3`, { stdio: 'inherit', shell: '/bin/bash' });
342
+ execSync(`bash -c "cd ~/audio8_temp && (shopt -s dotglob; mv -- * ~/audio8/ 2>/dev/null || true)"`, { stdio: 'inherit', shell: '/bin/bash' });
343
+ execSync('rm -rf ~/audio8_temp', { stdio: 'ignore', shell: '/bin/bash' });
344
+ cloned = true;
345
+ break;
346
+ } catch (e) {
347
+ logger.warn(`克隆失败:${String(e.message).slice(0, 100)}`);
348
+ }
332
349
  }
350
+ if (!cloned) execSync('sleep 5', { stdio: 'ignore', shell: '/bin/bash' });
333
351
  }
334
- if (cloned) break;
335
- execSync('sleep 5', { stdio: 'ignore', shell: '/bin/bash' });
336
352
  }
337
- // 备选:codeload 直接下 master 分支 tarball(绕过 git,HTTP 而已,国内更稳定)
353
+ // 3) codeload tarball(最后备选)
338
354
  if (!cloned) {
339
355
  try {
340
356
  logger.log('=== 备选:codeload github tarball ===');
@@ -345,8 +361,8 @@ function install(opts) {
345
361
  }
346
362
  }
347
363
  if (!cloned) {
348
- logger.error('所有镜像和重试都失败,无法克隆 Audio8_TTS 仓库');
349
- logger.warn('解决:手动在 ~/audio8 下放好 Audio8_TTS 源码再重试 install(跳过 git clone 步骤)');
364
+ logger.error('所有源都失败,无法获取 Audio8_TTS 源码');
365
+ logger.warn('解决:手动在 ~/audio8 下放好 Audio8_TTS 源码再重试 install');
350
366
  return 1;
351
367
  }
352
368