- 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.
4.3 KiB
Summary: Linux Paths Showing on Windows
✅ Root Cause Identified
Your database is correctly storing virtual paths:
%MetadataPath%\People\D\David L.M. McIntyre\folder.jpg
However, the logs show Linux paths:
/var/lib/jellyfin/metadata/People/D/David L.M. McIntyre/folder.jpg
Why? The system.xml configuration file contains Linux paths that are used to expand the virtual %MetadataPath% placeholder.
📂 Files to Check
1. system.xml (Most likely culprit)
Location: C:\ProgramData\jellyfin\config\system.xml
Look for:
<MetadataPath>/var/lib/jellyfin/metadata</MetadataPath>
Should be:
<MetadataPath></MetadataPath>
or
<MetadataPath>C:\ProgramData\jellyfin\data\metadata</MetadataPath>
2. encoding.xml (If transcoding shows Linux paths)
Location: C:\ProgramData\jellyfin\config\encoding.xml
Look for:
<TranscodingTempPath>/var/tmp/jellyfin</TranscodingTempPath>
Should be empty or a Windows path.
3. database.xml (Less common)
Location: C:\ProgramData\jellyfin\config\database.xml
Check for any Linux paths in connection strings or options.
🔧 How to Fix
Option 1: Use PowerShell Script (Automated - Recommended)
# Check what needs to be fixed (safe, no changes)
.\FixJellyfinPaths.ps1 -DryRun
# Apply fixes (with confirmation prompt)
.\FixJellyfinPaths.ps1
# Apply fixes without prompts
.\FixJellyfinPaths.ps1 -Force
# Custom paths
.\FixJellyfinPaths.ps1 -ConfigPath "D:\Jellyfin\config" -DataPath "D:\Jellyfin\data"
Option 2: Edit system.xml Manually
- Stop Jellyfin
- Open
C:\ProgramData\jellyfin\config\system.xml - Find
<MetadataPath>and change from Linux path to empty or Windows path - Save
- Start Jellyfin
Option 3: Via Dashboard (UI)
- Dashboard → Advanced → Paths
- Clear or update the Metadata path field
- Save
- Restart Jellyfin
🧪 How the Path Resolution Works
Database Stores: %MetadataPath%\People\D\David L.M. McIntyre\folder.jpg
↓
(Expand virtual path)
↓
system.xml has: /var/lib/jellyfin/metadata ← PROBLEM!
↓
(Combine paths)
↓
Final Path: /var/lib/jellyfin/metadata\People\D\David L.M. McIntyre\folder.jpg
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (Linux path from config!)
After Fix:
Database Stores: %MetadataPath%\People\D\David L.M. McIntyre\folder.jpg
↓
(Expand virtual path)
↓
system.xml has: (empty) → Use default: C:\ProgramData\jellyfin\data\metadata
↓
(Combine paths)
↓
Final Path: C:\ProgramData\jellyfin\data\metadata\People\D\David L.M. McIntyre\folder.jpg
✓ Correct Windows path!
📍 Code Locations
The path expansion happens in:
-
ServerConfigurationManager.cs:78-84private void UpdateMetadataPath() { ((ServerApplicationPaths)ApplicationPaths).InternalMetadataPath = string.IsNullOrWhiteSpace(Configuration.MetadataPath) ? ApplicationPaths.DefaultInternalMetadataPath : Configuration.MetadataPath; // ← Uses system.xml value } -
ServerApplicationPaths.cs:63public string PeoplePath => Path.Combine(InternalMetadataPath, "People");
🔍 Verification
After applying the fix, check the logs. The error should change from:
[WRN] Image not found at "/var/lib/jellyfin/metadata/People/..."
To:
[WRN] Image not found at "C:\ProgramData\jellyfin\data\metadata\People\..."
(The file might still not exist, but at least the path will be correct!)
📝 Prevention
When migrating from Linux to Windows in the future:
- Don't copy
system.xmldirectly - Let Jellyfin generate a new config file
- Or manually edit paths before starting Jellyfin
- Use empty values for paths to let Jellyfin use OS-appropriate defaults
🎯 TL;DR
- ✅ Database is correct (uses
%MetadataPath%) - ❌
system.xmlhas Linux paths - 🔧 Fix: Clear
<MetadataPath>in system.xml - 🔄 Restart Jellyfin