check-test-books.js 640 B

1234567891011121314
  1. const { PrismaClient } = require('@prisma/client');
  2. const p = new PrismaClient();
  3. (async () => {
  4. const bs = await p.book.findMany({ where: { OR: [{ id: 80 }, { id: 81 }, { id: 82 }] } });
  5. for (const b of bs) {
  6. const chs = await p.bookChapter.findMany({ where: { bookId: b.id } });
  7. const auds = await p.audioRecord.findMany({ where: { bookId: b.id } });
  8. console.log(`book ${b.id} '${b.title}' ch=${chs.length} audio=${auds.length}`);
  9. for (const a of auds.slice(0, 3)) {
  10. console.log(` audio#${a.id} status=${a.status} voice=${a.voiceId} url=${(a.audioUrl||'').slice(-50)}`);
  11. }
  12. }
  13. await p.$disconnect();
  14. })();