This commit is contained in:
Lars Behrends
2025-10-18 22:03:30 +02:00
parent f4c1cfc164
commit ca2d3a6960
45 changed files with 4827 additions and 326 deletions

View File

@@ -0,0 +1,45 @@
<?php
// Test Jellyfin sync execution
require_once __DIR__ . '/vendor/autoload.php';
try {
echo "=== Testing Jellyfin Sync Execution ===\n";
// Load database config
$config = require __DIR__ . '/config/database.php';
\App\Database\Database::setConfig($config);
// Create a mock source for testing
$testSource = [
'id' => 1,
'name' => 'jellyfin',
'api_url' => 'http://192.168.1.102:8096', // Adjust this to your Jellyfin URL
'api_key' => '1db2d28854e541dd90c32ea6aab5e603' // Adjust this to your API key
];
echo "Testing with source: " . $testSource['name'] . "\n";
echo "API URL: " . $testSource['api_url'] . "\n";
// Create Jellyfin service instance
$pdo = \App\Database\Database::getInstance();
$jellyfinService = new \App\Services\JellyfinSyncService($pdo, $testSource);
// Test basic sync execution
echo "\nTesting basic sync execution...\n";
try {
// This will trigger the executeSync method which calls all the private methods
echo "Attempting to run sync (this may fail if Jellyfin server is not accessible)...\n";
$jellyfinService->startSync('full');
echo "✓ Sync completed successfully\n";
} catch (Exception $e) {
echo "✗ Sync failed (expected if Jellyfin server not accessible): " . $e->getMessage() . "\n";
echo "This is normal if your Jellyfin server is not running or credentials are incorrect.\n";
}
echo "\n=== Test Complete ===\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
echo "Stack trace:\n" . $e->getTraceAsString() . "\n";
}