Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c976bf3
merge library scanning and unlinked entry detection logic
TheBobBobs Dec 5, 2025
631bed6
uncomment hidden entry search
TheBobBobs Dec 5, 2025
d7c4306
log wcmatch scan time
TheBobBobs Dec 5, 2025
0f1eb00
update scan progress bar when search starts
TheBobBobs Dec 5, 2025
5948ce3
fix encoding error on windows
TheBobBobs Dec 5, 2025
86b9472
fix tests on windows
TheBobBobs Dec 5, 2025
a9fee54
use pathlib.Path instead of str for comparing paths
TheBobBobs Jan 20, 2026
421eac1
batch updates when fixing unlinked entries
TheBobBobs Jan 20, 2026
00b0fd7
Merge branch 'main' into perf/relink
TheBobBobs Jan 20, 2026
e52232b
update tests
TheBobBobs Jan 20, 2026
9ee8690
fix: notify QTDriver anytime unlinked_entries_count is updated
TheBobBobs Jan 23, 2026
f31b399
refactor: move sql logic out of refresh.py
TheBobBobs Jan 23, 2026
23ca8e4
Merge branch 'main' into perf/relink
TheBobBobs Jan 23, 2026
b496e7e
Merge branch 'main' into perf/relink
TheBobBobs May 9, 2026
9d90533
Merge branch 'main' into perf/relink
TheBobBobs Jun 28, 2026
f5b614a
add license to new files
TheBobBobs Jun 28, 2026
61a57c5
Merge branch 'main' into perf/relink
TheBobBobs Jul 1, 2026
e1d8410
remove included_files property from Library
TheBobBobs Jul 3, 2026
aa4ad4b
make ripgrep scanning iterable
TheBobBobs Jul 3, 2026
7248c8f
search using filename and normalized filename when relinking
TheBobBobs Jul 3, 2026
7672e38
always save new files after a library scan
TheBobBobs Jul 4, 2026
a691ff5
normalize paths using NFD instead of NFC
TheBobBobs Jul 6, 2026
0c6b7ae
fix: fallback to wcmatch when ripgrep is missing
TheBobBobs Jul 6, 2026
8520dc6
Merge branch 'main' into perf/relink
TheBobBobs Jul 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/tagstudio/core/library/alchemy/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ class Library:
library_dir: Path | None = None
engine: Engine | None = None
folder: Folder | None = None
included_files: set[Path] = set()

def __init__(self) -> None:
self.dupe_entries_count: int = -1 # NOTE: For internal management.
Expand All @@ -248,7 +247,6 @@ def close(self):
self.engine.dispose()
self.library_dir = None
self.folder = None
self.included_files = set()

self.dupe_entries_count = -1
self.dupe_files_count = -1
Expand Down Expand Up @@ -1169,6 +1167,10 @@ def has_entry_with_path(self, path: Path) -> bool:
with Session(self.engine) as session:
return session.query(exists().where(Entry.path == path)).scalar()

def all_paths(self) -> Iterable[tuple[int, Path]]:
with Session(self.engine) as session:
return ((i, p) for i, p in session.execute(select(Entry.id, Entry.path)).all())

def get_paths(self, limit: int = -1) -> list[str]:
path_strings: list[str] = []
with Session(self.engine) as session:
Expand Down Expand Up @@ -1505,6 +1507,23 @@ def update_entry_path(self, entry_id: int | Entry, path: Path) -> bool:
session.commit()
return True

def update_entry_paths(self, paths: Iterable[tuple[int, Path]]) -> bool:
"""Set the path field of many entries.

Returns True if the action succeeded and False if any path already exists.
"""
with Session(self.engine) as session:
for entry_id, new_path in paths:
stmt = update(Entry).where(Entry.id == entry_id).values(path=new_path)
session.execute(stmt)
try:
session.commit()
except IntegrityError as e:
logger.error(e)
session.rollback()
return False
return True

def remove_tag(self, tag_id: int) -> bool:
with Session(self.engine, expire_on_commit=False) as session:
try:
Expand Down
98 changes: 0 additions & 98 deletions src/tagstudio/core/library/alchemy/registries/unlinked_registry.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/tagstudio/core/library/ignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

logger = structlog.get_logger()

PATH_GLOB_FLAGS = glob.GLOBSTARLONG | glob.DOTGLOB | glob.NEGATE | pathlib.MATCHBASE
PATH_GLOB_FLAGS = glob.GLOBSTARLONG | glob.DOTGLOB | glob.NEGATE | pathlib.MATCHBASE | pathlib.NODIR


GLOBAL_IGNORE = [
Expand Down
Loading
Loading