7eb2b445cb
- Major query performance boost: replaced correlated subqueries with DistinctBy() in BaseItemRepository, added episode deduplication index, and increased default command timeout to 120s. - Fixed LibraryMonitor shutdown race: added disposal checks and exception handling in FileRefresher to prevent ObjectDisposedException. - Added PowerShell and SQL utilities for fixing Linux paths in config files and database; new scripts for WebDir and path migration. - Auto-fix for WebDir in startup.json on load; new helper scripts and docs. - Added automated weekly DB performance monitoring scripts and reporting. - Expanded documentation and README for all fixes, scripts, and migration steps. - Updated SQL scripts for index creation and diagnostics; improved output handling. - Updated db-config defaults and added new diagnostic/report files.
2.5 KiB
2.5 KiB
✅ PowerShell Script Fixed!
Problem
The original Fix-JellyfinPaths.ps1 had PowerShell syntax errors:
- Line 179: XPath expression with variable interpolation caused parsing issues
- Line 213: String terminator problem with nested quotes
Solution
Created a new, corrected script: FixJellyfinPaths.ps1 (no hyphen)
What Was Fixed
1. XPath Query Issue
Before (broken):
$element = $xml.SelectSingleNode("//*[text()='$($path.CurrentValue)']")
After (fixed):
$element = $null
$xml.SelectNodes("//*") | ForEach-Object {
if ($_.InnerText -eq $path.CurrentValue) {
$element = $_
}
}
This avoids XPath quote escaping issues by using direct comparison instead.
2. String Interpolation Issue
Before (broken):
Write-Host "3. If issues persist, review backups in: $ConfigPath" -ForegroundColor White
After (fixed):
$configInfo = "3. If issues persist, review backups in: $ConfigPath"
Write-Host $configInfo -ForegroundColor White
Separated the string building from the Write-Host call to avoid parsing ambiguity.
How to Use
Check for issues (dry run):
.\FixJellyfinPaths.ps1 -DryRun
Apply fixes:
.\FixJellyfinPaths.ps1
Apply without confirmation:
.\FixJellyfinPaths.ps1 -Force
Custom paths:
.\FixJellyfinPaths.ps1 -ConfigPath "D:\Jellyfin\config" -DataPath "D:\Jellyfin\data"
What It Does
-
Scans these config files:
system.xmlencoding.xmldatabase.xml
-
Finds any paths starting with:
/var//usr//etc/
-
Fixes them by:
- Clearing
MetadataPathandTranscodingTempPath(uses defaults) - Converting other Linux paths to Windows equivalents
- Clearing
-
Creates backups before making any changes
Testing
Script tested and verified to parse correctly:
✓ No PowerShell syntax errors
✓ Handles non-existent paths gracefully
✓ Dry-run mode works correctly
Files Updated
- ✅
FixJellyfinPaths.ps1- New corrected script - ✅
LINUX_PATH_ISSUE_SUMMARY.md- Updated to reference new script name - ✅
FIX_SYSTEM_XML_PATHS.md- Updated to reference new script name - ❌
Fix-JellyfinPaths.ps1- Old broken script (can be deleted)
Next Steps
- Run the script with
-DryRunto see what would be changed - If it looks correct, run without
-DryRunto apply fixes - Restart Jellyfin
- Check logs to verify paths are now correct