Conditional Rules
Overview
Conditional rules allow you to control which files and folders are indexed by FileBrowser Quantum. Use rules to exclude system files, temporary directories, or large archives while keeping your UI clean and search results relevant.
Version 1.2.0+: Rules have been simplified. The conditionals wrapper has been removed, and ignoreHidden, ignoreZeroSizeFolders, and ignoreSymlinks are moved to rule items.
Basic Structure
Rules are configured directly under rules in your source configuration:
Global flags
Items such as ignoreHidden, ignoreZeroSizeFolders, and ignoreSymlinks can now be used as a global flag by not specifying a rule name like:
Rule Properties
These properties can be added to any rule to control behavior:
ignoreHidden
Skip hidden files and folders (those starting with . on linux and windows hidden folders) that match this rule. Hidden items don’t appear in UI or search. Defaults to false.
ignoreZeroSizeFolders
Skip folders with zero calculated size that match this rule. Empty folders or folders containing only empty folders are ignored. Defaults to false. Cleans up UI by hiding empty directory structures.
You can still create folders via the UI. They must be populated by the next index scan to remain visible.
ignoreSymlinks
Skip symbolic links that match this rule. Defaults to false. Useful for excluding symlinked directories from indexing.
Rule Types
Individual rules are specified in the rules array. Each rule targets specific files or folders.
Path-Based Rules
Target specific paths within your source.
folderPath
Matches exact folder path relative to source root. For example, folderPath: "logs" matches /data/logs but not /data/project/logs. Use this to exclude specific known directories.
filePath
Matches exact file path relative to source root. For example, filePath: "data.db" matches /data/data.db but not /data/backup/data.db. Use this to exclude specific known files.
Name-Based Rules (Global)
These rules apply anywhere within the source.
folderName
Matches any folder with this exact name, anywhere in the source. For example, folderName: "node_modules" excludes all node_modules directories. Useful for excluding common folder names like cache or build directories.
fileName
Matches any file with this exact name, anywhere in the source. For example, fileName: ".DS_Store" excludes all .DS_Store files. Useful for excluding system or temporary files by name.
Pattern-Based Rules (Global)
Match files and folders based on name patterns.
folderStartsWith
Matches folders whose names start with the specified prefix, anywhere in the source. For example, folderStartsWith: "tmp-" excludes tmp-cache, tmp-build, etc. Useful for excluding folders with naming conventions.
folderEndsWith
Matches folders whose names end with the specified suffix, anywhere in the source. For example, folderEndsWith: ".git" excludes .git folders. Useful for excluding folders by suffix pattern.
fileStartsWith
Matches files whose names start with the specified prefix, anywhere in the source. For example, fileStartsWith: "._" excludes macOS metadata files. Useful for excluding temporary or system files.
fileEndsWith
Matches files whose names end with the specified suffix, anywhere in the source. For example, fileEndsWith: ".tmp" excludes all temporary files. Useful for excluding files by extension or suffix.
Special Rules
includeRootItem
Only show specified items at the root level of the source. For example, with the rules above, only public and downloads folders appear at source root. Useful for restricting visibility to specific root directories or files.
When using includeRootItem, only the specified items are visible at the root level. All other root items are hidden.
neverWatchPath
Folder is indexed once initially, then never rescanned automatically. You can still manually refresh by viewing the folder in the UI. Useful for large, rarely-changing directories to save resources.
Example:
viewable
Can be added to any rule type. Folder/file appears in UI but is excluded from search and size calculations. Useful for showing directories for browsing without indexing their contents.
Example:
Users can browse old-projects but it won’t appear in search results or affect folder sizes.
Complete Examples
Clean Development Environment
Exclude common development artifacts:
| |
Media Library with Archives
Show archive folders but don’t index them:
Restricted Public Share
Only expose specific directories:
Rule Priority and Behavior
How Rules Are Applied
- Rules are OR-based: If any rule matches an item, it’s excluded
- Name rules are global:
folderName: "temp"matches anytempfolder anywhere - Rule properties apply per-rule:
ignoreHidden,ignoreZeroSizeFolders, andignoreSymlinksare evaluated for each matching rule - Viewable overrides exclusion: Adding
viewable: trueshows the item in UI