Skip to content

refactor: file attributes - #1190

Closed
TrigamDev wants to merge 27 commits into
TagStudioDev:mainfrom
TrigamDev:refactor/file-attributes
Closed

TrigamDev wants to merge 27 commits into
TagStudioDev:mainfrom
TrigamDev:refactor/file-attributes

Conversation

@TrigamDev

@TrigamDev TrigamDev commented Nov 4, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

Refactors and reworks how file attributes (file name, file timestamps) and file properties (file size, duration, etc) are handled.

Previously, file properties would be stored as a FileAttributeData instance that gets filled instantly as a file is loaded, operating under the assumption that all data would be present, and then writing it all to a single label.

File properties are now stored as a dict of FilePropertyTypes and FilePropertyWidgets that get updated by callbacks as file data is loaded. Instead of the formatting taking place in a single, very messy method, the responsibility for formatting falls on the respective FilePropertyWidget, keeping everything cleanly separated.
FileAttributes has also been split into a model, view, and controller in accordance with #950.

Similarly to #1186, relevant files have been sorted into sub directories under the top level views, models, and controllers directories (and mixed, cause also doing in MVC split on media_player.py is way out of scope for this PR). This is again something that can be reverted if this is an unwanted change.

Closes

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added Type: Refactor Code that needs to be restructured or cleaned up Status: Review Needed A review of this is needed labels Nov 24, 2025
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Nov 24, 2025
@CyanVoxel

Copy link
Copy Markdown
Member

Thank you for your work on this up to this point - I'm afraid I'm going to have to close this now that #1531 and imposed its own refactors in this area, in addition to me letting this PR get too stale over time...

If there's anything from this PR that you don't see covered in #1531 and would still see the benefit of having, you're more than welcome to open one or more new PRs with those changes.

@CyanVoxel CyanVoxel closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed A review of this is needed Type: Refactor Code that needs to be restructured or cleaned up

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants