const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();

async function checkCurrentStatus() {
  console.log('\n📊 当前书籍状态：\n');
  
  const books = await prisma.book.findMany({
    orderBy: { id: 'asc' },
    select: {
      id: true,
      title: true,
      userId: true,
      _count: {
        select: { chapters: true }
      }
    }
  });
  
  // 统计"我的音频"书籍
  const myAudioCount = await prisma.book.count({
    where: { title: '我的音频' }
  });
  
  console.log(`现有书籍：${books.length}本`);
  console.log(`"我的音频"书籍：${myAudioCount}本\n`);
  
  books.forEach(book => {
    console.log(`- ${book.title} (ID:${book.id}, 章节:${book._count.chapters})`);
  });
  
  await prisma.$disconnect();
}

checkCurrentStatus().catch(console.error);
