TagStudio
TagStudio copied to clipboard
refactor: file attributes
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
- #1037
Tasks Completed
- Platforms Tested:
- [x] Windows x86
- [ ] Windows ARM
- [ ] macOS x86
- [ ] macOS ARM
- [x] Linux x86
- [ ] Linux ARM
- Tested For:
- [x] Basic functionality
- [ ] PyInstaller executable