check-tts-result.js 888 B

1234567891011121314151617
  1. const { PrismaClient } = require('@prisma/client');
  2. const p = new PrismaClient();
  3. (async () => {
  4. for (const bookId of [77, 78]) {
  5. const b = await p.book.findUnique({ where: { id: bookId }, select: { id: true, title: true, targetLanguage: true, genStage: true } });
  6. console.log(`book ${b.id} (${b.targetLanguage}) genStage=${b.genStage} title=${b.title}`);
  7. const chs = await p.bookChapter.findMany({ where: { bookId }, select: { id: true, title: true, audioUrl: true, audioDuration: true, content: true, genStage: true } });
  8. for (const ch of chs) {
  9. console.log(` ch#${ch.id} genStage=${ch.genStage} dur=${ch.audioDuration}s url=${(ch.audioUrl||'').slice(-60)}`);
  10. if (ch.content) {
  11. const sample = ch.content.substring(0, 150).replace(/\n/g, ' / ');
  12. console.log(` content sample: ${sample}`);
  13. }
  14. }
  15. }
  16. await p.$disconnect();
  17. })();