Skip to content

[Bug]: Can't relink file entries if .ts_ignore contains leading slash pattern #1123

@CyanVoxel

Description

@CyanVoxel

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

Alpha 9.5.5

Operating System & Version

macOS 15.6.1

Description

Similar to #1089, the code for re-linking entries will raise an exception if there's a leading slash pattern used in the .ts_ignore file. This also masks the issue of that pattern's functionality not being accounted for.

Expected Behavior

Entry re-linking should accurately function with any ignore pattern provided.

Steps to Reproduce

  1. Have an ignore pattern that uses a leading slash in your .ts_ignore file
  2. Create a scenario in which any file entries are unlinked
  3. Attempt to relink the file entries

Logs

Error calling Python override of QRunnable::run(): Traceback (most recent call last):
  File "qt/utils/custom_runnable.py", line 18, in run
  File "qt/mixed/progress_bar.py", line 64, in <lambda>
  File "qt/utils/function_iterator.py", line 21, in run
  File "core/library/alchemy/registries/unlinked_registry.py", line 70, in fix_unlinked_entries
  File "core/library/alchemy/registries/unlinked_registry.py", line 51, in match_unlinked_file_entry
  File "wcmatch/pathlib.py", line 215, in glob
  File "wcmatch/glob.py", line 877, in iglob
  File "wcmatch/glob.py", line 480, in __init__
  File "wcmatch/glob.py", line 525, in _parse_patterns
  File "wcmatch/_wcparse.py", line 792, in _compile
  File "wcmatch/_wcparse.py", line 1679, in parse
  File "wcmatch/_wcparse.py", line 1659, in _parse
  File "wcmatch/_wcparse.py", line 1571, in root
ValueError: The pattern must be a relative path pattern

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: HighAn important issue requiring attentionTagStudio: LibraryRelating to the TagStudio library systemType: BugSomething isn't working as intended

    Type

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions