<?php
require_once 'config.php';

// 删除重复的测试视频
$pdo->exec("DELETE FROM video_assets WHERE video_id LIKE 'vid_%'");
echo "已清理测试数据\n";

// 更新默认视频状态
$pdo->exec("UPDATE video_assets SET is_active = 1 WHERE video_type = 'opening' AND video_id = 'opening_sample'");
$pdo->exec("UPDATE video_assets SET is_active = 1 WHERE video_type = 'host' AND video_id = 'host_default'");
echo "已更新默认视频状态\n";

// 查询剩余记录
$stmt = $pdo->query("SELECT video_id, video_name, video_type, is_active FROM video_assets");
echo "\n当前视频记录:\n";
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    echo "ID: {$row['video_id']} | 名称: {$row['video_name']} | 类型: {$row['video_type']} | 活跃: {$row['is_active']}\n";
}
?>