| 123456789101112131415161718 |
- // 触发 book 82 所有章节的音频生成
- const { bookStore } = require('./dist/modules/book-generator/book-generator.store.js');
- const { PrismaClient } = require('@prisma/client');
- const p = new PrismaClient();
- (async () => {
- const chs = await p.bookChapter.findMany({ where: { bookId: 82 }, select: { id: true, title: true } });
- console.log(`book 82: ${chs.length} chapters`);
- for (const ch of chs) {
- try {
- await bookStore.generateChapterAudioById(ch.id, 1, undefined, {});
- console.log(` queued ch#${ch.id} ${ch.title.slice(0, 30)}`);
- } catch (e) {
- console.log(` err ch#${ch.id}: ${e.message.slice(0, 100)}`);
- }
- }
- await p.$disconnect();
- })();
|