mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-31 23:29:10 +00:00
feat: add .ts_ignore pattern ignoring system (#897)
* feat: add `.ts_ignore` pattern ignoring system * fix: add wcmatch dependency * search: add ".TemporaryItems" to GLOBAL_IGNORE * add `desktop.ini` and `.localized` to global ignore * add ".fhdx" and ".ts" filetypes * chore: remove logging statement * chore: format with ruff * feat: use ripgrep for scanning if available * docs: add ignore.md * search: remove ts_ignore filtering on queries * feat: detect if files are added but ignored * fix: render edges on all unlinked thumbs * perf: don't search for cached unlinked thumbs * fix(ui): ensure newlines in file stats * fix: use ignore_to_glob for wcmatch * fix(tests): remove inconsistent test The test hinged on the timing of refresh_dir()'s yield's rather than actual values * ui: change ignored icon and color
This commit is contained in:
committed by
GitHub
parent
d00546d5fe
commit
0e7a2dfd3d
@@ -7,7 +7,7 @@ CWD = Path(__file__).parent
|
||||
|
||||
|
||||
def test_refresh_dupe_files(library):
|
||||
library.library_dir = "/tmp/"
|
||||
library.library_dir = Path("/tmp/")
|
||||
entry = Entry(
|
||||
folder=library.folder,
|
||||
path=Path("bar/foo.txt"),
|
||||
|
||||
@@ -19,8 +19,6 @@ def test_refresh_new_files(library, exclude_mode):
|
||||
library.included_files.clear()
|
||||
(library.library_dir / "FOO.MD").touch()
|
||||
|
||||
# When
|
||||
assert len(list(registry.refresh_dir(library.library_dir))) == 1
|
||||
|
||||
# Then
|
||||
# Test if the single file was added
|
||||
list(registry.refresh_dir(library.library_dir, force_internal_tools=True))
|
||||
assert registry.files_not_in_library == [Path("FOO.MD")]
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import pytest
|
||||
import structlog
|
||||
|
||||
from tagstudio.core.library.alchemy.enums import BrowsingState
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.query_lang.util import ParsingError
|
||||
|
||||
logger = structlog.get_logger()
|
||||
|
||||
|
||||
def verify_count(lib: Library, query: str, count: int):
|
||||
results = lib.search_library(BrowsingState.from_search_query(query), page_size=500)
|
||||
logger.info("results", entry_ids=results.ids, count=results.total_count)
|
||||
assert results.total_count == count
|
||||
assert len(results.ids) == count
|
||||
|
||||
|
||||
Reference in New Issue
Block a user