A sample file beside a film is filed as a film #37

Closed
opened 2026-08-03 13:50:25 +02:00 by Claude · 1 comment
Collaborator

library_tree ignores the directories upstream never resolves media out of
(#25). It does not ignore the files upstream ignores, which are the rest of
Emby.Server.Implementations/Library/IgnorePatterns.cs:

**/small.jpg
**/albumart.jpg
**/sample.?  ..  **/sample.?????        and  **/*.sample.?  ..
**/minta.?   ..  **/minta.?????         and  **/*.minta.?   ..
**/sample/*      **/minta/*
**/*.trickplay   **/*.trickplay/**

So a sample.mkv beside a film is a second film here, and small.jpg and
albumart.jpg are artwork upstream never offers a picture-naming rule.

The globs are worth reading as what they are rather than as globs: upstream
works around its matcher having no repetition, so sample.? through
sample.????? is "an extension of one to five characters". A port can say that
directly.

Not measured against a library yet — the reference one carries no samples. The
first step is to count what a real library holds, which upstream's own database
answers: rows whose path ends that way, and rows upstream filed that this one
would not.

`library_tree` ignores the directories upstream never resolves media out of (#25). It does not ignore the files upstream ignores, which are the rest of `Emby.Server.Implementations/Library/IgnorePatterns.cs`: ``` **/small.jpg **/albumart.jpg **/sample.? .. **/sample.????? and **/*.sample.? .. **/minta.? .. **/minta.????? and **/*.minta.? .. **/sample/* **/minta/* **/*.trickplay **/*.trickplay/** ``` So a `sample.mkv` beside a film is a second film here, and `small.jpg` and `albumart.jpg` are artwork upstream never offers a picture-naming rule. The globs are worth reading as what they are rather than as globs: upstream works around its matcher having no repetition, so `sample.?` through `sample.?????` is "an extension of one to five characters". A port can say that directly. Not measured against a library yet — the reference one carries no samples. The first step is to count what a real library holds, which upstream's own database answers: rows whose path ends that way, and rows upstream filed that this one would not.
Author
Collaborator

Fixed and merged.

is_ignored now covers upstream's file patterns as well as its directories:
small.jpg, albumart.jpg, thumbs.db, *.bts, *.sync, *.trickplay and
anything under one, every hidden name, the contents of a sample or minta
directory, and a sample file — written as "an extension of one to five
characters", which is what upstream's five globs are working around.

Checked against all 24 vectors from upstream's own IgnorePatternsTests. Two
answer differently and both are the same equivalence: upstream ignores the
intermediate directory at enumeration and never descends, so the resolved sets
match.

Artwork is untouched — the listing the picture rules read is the unfiltered
walk, as upstream's LocalImageProvider reads a directory it does not run
these patterns over, so albumart.jpg is still a music poster.

Zero effect on the reference library: walking all of /mnt/media under the new
rules ignores nothing, and none of the 14573 paths upstream filed would be
swallowed. The rules are scoped below the library root, so a library kept under
a dot directory still scans.

Fixed and merged. `is_ignored` now covers upstream's file patterns as well as its directories: `small.jpg`, `albumart.jpg`, `thumbs.db`, `*.bts`, `*.sync`, `*.trickplay` and anything under one, every hidden name, the contents of a `sample` or `minta` directory, and a sample file — written as "an extension of one to five characters", which is what upstream's five globs are working around. Checked against all 24 vectors from upstream's own `IgnorePatternsTests`. Two answer differently and both are the same equivalence: upstream ignores the intermediate directory at enumeration and never descends, so the resolved sets match. Artwork is untouched — the listing the picture rules read is the unfiltered walk, as upstream's `LocalImageProvider` reads a directory it does not run these patterns over, so `albumart.jpg` is still a music poster. Zero effect on the reference library: walking all of `/mnt/media` under the new rules ignores nothing, and none of the 14573 paths upstream filed would be swallowed. The rules are scoped below the library root, so a library kept under a dot directory still scans.
Sign in to join this conversation.
No description provided.