Remove obsolete test scripts and add new API controllers for dashboard and game management

- 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
This commit is contained in:
Lars Behrends
2026-01-18 01:42:03 +01:00
parent b728b0c72d
commit eb1ec1153d
29 changed files with 2685 additions and 2454 deletions

80
check_gender_data.php Normal file
View File

@@ -0,0 +1,80 @@
<?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 gender data in actors table
try {
echo "\n🔍 Checking Gender Data:\n";
// Check if metadata column exists and has gender data
$stmt = $pdo->query("
SELECT name, metadata
FROM actors
WHERE metadata IS NOT NULL
AND metadata != ''
AND JSON_EXTRACT(metadata, '$.gender') IS NOT NULL
LIMIT 10
");
$actors = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo "Found " . count($actors) . " actors with gender metadata:\n";
foreach ($actors as $actor) {
$metadata = json_decode($actor['metadata'], true);
$gender = $metadata['gender'] ?? 'null';
echo " - {$actor['name']}: {$gender}\n";
}
// Count actors by gender
echo "\n📊 Gender Statistics:\n";
$genders = ['male', 'female', 'non-binary'];
foreach ($genders as $gender) {
$stmt = $pdo->prepare("
SELECT COUNT(*) as count
FROM actors
WHERE JSON_EXTRACT(metadata, '$.gender') = :gender
");
$stmt->execute(['gender' => $gender]);
$result = $stmt->fetch(PDO::FETCH_ASSOC);
echo " - " . ucfirst($gender) . ": " . $result['count'] . "\n";
}
// Check actors without gender
$stmt = $pdo->query("
SELECT COUNT(*) as count
FROM actors
WHERE metadata IS NULL
OR metadata = ''
OR JSON_EXTRACT(metadata, '$.gender') IS NULL
");
$result = $stmt->fetch(PDO::FETCH_ASSOC);
echo " - No gender data: " . $result['count'] . "\n";
// Total actors
$stmt = $pdo->query("SELECT COUNT(*) as count FROM actors");
$result = $stmt->fetch(PDO::FETCH_ASSOC);
echo " - Total actors: " . $result['count'] . "\n";
} catch (Exception $e) {
echo "❌ Error checking gender data: " . $e->getMessage() . "\n";
echo "Stack trace: " . $e->getTraceAsString() . "\n";
}
echo "\n✨ Check completed!\n";