perf: Merge library scanning with unlinked entry detection#1242
perf: Merge library scanning with unlinked entry detection#1242TheBobBobs wants to merge 13 commits intoTagStudioDev:mainfrom
Conversation
CyanVoxel
left a comment
There was a problem hiding this comment.
Great work on this! This tremendously speeds up the relinking process, and I like the addition of the Unlinked Entries modal automatically popping up when there's unlinked entries present. Probably something good to have as a user option, but that's fine as a future PR.
So far there's just a couple nitpicks and issues I have:
In src/tagstudio/core/library/refresh.py there's now some explicit SQLAlchemy imports which should not be used outside of the /library/alchemy directory. Since moving the affected logic to other files such as library.py would likely be cumbersome, another option could be to just move src/tagstudio/core/library/refresh.py to src/tagstudio/core/library/alchemy/refresh.py. That way there's no explicit SLQAlchemy dependencies being combined with generic code.
When refreshing the unlinked entries, the value in the "Library Information" panel is no longer updated:

Summary
Optimize the way unlinked entries are calculated and move logic into Library scanning since it can be quickly calculated with data from scan.
Scanning a library is now split into 3 steps.
dict[str, int]andset[str]set[str]If there are any missing paths the unlinked entries ui will be opened.
When the unlinked ui is closed new entries will automatically be saved if there are no remaining missing paths.
Tasks Completed