mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-06-14 19:36:42 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user