mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
- Deleted test scripts: test_jellyfin_execution.php, test_stash.php, test_xbvr.php, test_xbvr_sync.php, vite.config.js - Added DashboardController for fetching dashboard statistics and recent activity - Added GameController for managing games, including fetching all games, game details, and games by category - Introduced various check scripts to validate database structures and data integrity for adult videos, games, gender data, posters, and TV show actors
69 lines
2.2 KiB
PHP
69 lines
2.2 KiB
PHP
<?php
|
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
|
|
|
// Load environment variables
|
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
|
$dotenv->load();
|
|
|
|
// Load database configuration
|
|
$dbConfig = require __DIR__ . '/config/database.php';
|
|
\App\Database\Database::setConfig($dbConfig);
|
|
|
|
// Initialize database
|
|
try {
|
|
$pdo = \App\Database\Database::getInstance();
|
|
echo "✅ Database connection successful\n";
|
|
} catch (Exception $e) {
|
|
die('❌ Database connection failed: ' . $e->getMessage());
|
|
}
|
|
|
|
// Check sample movie and TV show structure
|
|
try {
|
|
// Check movies
|
|
$stmt = $pdo->query("SELECT id, title, poster_url, metadata FROM movies LIMIT 1");
|
|
$movie = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
|
if ($movie) {
|
|
echo "🎬 Sample movie structure:\n";
|
|
echo " - ID: {$movie['id']}\n";
|
|
echo " - Title: {$movie['title']}\n";
|
|
echo " - poster_url: " . ($movie['poster_url'] ?? 'NULL') . "\n";
|
|
echo " - metadata: " . substr($movie['metadata'] ?? 'NULL', 0, 200) . "...\n";
|
|
}
|
|
|
|
// Check TV shows
|
|
$stmt = $pdo->query("SELECT id, title, poster_url, metadata FROM tv_shows LIMIT 1");
|
|
$tvshow = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
|
if ($tvshow) {
|
|
echo "\n📺 Sample TV show structure:\n";
|
|
echo " - ID: {$tvshow['id']}\n";
|
|
echo " - Title: {$tvshow['title']}\n";
|
|
echo " - poster_url: " . ($tvshow['poster_url'] ?? 'NULL') . "\n";
|
|
echo " - metadata: " . substr($tvshow['metadata'] ?? 'NULL', 0, 200) . "...\n";
|
|
}
|
|
|
|
// Test actor movies method
|
|
echo "\n🎭 Testing actor movies method:\n";
|
|
$stmt = $pdo->query("SELECT id FROM actors LIMIT 1");
|
|
$actor = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
|
if ($actor) {
|
|
$actorModel = new \App\Models\Actor($pdo);
|
|
$actorModel->id = $actor['id'];
|
|
$movies = $actorModel->movies();
|
|
|
|
echo "Found " . count($movies) . " movies for actor {$actor['id']}\n";
|
|
if (!empty($movies)) {
|
|
$firstMovie = $movies[0];
|
|
echo "First movie poster_url: " . ($firstMovie['poster_url'] ?? 'NULL') . "\n";
|
|
}
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
echo "❌ Error: " . $e->getMessage() . "\n";
|
|
}
|
|
|
|
echo "\n✨ Check completed!\n";
|