9bcb8501ab
- Introduced `publish-with-sql.ps1` to publish Jellyfin with SQL files. - Added `remove-sqlite.ps1` to facilitate the removal of SQLite dependencies for PostgreSQL-only deployment. - Created `rollback-to-net10.ps1` to revert .NET 11 changes back to .NET 10. - Implemented `test_api.py` for testing API interactions. - Added `verify-migration.ps1` to verify PostgreSQL migration steps. - Updated various `.csproj` files to include `Microsoft.Kiota.Abstractions` package. - Enhanced `JellyfinDbContext` to handle concurrency exceptions during save operations. - Updated tests to include new package references and ensure compatibility with changes.
84 lines
3.0 KiB
PowerShell
84 lines
3.0 KiB
PowerShell
# Fix startup.json WebDir paths
|
|
# This script finds and fixes incorrect WebDir paths in startup.json files
|
|
|
|
Write-Host "=================================================" -ForegroundColor Cyan
|
|
Write-Host "Jellyfin startup.json WebDir Fixer" -ForegroundColor Cyan
|
|
Write-Host "=================================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
$searchPaths = @(
|
|
".",
|
|
".\bin\Debug\net11.0",
|
|
".\bin\Release\net11.0",
|
|
".\bin\Debug\net11.0\config",
|
|
".\bin\Release\net11.0\config"
|
|
)
|
|
|
|
$filesFound = 0
|
|
$filesFixed = 0
|
|
|
|
foreach ($path in $searchPaths) {
|
|
$jsonPath = Join-Path $path "startup.json"
|
|
|
|
if (Test-Path $jsonPath) {
|
|
$filesFound++
|
|
Write-Host "Found: $jsonPath" -ForegroundColor Yellow
|
|
|
|
try {
|
|
$content = Get-Content $jsonPath -Raw
|
|
$originalContent = $content
|
|
|
|
# Check for incorrect WebDir
|
|
if ($content -match '"WebDir":\s*"[^"]*C:/ProgramData/jellyfin/wwwroot[^"]*"') {
|
|
Write-Host " Status: Has incorrect WebDir path" -ForegroundColor Red
|
|
|
|
# Create backup
|
|
$backupPath = "$jsonPath.backup.$(Get-Date -Format 'yyyyMMdd_HHmmss')"
|
|
Copy-Item $jsonPath $backupPath
|
|
Write-Host " Backup: $backupPath" -ForegroundColor Gray
|
|
|
|
# Fix the path
|
|
$content = $content -replace '"WebDir":\s*"C:/ProgramData/jellyfin/wwwroot"', '"WebDir": "wwwroot"'
|
|
|
|
# Also fix any data path if it has /data appended
|
|
$content = $content -replace '"WebDir":\s*"C:/ProgramData/jellyfin/data/wwwroot"', '"WebDir": "wwwroot"'
|
|
|
|
Set-Content -Path $jsonPath -Value $content -NoNewline
|
|
$filesFixed++
|
|
|
|
Write-Host " Result: FIXED!" -ForegroundColor Green
|
|
}
|
|
elseif ($content -match '"WebDir":\s*"wwwroot"') {
|
|
Write-Host " Status: Already correct (relative path)" -ForegroundColor Green
|
|
}
|
|
else {
|
|
Write-Host " Status: Has custom path (not changed)" -ForegroundColor Cyan
|
|
}
|
|
}
|
|
catch {
|
|
Write-Host " ERROR: Failed to process - $_" -ForegroundColor Red
|
|
}
|
|
|
|
Write-Host ""
|
|
}
|
|
}
|
|
|
|
Write-Host "=================================================" -ForegroundColor Cyan
|
|
|
|
if ($filesFound -eq 0) {
|
|
Write-Host "No startup.json files found." -ForegroundColor Yellow
|
|
Write-Host "Run Jellyfin once to create the configuration file." -ForegroundColor White
|
|
}
|
|
elseif ($filesFixed -eq 0) {
|
|
Write-Host "All files are already correct!" -ForegroundColor Green
|
|
}
|
|
else {
|
|
Write-Host "Fixed $filesFixed of $filesFound file(s)" -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "Next steps:" -ForegroundColor Yellow
|
|
Write-Host "1. Rebuild your solution (if needed)" -ForegroundColor White
|
|
Write-Host "2. Run Jellyfin to verify WebDir path is correct" -ForegroundColor White
|
|
}
|
|
|
|
Write-Host ""
|