check-book-82.js 1.2 KB

1234567891011121314151617181920
  1. const { PrismaClient } = require('@prisma/client');
  2. const p = new PrismaClient();
  3. (async () => {
  4. const b = await p.book.findUnique({ where: { id: 82 }, include: { chapters: true } });
  5. console.log(`book 82 lang=${b.targetLanguage} stage=${b.genStage} chapters=${b.chapters.length}`);
  6. for (const c of b.chapters) {
  7. const sample = (c.content || '').substring(0, 400).replace(/\n/g, ' / ');
  8. const hasCN = /[一-鿿]/.test(c.content || '');
  9. console.log(` ch#${c.id} [${c.genStage}] audio=${c.audioUrl ? 'yes' : 'NO'}`);
  10. console.log(` ${sample}`);
  11. console.log(` hasChinese: ${hasCN ? '❌ 是(有中文!)' : '✅ 否(纯英文)'}`);
  12. }
  13. // 同时查 TtsTask
  14. const tasks = await p.ttsTask.findMany({ where: { chapterId: { in: b.chapters.map(c => c.id) } }, select: { id: true, chapterId: true, status: true, voiceId: true, targetLanguage: true, preferredVendor: true, preferredModel: true } });
  15. console.log(`\n TtsTask count: ${tasks.length}`);
  16. for (const t of tasks) {
  17. console.log(` ttsTask#${t.id} ch=${t.chapterId} status=${t.status} voice=${t.voiceId} lang=${t.targetLanguage} vendor=${t.preferredVendor} model=${t.preferredModel}`);
  18. }
  19. await p.$disconnect();
  20. })();