-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Summary
Refactor the current file filtering system to clearly separate two distinct concerns:
- Filesystem semantics — OS-level file attributes (system flag, offline, etc.) — not user-configurable
- Noise filtering — Application-level exclusion of clutter files (
.DS_Store,thumbs.db) — user-configurable
Background
Currently, FileSystemInspector.IsSystem() mixes both concerns:
public bool IsSystem(FileInfo fileInfo)
{
// Noise filtering (application-level)
var isCommon = fileInfo.Name.In("desktop.ini", "thumbs.db", ".desktop.ini", ".thumbs.db", ".DS_Store");
// Filesystem semantics (OS-level)
var isSystem = (fileInfo.Attributes & FileAttributes.System) == FileAttributes.System;
return isCommon || isSystem;
}This conflation makes it hard to:
- Understand what's being filtered and why
- Extend the noise file list
- Allow future user customization of noise filtering
Proposed Design
New Interface Methods
public interface IFileSystemInspector
{
// Filesystem semantics (non-configurable, OS-level)
bool HasSystemAttribute(FileInfo fileInfo); // Windows FileAttributes.System
bool IsOffline(FileInfo fileInfo);
bool IsRecallOnDataAccess(FileInfo fileInfo);
// Noise filtering (application-level, potentially configurable)
bool IsNoiseFile(FileInfo fileInfo);
}Separate Noise File Detection
Create a dedicated component or static helper for noise file detection:
public static class NoiseFileDetector
{
private static readonly HashSet<string> KnownNoiseFileNames = new(StringComparer.OrdinalIgnoreCase)
{
// Windows
"desktop.ini",
"thumbs.db",
"ehthumbs.db",
"ehthumbs_vista.db",
// macOS
".DS_Store",
".AppleDouble",
".LSOverride",
".Spotlight-V100",
".Trashes",
".fseventsd",
".TemporaryItems",
".VolumeIcon.icns",
// Linux
".directory"
};
public static bool IsNoiseFile(string fileName)
{
return KnownNoiseFileNames.Contains(fileName);
}
}Acceptance Criteria
- Rename
IsSystem()toHasSystemAttribute()(or similar) for clarity - Create
IsNoiseFile()method with extended file list - Update
InventoryBuilderto call both methods separately - Maintain backward compatibility in
SessionSettings.ExcludeSystemFilesbehavior - Document each noise file and its origin (Windows/macOS/Linux)
- Unit tests for noise file detection (case sensitivity, all listed files)
Extended Noise File List
| File | Platform | Purpose |
|---|---|---|
desktop.ini |
Windows | Folder customization |
thumbs.db |
Windows | Thumbnail cache |
ehthumbs.db |
Windows | Media Center thumbnails |
ehthumbs_vista.db |
Windows | Vista Media Center |
.DS_Store |
macOS | Finder metadata |
.AppleDouble |
macOS | Resource forks |
.LSOverride |
macOS | Launch Services |
.Spotlight-V100 |
macOS | Spotlight index |
.Trashes |
macOS | Trash folder |
.fseventsd |
macOS | File system events |
.TemporaryItems |
macOS | Temporary files |
.VolumeIcon.icns |
macOS | Volume icon |
.directory |
Linux (KDE) | Folder metadata |
Priority
Important — Improves code clarity and prepares for future extensibility.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels