Repository navigation
Conversation
…ation - Mirror artwork at the provider's item location: shows/seasons write inside their directory, episodes use basename-thumb, shared movie folders use basename-poster/-fanart instead of clobbering folder art - Reject traversal and symlink escapes; all writes stay inside the mapped MEDIA_PATH_MAP root (realpath-checked) - Reconcile conflicting local images even when the canonical file already matches, so stale poster/cover ghosts get backed up - Restore (undo) support: compare-and-set against pre-undo server bytes, refuse when local artwork changed independently, back up before removal, never touch unrelated images - Jellyfin/Emby adapter reports the item's path + type; apply, custom upload, and undo all forward it to the local artwork writer - Season mirrors skip when parent-level season art overrides exist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
With
LOCAL_ARTWORKenabled against Jellyfin, mirrored local files landed in the wrong place or could escape the configured media mapping, andundoleft them behind — so Jellyfin's local image provider would re-import stale art on its next refresh, silently reverting an undo.Item-aware destinations
The Jellyfin/Emby adapter now reports an item's path and item type (
movie/show/season/episode) viagetItemMediaLocation, matched on the exact item id; virtual/remote/unknown types return null. The mirror uses the type to place files where Jellyfin actually looks:folder.*inside the item's own directory (previously landed in the library root or the show folder).basename-thumb.*(previously clobbered the season folder's art).folder.*in dedicated single-video folders;basename-poster.*/basename-fanart.*in shared multi-video folders, so applying one movie no longer overwrites a sibling's poster.Containment and safe writes
..traversal and symlink escapes are refused. Nothing is read, backed up, or moved outside the mappedMEDIA_PATH_MAProot. (Reproduced the escape before the fix.)poster.jpg,cover.jpg, …) are reconciled — backed up and removed — even when the canonical file already matches, closing the stale-ghost path.Undo reconciliation
Undo now mirrors the restored server artwork back to the local file, compare-and-set against the pre-undo bytes:
createLocalArtworkWriterFromEnv.Verification
bun run check— 0 errors;bun run lint— clean;bun run build— success.bun run test— 2,533 passed, 2 skipped.Follow-ups (not in this change)
vitest.config.tsstill uses the removed-in-v4poolOptions(warning only).