fix: match against the correct path in the ignore registry (#1382)

* fix: match against the correct path in the ignore registry

* fix: match against the correct path in the ignore registry
This commit is contained in:
Trigam
2026-06-13 17:05:00 -04:00
committed by GitHub
parent 6502c755c7
commit 2c85c082b7

View File

@@ -4,14 +4,12 @@
from collections.abc import Iterator
from dataclasses import dataclass, field
from pathlib import Path
import structlog
from tagstudio.core.library.alchemy.library import Library
from tagstudio.core.library.alchemy.models import Entry
from tagstudio.core.library.ignore import Ignore
from tagstudio.core.utils.types import unwrap
logger = structlog.get_logger(__name__)
@@ -35,13 +33,12 @@ class IgnoredRegistry:
logger.info("[IgnoredRegistry] Refreshing ignored entries...")
self.ignored_entries = []
library_dir: Path = unwrap(self.lib.library_dir)
for i, entry in enumerate(self.lib.all_entries()):
if not Ignore.compiled_patterns:
# If the compiled_patterns has malfunctioned, don't consider that a false positive
yield i
elif Ignore.compiled_patterns.match(library_dir / entry.path):
elif Ignore.compiled_patterns.match(entry.path):
self.ignored_entries.append(entry)
yield i