trigger-tts-and-check.js 677 B

123456789101112131415161718
  1. // 触发 book 77/78 音频 + 查 TtsTask
  2. const p = new (require('@prisma/client').PrismaClient)();
  3. (async () => {
  4. const { bookStore } = require('./dist/modules/book-generator/book-generator.store.js');
  5. for (const bookId of [77, 78]) {
  6. const chs = await p.bookChapter.findMany({ where: { bookId } });
  7. console.log('=== book', bookId, '-', chs.length, '章 ===');
  8. for (const ch of chs) {
  9. try {
  10. await bookStore.generateChapterAudioById(ch.id, 1, undefined, {});
  11. console.log(' queued ch#' + ch.id);
  12. } catch (e) {
  13. console.log(' err ch#' + ch.id + ': ' + e.message.slice(0, 200));
  14. }
  15. }
  16. }
  17. await p.$disconnect();
  18. })();