Skip to content

Ignore patterns

Two separate mechanisms keep junk out of the scan.

scan.ignore_dirs — exact names

Matched against the directory name, not the path, and the whole subtree is pruned:

[scan]
ignore_dirs = ["@eaDir", ".AppleDouble", "@Recycle", "lost+found", "#recycle", ".Trash-1000"]

Directories starting with . are always skipped, listed or not.

scan.ignore_patterns — globs

[scan]
ignore_patterns = ["**/sample/**", "**/Extras/**", "**/Featurettes/**", "*-trailer.*"]

Rules:

  • A pattern without / is matched against the filename alone — *-trailer.* works anywhere in the tree.
  • A pattern with / is matched against the whole path.
  • * matches any run of characters inside one path segment.
  • ** matches any run of characters including separators.
  • ? matches exactly one character within a segment.
  • **/ also matches zero directories, so **/Extras/** catches an Extras folder sitting directly at the top of a library root.
  • An invalid pattern compiles to a glob that matches nothing — it is not an error, and it silently ignores nothing.

Patterns are applied to directories as well as files, so a matching directory is pruned rather than walked.

The * vs ** trap

The obvious pattern for “anything under an Extras folder” does not work:

ignore_patterns = ["*/Extras/*"]    # matches nothing on an absolute path

* cannot cross /, and library paths are absolute, so nothing lines up. Anchoring mid-path needs **:

ignore_patterns = ["**/Extras/**"]  # correct

Examples

GoalPattern
Any file with -trailer before the extension*-trailer.*
Everything under any Extras directory**/Extras/**
Everything under one specific show/media/TV Shows/Some Show/**
Any .sample.mkv file*.sample.mkv
A single directory level named Season 00**/Season 00/**

Checking the result

ignore_patterns changes are cheap to verify — scan touches no network:

subtrace scan --sample 20

Compare video files before and after. If the count barely moves, the pattern probably needs **.