Skip to content

Match excluded library folders as whole paths - #329

Open
zotabee wants to merge 2 commits into
jellyfin:masterfrom
zotabee:fix-excluded-folder-match
Open

zotabee wants to merge 2 commits into
jellyfin:masterfrom
zotabee:fix-excluded-folder-match

Conversation

@zotabee

@zotabee zotabee commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

"Exclude library folders" used a substring match. Excluding /media/Movies also excluded /media/Movies 4K, and any path that merely contained the excluded folder, such as /mnt/backup/media/Movies. Those items were skipped by the import and export tasks, scrobbles, instant watched updates and library events.

One helper, used everywhere the exclusion list is checked, now matches only the folder itself and what's inside it. Trailing slashes and Windows paths are handled, and the match stays case-insensitive as before.

To reproduce: have libraries at /media/Movies and /media/Movies 4K, exclude only the first, and run "Export library to trakt.tv". Nothing from Movies 4K is exported.

Tested with a small test calling CanSync from master and from this branch:

Excluded Item master This PR
/media/Movies /media/Movies/Alien (1979)/Alien.mkv skipped skipped
/media/Movies /media/Movies 4K/Alien (1979)/Alien.mkv skipped synced
/media/Movies /mnt/backup/media/Movies/Alien (1979)/Alien.mkv skipped synced
D:\TV D:\TV\Lost\Season 01\Lost S01E01.mkv skipped skipped
D:\TV D:\TV Shows\Lost\Season 01\Lost S01E01.mkv skipped synced

A trailing slash or a different case in the excluded folder still matches, as before.

Also tested live on my Jellyfin 12.1 server (Windows): a second user excluded ...\Downloads\Movies, a prefix of my test library ...\Downloads\Movies.Test. The import didn't skip that library, so a movie watched on Trakt was marked watched.

Merges cleanly with #320 to #323, #338, #341 and #342, which change the same files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181seTYh8Bo6yc19Ba5p5bo
Co-authored-by: Selman Trabzon <selman.trbzon@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant