Skip to content

[Bug]: Folders To Tags gui doesn't display tree #1280

@FloriPro

Description

@FloriPro

Checklist

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

TagStudio Version

Alpha 9.5.6

Operating System & Version

WIndows 11

Description

When i tried to import a libary with a folder structure like this:

  • Reactions
    • Angry
      • Images
    • Funny
      • Images
    • Offend
      • Images
  • Images

When wanting to create Tags with the Folder to Tags Macro, after opening the Modal, no tree was shown, but i could create tags with the folder names when clicking apply.

As a side note, it would be god to have a text displayed, when no untagged entries exist.

Expected Behavior

A tree of folder / files will be shown

Steps to Reproduce

  1. create a new libary (?)
  2. add folder(s) (do not need to be nested) with images
  3. try to run folders to tags

Logs

C:\Users\flori\Documents\Programming\Github\TagStudio\.venv\Scripts\python.exe C:\Users\flori\Documents\Programming\Github\TagStudio\src\tagstudio\main.py -o C:\Users\flori\Pictures\TagStudioTests\TestA 
2025-12-30 14:54:58 [info     ] [FFmpeg] Using FFprobe location: ffprobe (Found)
2025-12-30 14:54:58 [info     ] [FFmpeg] Using FFmpeg location: ffmpeg (Found)
2025-12-30 14:54:59 [info     ] [ResourceManager] Resources Registered: count=37
2025-12-30 14:54:59 [info     ] [Settings] Global Settings File Path not specified, using default
2025-12-30 14:54:59 [info     ] [Settings] Reading Global Settings File path=WindowsPath('C:/Users/flori/Appdata/Roaming/TagStudio/settings.toml')
2025-12-30 14:54:59 [info     ] [Cache] Cache File not specified, using default one filename=C:/Users/flori/AppData/Roaming/TagStudio/TagStudio.ini
2025-12-30 14:55:02 [info     ] [Library] Opening SQLite Library connection_string=sqlite:///C:\Users\flori\Pictures\TagStudioTests\TestA\.TagStudio\ts_library.sqlite library_dir=WindowsPath('C:/Users/flori/Pictures/TagStudioTests/TestA')
2025-12-30 14:55:02 [info     ] [Library] DB_VERSION: 103     
2025-12-30 14:55:02 [info     ] [Library] Creating DB tables...
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.TITLE: DefaultField(id=0, name='Title', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=True)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.AUTHOR: DefaultField(id=1, name='Author', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.ARTIST: DefaultField(id=2, name='Artist', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.URL: DefaultField(id=3, name='URL', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DESCRIPTION: DefaultField(id=4, name='Description', type=<FieldTypeEnum.TEXT_BOX: 'Text Box'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.NOTES: DefaultField(id=5, name='Notes', type=<FieldTypeEnum.TEXT_BOX: 'Text Box'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.COLLATION: DefaultField(id=9, name='Collation', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE: DefaultField(id=10, name='Date', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE_CREATED: DefaultField(id=11, name='Date Created', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE_MODIFIED: DefaultField(id=12, name='Date Modified', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE_TAKEN: DefaultField(id=13, name='Date Taken', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE_PUBLISHED: DefaultField(id=14, name='Date Published', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.BOOK: DefaultField(id=17, name='Book', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.COMIC: DefaultField(id=18, name='Comic', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.SERIES: DefaultField(id=19, name='Series', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.MANGA: DefaultField(id=20, name='Manga', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.SOURCE: DefaultField(id=21, name='Source', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE_UPLOADED: DefaultField(id=22, name='Date Uploaded', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.DATE_RELEASED: DefaultField(id=23, name='Date Released', type=<FieldTypeEnum.DATETIME: 'Datetime'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.VOLUME: DefaultField(id=24, name='Volume', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.ANTHOLOGY: DefaultField(id=25, name='Anthology', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.MAGAZINE: DefaultField(id=26, name='Magazine', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.PUBLISHER: DefaultField(id=27, name='Publisher', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.GUEST_ARTIST: DefaultField(id=28, name='Guest Artist', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.COMPOSER: DefaultField(id=29, name='Composer', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.COMMENTS: DefaultField(id=30, name='Comments', type=<FieldTypeEnum.TEXT_LINE: 'Text Line'>, is_default=False)>
2025-12-30 14:55:02 [debug    ] ValueType already exists       field=<FieldID.OCR_TEXT: DefaultField(id=31, name='OCR Text', type=<FieldTypeEnum.TEXT_BOX: 'Text Box'>, is_default=True)>
2025-12-30 14:55:02 [info     ] [Config] Thumbnail Cache Size: 500 MB
2025-12-30 14:55:02 [info     ] [Ignore] Processing the .ts_ignore file... last_mtime=None library=WindowsPath('C:/Users/flori/Pictures/TagStudioTests/TestA') new_mtime=1767023221.1751006
2025-12-30 14:55:02 [info     ] [Ignore]                       glob_patterns=['.fseventsd/**', '**/.fseventsd/**', '**/.localized/**', '**/*.xmp', '.Trashes', '*.json', 'System Volume Information', '.Trash-*/**', '**/.Trash/**', '**/.Spotlight-V100/**', '**/.TagStudio', '.fseventsd', '**/.Trash', '*.json/**', '.TemporaryItems', '**/.DS_Store', '**/desktop.ini/**', '.Spotlight-V100', 'System Volume Information/**', '**/.Trashes', '.localized/**', '.Spotlight-V100/**', '**/*.aae', '.DS_Store', '**/._*/**', '**/.DS_Store/**', '**/.Spotlight-V100', 'desktop.ini/**', '._*', '._*/**', '**/.TagStudio/**', '*.xmp', '**/.TemporaryItems/**', '**/.localized', '.DS_Store/**', '.Trash-*', '**/desktop.ini', '**/.Trash-*', '$RECYCLE.BIN/**', 'desktop.ini', '**/*.aae/**', '$RECYCLE.BIN', '.TagStudio/**', '*.aae/**', '**/$RECYCLE.BIN', '**/System Volume Information/**', '**/.TemporaryItems', '**/.Trashes/**', '*.aae', '**/*.json/**', '.TemporaryItems/**', '**/*.json', '.Trash', '**/$RECYCLE.BIN/**', '**/.fseventsd', '.localized', '**/System Volume Information', '.Trashes/**', '**/.Trash-*/**', '**/._*', '*.xmp/**', '.TagStudio', '**/*.xmp/**', '.Trash/**']
2025-12-30 14:55:02 [info     ] [Ignore] No updates to the .ts_ignore detected last_mtime=1767023221.1751006 library=WindowsPath('C:/Users/flori/Pictures/TagStudioTests/TestA') new_mtime=1767023221.1751006
2025-12-30 14:55:02 [warning  ] [PanelModal] add_callback not implemented for IgnoreModal
2025-12-30 14:55:02 [info     ] [Ignore] No updates to the .ts_ignore detected last_mtime=1767023221.1751006 library=WindowsPath('C:/Users/flori/Pictures/TagStudioTests/TestA') new_mtime=1767023221.1751006
None
2025-12-30 14:55:02 [info     ] searching library              filter=BrowsingState(page_index=0, sorting_mode=<SortingModeEnum.DATE_ADDED: 'file.date_added'>, ascending=False, random_seed=0, show_hidden_entries=False, query=None) query_full='SELECT DISTINCT entries.id \nFROM entries \nWHERE NOT (EXISTS (SELECT 1 \nFROM tags, tag_entries \nWHERE entries.id = tag_entries.entry_id AND tags.id = tag_entries.tag_id AND tags.is_hidden)) ORDER BY entries.id DESC'
2025-12-30 14:55:02 [info     ] SQL Execution finished (0.01 seconds)
2025-12-30 14:55:02 [info     ] items to render                count=1153
2025-12-30 14:55:03 [warning  ] [Refresh: ripgrep not found on system]
2025-12-30 14:55:03 [info     ] [Ignore]                       glob_patterns=['.fseventsd/**', '**/.fseventsd/**', '**/.localized/**', '**/*.xmp', '.Trashes', '*.json', 'System Volume Information', '.Trash-*/**', '**/.Trash/**', '**/.Spotlight-V100/**', '**/.TagStudio', '.fseventsd', '**/.Trash', '*.json/**', '.TemporaryItems', '**/.DS_Store', '**/desktop.ini/**', '.Spotlight-V100', 'System Volume Information/**', '**/.Trashes', '.localized/**', '.Spotlight-V100/**', '**/*.aae', '.DS_Store', '**/._*/**', '**/.DS_Store/**', '**/.Spotlight-V100', 'desktop.ini/**', '._*', '._*/**', '**/.TagStudio/**', '*.xmp', '**/.TemporaryItems/**', '**/.localized', '.DS_Store/**', '.Trash-*', '**/desktop.ini', '**/.Trash-*', '$RECYCLE.BIN/**', 'desktop.ini', '**/*.aae/**', '$RECYCLE.BIN', '.TagStudio/**', '*.aae/**', '**/$RECYCLE.BIN', '**/System Volume Information/**', '**/.TemporaryItems', '**/.Trashes/**', '*.aae', '**/*.json/**', '.TemporaryItems/**', '**/*.json', '.Trash', '**/$RECYCLE.BIN/**', '**/.fseventsd', '.localized', '**/System Volume Information', '.Trashes/**', '**/.Trash-*/**', '**/._*', '*.xmp/**', '.TagStudio', '**/*.xmp/**', '.Trash/**']
2025-12-30 14:55:03 [info     ] [Refresh]: Falling back to wcmatch for scanning
2025-12-30 14:55:07 [info     ] [Refresh]: Directory scan time duration=4.798293590545654 files_scanned=1153 path=WindowsPath('C:/Users/flori/Pictures/TagStudioTests/TestA') tool_used='wcmatch (internal)'
2025-12-30 14:55:10 [info     ] [QtDriver] Selecting Items:    append=False bridge=False item_id=1152
2025-12-30 14:55:10 [warning  ] [FieldContainers] Updating Selection entry_id=1152
2025-12-30 14:55:10 [info     ] [Library] Time it took to get entry: 0.02 seconds with_fields=True with_tags=True
2025-12-30 14:55:10 [info     ] [emit_badge_signals] Emitting  emit_on_absent=True tag_ids=set()
2025-12-30 14:55:10 [info     ] [QtDriver][update_badges] Updating ItemThumb badges add_tags=False badge_values={<BadgeType.ARCHIVED: 'Archived'>: False} origin_id=0
2025-12-30 14:55:10 [info     ] [QtDriver][update_badges] Updating ItemThumb badges add_tags=False badge_values={<BadgeType.FAVORITE: 'Favorite'>: False} origin_id=0
Traceback (most recent call last):
  File "C:\Users\flori\Documents\Programming\Github\TagStudio\src\tagstudio\qt\ts_qt.py", line 547, in create_folders_tags_modal
    self.folders_modal.show()
  File "C:\Users\flori\Documents\Programming\Github\TagStudio\src\tagstudio\qt\mixed\folders_to_tags.py", line 244, in showEvent
    test = TreeItem(folder)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\flori\Documents\Programming\Github\TagStudio\src\tagstudio\qt\mixed\folders_to_tags.py", line 281, in __init__
    self.tag_widget = ModifiedTagWidget(unwrap(data.tag), unwrap(parent_tag))
                                                          ^^^^^^^^^^^^^^^^^^
  File "C:\Users\flori\Documents\Programming\Github\TagStudio\src\tagstudio\core\utils\types.py", line 14, in unwrap
    raise ValueError("Expected a value, but got None and no default was provided.")
ValueError: Error calling Python override of QWidget::showEvent(): Expected a value, but got None and no default was provided.

When trying to unwrap parent_tag in TreeItem, it will be None for the root, but unwrap and ModifiedTagWidget need something as the parent tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions