mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-29 06:10:51 +00:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b141736213 | ||
|
|
d34361be46 | ||
|
|
7cf769c5ed | ||
|
|
1110f64ff5 | ||
|
|
119b964b16 | ||
|
|
ff6d13ca30 | ||
|
|
164c58d1c9 | ||
|
|
4a60637202 | ||
|
|
4675bed373 | ||
|
|
97136ee442 | ||
|
|
25f421bca4 | ||
|
|
3221aafdfc | ||
|
|
5384f308ac | ||
|
|
9b625b07a3 | ||
|
|
4de7893c19 | ||
|
|
20d641d6f3 | ||
|
|
8d7ba0dd86 | ||
|
|
b7e0613ffb | ||
|
|
9a1f94bff0 | ||
|
|
1981b134c3 | ||
|
|
ec202891b2 | ||
|
|
278adc1004 | ||
|
|
23323431b8 | ||
|
|
ea4b01ec08 | ||
|
|
1e5334e76a | ||
|
|
e94ef20108 | ||
|
|
8a4d4def07 | ||
|
|
6e6a91aaf4 | ||
|
|
d7573b3f26 | ||
|
|
c6f66973a4 | ||
|
|
c1599c98f1 | ||
|
|
9319b6e6d6 | ||
|
|
00aeb043f0 | ||
|
|
e18cf24b43 | ||
|
|
377f3afb1d |
861
CHANGELOG.md
861
CHANGELOG.md
@@ -1,861 +0,0 @@
|
||||
# TagStudio Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [9.5.2] - 2025-03-31
|
||||
|
||||
### Added
|
||||
|
||||
#### Search
|
||||
|
||||
- feat(ui): add setting to not display full filepaths by [@HermanKassler](https://github.com/HermanKassler) in [#841](https://github.com/TagStudioDev/TagStudio/pull/841)
|
||||
- feat: add filename and path sorting by [@Computerdores](https://github.com/Computerdores) in [#842](https://github.com/TagStudioDev/TagStudio/pull/842)
|
||||
|
||||
#### Settings
|
||||
|
||||
- feat: new settings menu + settings backend by [@Computerdores](https://github.com/Computerdores) in [#859](https://github.com/TagStudioDev/TagStudio/pull/859)
|
||||
|
||||
#### UI
|
||||
|
||||
- feat(ui): merge media controls by [@csponge](https://github.com/csponge) in [#805](https://github.com/TagStudioDev/TagStudio/pull/805)
|
||||
- fix: Remove border from video preview top and left by [@zfbx](https://github.com/zfbx) in [#900](https://github.com/TagStudioDev/TagStudio/pull/900)
|
||||
- feat(ui): add more default icons and file type equivalencies by [@CyanVoxel](https://github.com/CyanVoxel) in [#882](https://github.com/TagStudioDev/TagStudio/pull/882)
|
||||
- ui: recent libraries list improvements by [@CyanVoxel](https://github.com/CyanVoxel) in [#881](https://github.com/TagStudioDev/TagStudio/pull/881)
|
||||
|
||||
#### Misc
|
||||
|
||||
- feat: provide a .desktop file by [@xarvex](https://github.com/xarvex) in [#870](https://github.com/TagStudioDev/TagStudio/pull/870)
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix: catch NotImplementedError for Float16 JPEG-XL files by [@CyanVoxel](https://github.com/CyanVoxel) in [#849](https://github.com/TagStudioDev/TagStudio/pull/849)
|
||||
- fix(nix/package): account for GTK platform by [@xarvex](https://github.com/xarvex) in [#868](https://github.com/TagStudioDev/TagStudio/pull/868)
|
||||
- fix: do not set palette for Linux-like systems that offer theming by [@xarvex](https://github.com/xarvex) in [#869](https://github.com/TagStudioDev/TagStudio/pull/869)
|
||||
- fix(flake): remove pinned input, only consume in Nix shell by [@xarvex](https://github.com/xarvex) in [#872](https://github.com/TagStudioDev/TagStudio/pull/872)
|
||||
- fix: stop ffmpeg cmd windows, refactor ffmpeg_checker by [@CyanVoxel](https://github.com/CyanVoxel) in [#855](https://github.com/TagStudioDev/TagStudio/pull/855)
|
||||
- fix: hide mnemonics on macOS by [@CyanVoxel](https://github.com/CyanVoxel) in [#856](https://github.com/TagStudioDev/TagStudio/pull/856)
|
||||
- fix: use UNION instead of UNION ALL by [@CyanVoxel](https://github.com/CyanVoxel) in [#877](https://github.com/TagStudioDev/TagStudio/pull/877)
|
||||
- fix: remove unescaped ampersand from "about.description" by [@CyanVoxel](https://github.com/CyanVoxel) in [#885](https://github.com/TagStudioDev/TagStudio/pull/885)
|
||||
- fix(ui): display 0 frame webp files in preview panel by [@CyanVoxel](https://github.com/CyanVoxel) in [64dc88a](https://github.com/TagStudioDev/TagStudio/commit/64dc88afa90bb11f3c9b74a2522f947370ce21db)
|
||||
- fix: close pdf file object in thumb renderer by [@Computerdores](https://github.com/Computerdores) in [#893](https://github.com/TagStudioDev/TagStudio/pull/893)
|
||||
- perf: improve responsiveness of GIF entries by [@Computerdores](https://github.com/Computerdores) in [#894](https://github.com/TagStudioDev/TagStudio/pull/894)
|
||||
- fix(ui): seamlessly loop videos by [@CyanVoxel](https://github.com/CyanVoxel) in [#902](https://github.com/TagStudioDev/TagStudio/pull/902)
|
||||
|
||||
### Internal Changes
|
||||
|
||||
- refactor!: change layout; import and build change by [@xarvex](https://github.com/xarvex) and [@CyanVoxel](https://github.com/CyanVoxel) in [#844](https://github.com/TagStudioDev/TagStudio/pull/844)
|
||||
- fix: log all problems in translation test by [@Computerdores](https://github.com/Computerdores) in [#839](https://github.com/TagStudioDev/TagStudio/pull/839)
|
||||
- refactor: split translation keys for about screen by [@CyanVoxel](https://github.com/CyanVoxel) in [#845](https://github.com/TagStudioDev/TagStudio/pull/845)
|
||||
- feat(ci): development tooling refresh and split documentation by [@xarvex](https://github.com/xarvex) in [#867](https://github.com/TagStudioDev/TagStudio/pull/867)
|
||||
- refactor: type hints and improvements in file_opener.py by [@VasigaranAndAngel](https://github.com/VasigaranAndAngel) in [#876](https://github.com/TagStudioDev/TagStudio/pull/876)
|
||||
- build: update spec file to use proper pathex and datas paths by [@Leonard2](https://github.com/Leonard2) in [#895](https://github.com/TagStudioDev/TagStudio/pull/895)
|
||||
- refactor: fix various missing and broken type hints@VasigaranAndAngel in [#901](https://github.com/TagStudioDev/TagStudio/pull/901)
|
||||
- refactor: fix type hints and overrides in flowlayout.py by [@VasigaranAndAngel](https://github.com/VasigaranAndAngel) in [#880](https://github.com/TagStudioDev/TagStudio/pull/880)
|
||||
|
||||
### Documentation
|
||||
|
||||
- docs: fix typos and grammar by [@Gawidev](https://github.com/Gawidev) in [#879](https://github.com/TagStudioDev/TagStudio/pull/879)
|
||||
- docs: update `ThumbRenderer` source by [@emmanuel-ferdman](https://github.com/emmanuel-ferdman) in [#896](https://github.com/TagStudioDev/TagStudio/pull/896)
|
||||
|
||||
### Translations
|
||||
|
||||
- Added Japanese (50%)
|
||||
- [@needledetector](https://github.com/needledetector)
|
||||
- Updated Turkish (93%)
|
||||
- [@Nyghl](https://github.com/Nyghl)
|
||||
- Updated Filipino (57%)
|
||||
- [@searinminecraft](https://github.com/searinminecraft)
|
||||
- Updated Tamil (92%)
|
||||
- [@TamilNeram](https://github.com/TamilNeram)
|
||||
- Updated Portuguese (Brazil) (83%)
|
||||
- [@viniciushelder](https://github.com/viniciushelder)
|
||||
- Updated German (95%)
|
||||
- [@DontBlameMe99](https://github.com/DontBlameMe99), [@Computerdores](https://github.com/Computerdores)
|
||||
- Updated Russian (85%)
|
||||
- werdi, [@Dott-rus](https://github.com/Dott-rus)
|
||||
- Updated Hungarian (100%)
|
||||
- Szíjártó Levente Pál
|
||||
- Updated Spanish (96%)
|
||||
- Joan, [@Nginearing](https://github.com/Nginearing)
|
||||
- Updated French (100%)
|
||||
- [@kitsumed](https://github.com/kitsumed)
|
||||
- Updated Toki Pona (80%)
|
||||
- [@Math-Bee](https://github.com/Math-Bee)
|
||||
|
||||
## [9.5.1] - 2025-03-06
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed translations crashing the program and preventing it from being reopened ([#827](https://github.com/TagStudioDev/TagStudio/issues/827))
|
||||
- fix: restore `translate_formatted()` method as `format()` by [@CyanVoxel](https://github.com/CyanVoxel) in [#830](https://github.com/TagStudioDev/TagStudio/pull/830)
|
||||
- tests: add tests for translations by [@Computerdores](https://github.com/Computerdores) in [#833](https://github.com/TagStudioDev/TagStudio/pull/833)
|
||||
- fix(translations): fix invalid placeholders by [@CyanVoxel](https://github.com/CyanVoxel) in [#835](https://github.com/TagStudioDev/TagStudio/pull/835)
|
||||
- Removed empty parentheses from the "About" screen title
|
||||
- fix: separate about screen title from translations by [@CyanVoxel](https://github.com/CyanVoxel) in [#836](https://github.com/TagStudioDev/TagStudio/pull/836)
|
||||
|
||||
### Translations
|
||||
|
||||
- Updated French (99%)
|
||||
- [@alessdangelo](https://github.com/alessdangelo), [@Bamowen](https://github.com/Bamowen), [@kitsumed](https://github.com/kitsumed)
|
||||
- Updated German (98%)
|
||||
- [@Thesacraft](https://github.com/Thesacraft)
|
||||
- Updated Portuguese (Brazil) (88%)
|
||||
- [@viniciushelder](https://github.com/viniciushelder)
|
||||
- Updated Russian (73%)
|
||||
- werdei
|
||||
- Updated Spanish (95%)
|
||||
- [@JCC1998](https://github.com/JCC1998)
|
||||
|
||||
### Documentation
|
||||
|
||||
- docs: fix category typo by [@salem404](https://github.com/salem404) in [#834](https://github.com/TagStudioDev/TagStudio/pull/834)
|
||||
|
||||
## [9.5.0] - 2025-03-03
|
||||
|
||||
### Added
|
||||
|
||||
#### Overhauled Search Engine
|
||||
|
||||
##### Boolean Operators
|
||||
|
||||
- feat: implement query language by [@Computerdores](https://github.com/Computerdores) in [#606](https://github.com/TagStudioDev/TagStudio/pull/606)
|
||||
- feat: optimize AND queries by [@Computerdores](https://github.com/Computerdores) in [#679](https://github.com/TagStudioDev/TagStudio/pull/679)
|
||||
|
||||
##### Filetype, Mediatype, and Glob Path + Smartcase Searches
|
||||
|
||||
- fix: remove wildcard requirement for tags by [@Tyrannicodin](https://github.com/Tyrannicodin) in [#481](https://github.com/TagStudioDev/TagStudio/pull/481)
|
||||
- feat: add filetype and mediatype searches by [@python357-1](https://github.com/python357-1) in [#575](https://github.com/TagStudioDev/TagStudio/pull/575)
|
||||
- feat: make path search use globs by [@python357-1](https://github.com/python357-1) in [#582](https://github.com/TagStudioDev/TagStudio/pull/582)
|
||||
- feat: implement search equivalence of "jpg" and "jpeg" filetypes by [@Computerdores](https://github.com/Computerdores) in [#649](https://github.com/TagStudioDev/TagStudio/pull/649)
|
||||
- feat: add smartcase and globless path searches by [@CyanVoxel](https://github.com/CyanVoxel) in [#743](https://github.com/TagStudioDev/TagStudio/pull/743)
|
||||
|
||||
##### Sortable Results
|
||||
|
||||
- feat: sort by "date added" in library by [@Computerdores](https://github.com/Computerdores) in [#674](https://github.com/TagStudioDev/TagStudio/pull/674)
|
||||
|
||||
##### Autocomplete
|
||||
|
||||
- feat: add autocomplete for search engine by [@python357-1](https://github.com/python357-1) in [#586](https://github.com/TagStudioDev/TagStudio/pull/586)
|
||||
|
||||
#### Replaced "Tag Fields" with Tag Categories
|
||||
|
||||
Instead of tags needing to be added to a tag field type such as "Meta Tags", "Content Tags", or just the "Tags" field, tags are now added directly to file entries with no intermediary step. While tag field types offered a way to further organize tags, it was cumbersome, inflexible, and simply not fully fleshed out. Tag Categories offer all of the previous (intentional) functionality while greatly increasing the ease of use and customization.
|
||||
|
||||
- feat!: tag categories by [@CyanVoxel](https://github.com/CyanVoxel) in [#655](https://github.com/TagStudioDev/TagStudio/pull/655)
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/400138597-0b92eca5-db8f-4e3e-954b-1b4f3795f073.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTU5ODIsIm5iZiI6MTc0NjY1NTY4MiwicGF0aCI6Ii80NjkzOTgyNy80MDAxMzg1OTctMGI5MmVjYTUtZGI4Zi00ZTNlLTk1NGItMWI0ZjM3OTVmMDczLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIyMDgwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY4ZWEzOWRkZjkwOGZmYjZmZDUzMjU1MjJhNDNkNzYzZmM4YjZkMTUyNWIzMjNhMGY1NWNhYmU4ODNiNzlhMzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.cE_WO9AHsigusAbtaQV0QtN4FjYJz0lyHLLwFFDBO-0)
|
||||
|
||||
#### Thumbnails and File Previews
|
||||
|
||||
##### New Thumbnail Support
|
||||
|
||||
- feat: add svg thumbnail support (port [#442](https://github.com/TagStudioDev/TagStudio/pull/442)) by [@Tyrannicodin](https://github.com/Tyrannicodin) and [@CyanVoxel](https://github.com/CyanVoxel) in [#540](https://github.com/TagStudioDev/TagStudio/pull/540)
|
||||
- feat: add pdf thumbnail support (port [#378](https://github.com/TagStudioDev/TagStudio/pull/378)) by [@Heiholf](https://github.com/Heiholf) and [@CyanVoxel](https://github.com/CyanVoxel) in [#543](https://github.com/TagStudioDev/TagStudio/pull/543)
|
||||
- feat: add ePub thumbnail support (port [#387](https://github.com/TagStudioDev/TagStudio/pull/387)) by [@Heiholf](https://github.com/Heiholf) and [@CyanVoxel](https://github.com/CyanVoxel) in [#539](https://github.com/TagStudioDev/TagStudio/pull/539)
|
||||
- feat: add OpenDocument thumbnail support (port [#366](https://github.com/TagStudioDev/TagStudio/pull/366)) by [@Joshua-Beatty](https://github.com/Joshua-Beatty) and [@CyanVoxel](https://github.com/CyanVoxel) in [#545](https://github.com/TagStudioDev/TagStudio/pull/545)
|
||||
- feat: add JXL thumbnail and animated APNG + WEBP support (port [#344](https://github.com/TagStudioDev/TagStudio/pull/344) and partially port [#357](https://github.com/TagStudioDev/TagStudio/pull/357)) by [@BPplays](https://github.com/BPplays) and [@CyanVoxel](https://github.com/CyanVoxel) in [#549](https://github.com/TagStudioDev/TagStudio/pull/549)
|
||||
- fix: catch ImportError for pillow_jxl module by [@CyanVoxel](https://github.com/CyanVoxel) in [a2f9685](https://github.com/TagStudioDev/TagStudio/commit/a2f9685bc0d744ea6f5334c6d2926aad3f6d375a)
|
||||
|
||||
##### Audio Playback
|
||||
|
||||
- feat: audio playback by [@csponge](https://github.com/csponge) in [#576](https://github.com/TagStudioDev/TagStudio/pull/576)
|
||||
- feat(ui): add audio volume slider by [@SkeleyM](https://github.com/SkeleyM) in [#691](https://github.com/TagStudioDev/TagStudio/pull/691)
|
||||
|
||||
##### Thumbnail Caching
|
||||
|
||||
- feat(ui): add thumbnail caching by [@CyanVoxel](https://github.com/CyanVoxel) in [#694](https://github.com/TagStudioDev/TagStudio/pull/694)
|
||||
|
||||
#### Tags
|
||||
|
||||
##### Delete Tags _(Finally!)_
|
||||
|
||||
- feat: remove and create tags from tag database panel by [@DandyDev01](https://github.com/DandyDev01) in [#569](https://github.com/TagStudioDev/TagStudio/pull/569)
|
||||
|
||||
##### Custom User-Created Tag Colors
|
||||
|
||||
Create your own custom tag colors via the new Tag Color Manager! Tag colors are assigned a namespace (group) and include a name, primary color, and optional secondary color. By default the secondary color is used for the tag text color, but this can also be toggled to apply to the border color as well!
|
||||
|
||||
- feat(ui)!: user-created tag colors@CyanVoxel in [#801](https://github.com/TagStudioDev/TagStudio/pull/801)
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/413668576-b591f1fe-1c44-4d82-b6e5-d166590aeab1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTU5ODIsIm5iZiI6MTc0NjY1NTY4MiwicGF0aCI6Ii80NjkzOTgyNy80MTM2Njg1NzYtYjU5MWYxZmUtMWM0NC00ZDgyLWI2ZTUtZDE2NjU5MGFlYWIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIyMDgwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdiZjM4NzczYTFhYmFhNjgwMWJlYjgwNTkzYjA3ZWFlNTkwNzBiYTlhNTAzM2Y0MWM1MWQ0MzY1YmEyNmE4NjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.EOEVWLDMx5CT-Gg5UhBmdMIYT49IZPKrrA9VL7N-pBQ) [](https://private-user-images.githubusercontent.com/46939827/413668612-96e81b08-6993-4a5e-96d0-3b05b50fbe44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTU5ODIsIm5iZiI6MTc0NjY1NTY4MiwicGF0aCI6Ii80NjkzOTgyNy80MTM2Njg2MTItOTZlODFiMDgtNjk5My00YTVlLTk2ZDAtM2IwNWI1MGZiZTQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIyMDgwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJkNTUxODJiMDZhN2I2MDAxYzZlNzIyOTAzYTgwZDg3ZDFlYWM3ODM1YWY0Mzg5MDJjNDY0NzJhYjU4ZTAzMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.rqM3YOwrYdBCiwbBbEvalj7Tsfl-XWqgD1K9PeE46tI)
|
||||
|
||||
##### New Tag Colors + UI
|
||||
|
||||
- feat: expanded tag color system by [@CyanVoxel](https://github.com/CyanVoxel) in [#709](https://github.com/TagStudioDev/TagStudio/pull/709)
|
||||
- fix(ui): use correct pink tag color by [@CyanVoxel](https://github.com/CyanVoxel) in [431efe4](https://github.com/TagStudioDev/TagStudio/commit/431efe4fe93213141c763e59ca9887215766fd42)
|
||||
- fix(ui): use consistent tag outline colors by [@CyanVoxel](https://github.com/CyanVoxel) in [020a73d](https://github.com/TagStudioDev/TagStudio/commit/020a73d095c74283d6c80426d3c3db8874409952)
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/408753168-c8f82d89-ad7e-4be6-830e-b91cdc58e4c6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTU5ODIsIm5iZiI6MTc0NjY1NTY4MiwicGF0aCI6Ii80NjkzOTgyNy80MDg3NTMxNjgtYzhmODJkODktYWQ3ZS00YmU2LTgzMGUtYjkxY2RjNThlNGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIyMDgwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk1OWNhZGNkOTRiZGJhNGQxNGU1MjJhYTViYTc0OTNiNTA4NDUxODA4OTYxZDUwNzYxZDhmYWZkNzM4NTE3N2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HLnwHyp3BYg8vXo3BtvqBoOqtpQTI1eykqa-L3chLUk)
|
||||
|
||||
##### New Tag Alias UI
|
||||
|
||||
- fix: preview panel aliases not staying up to date with database by [@DandyDev01](https://github.com/DandyDev01) in [#641](https://github.com/TagStudioDev/TagStudio/pull/641)
|
||||
- fix: subtags/parent tags & aliases update the UI for building a tag by [@DandyDev01](https://github.com/DandyDev01) in [#534](https://github.com/TagStudioDev/TagStudio/pull/534)
|
||||
|
||||
#### Translations
|
||||
|
||||
TagStudio now has official translation support! Head to the new settings panel and select from one of the initial languages included. Note that many languages currently have incomplete translations.
|
||||
|
||||
Translation hosting generously provided by [Weblate](https://weblate.org/en/). Check out our [project page](https://hosted.weblate.org/projects/tagstudio/) to help translate TagStudio! Thank you to everyone who's helped contribute to the translations so far!
|
||||
|
||||
- translations: add string tokens for en.json by [@Bamowen](https://github.com/Bamowen) in [#507](https://github.com/TagStudioDev/TagStudio/pull/507)
|
||||
- feat: translations by [@Computerdores](https://github.com/Computerdores) in [#662](https://github.com/TagStudioDev/TagStudio/pull/662)
|
||||
- feat(ui): add language setting by [@CyanVoxel](https://github.com/CyanVoxel) in [#803](https://github.com/TagStudioDev/TagStudio/pull/803)
|
||||
|
||||
Initial Languages:
|
||||
|
||||
- Chinese (Traditional) (68%)
|
||||
- [@brisu](https://github.com/brisu)
|
||||
- Dutch (35%)
|
||||
- [@Pheubel](https://github.com/Pheubel)
|
||||
- Filipino (43%)
|
||||
- [@searinminecraft](https://github.com/searinminecraft)
|
||||
- French (100%)
|
||||
- [@Bamowen](https://github.com/Bamowen), [@alessdangelo](https://github.com/alessdangelo), [@kitsumed](https://github.com/kitsumed), Obscaeris
|
||||
- German (98%)
|
||||
- [@Ryussei](https://github.com/Ryussei), [@Computerdores](https://github.com/Computerdores), Aaron M, [@JoeJoeTV](https://github.com/JoeJoeTV), [@Kurty00](https://github.com/Kurty00)
|
||||
- Hungarian (100%)
|
||||
- [@smileyhead](https://github.com/smileyhead)
|
||||
- Norwegian Bokmål (16%)
|
||||
- [@comradekingu](https://github.com/comradekingu)
|
||||
- Polish (97%)
|
||||
- Anonymous
|
||||
- Portuguese (Brazil) (64%)
|
||||
- [@LoboMetalurgico](https://github.com/LoboMetalurgico), [@SpaceFox1](https://github.com/SpaceFox1), [@DaviMarquezeli](https://github.com/DaviMarquezeli), [@viniciushelder](https://github.com/viniciushelder), Alexander Lennart Formiga Johnsson
|
||||
- Russian (22%)
|
||||
- [@The-Stolas](https://github.com/The-Stolas)
|
||||
- Spanish (57%)
|
||||
- [@gallegonovato](https://github.com/gallegonovato), [@Nginearing](https://github.com/Nginearing), [@noceno](https://github.com/noceno)
|
||||
- Swedish (24%)
|
||||
- [@adampawelec](https://github.com/adampawelec), [@mashed5894](https://github.com/mashed5894)
|
||||
- Tamil (22%)
|
||||
- [@VasigaranAndAngel](https://github.com/VasigaranAndAngel)
|
||||
- Toki Pona (32%)
|
||||
- [@goldstargloww](https://github.com/goldstargloww)
|
||||
- Turkish (22%)
|
||||
- [@Nyghl](https://github.com/Nyghl)
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
- feat: about section by [@mashed5894](https://github.com/mashed5894) in [#712](https://github.com/TagStudioDev/TagStudio/pull/712)
|
||||
- feat(ui): add configurable splash screens by [@CyanVoxel](https://github.com/CyanVoxel) in [#703](https://github.com/TagStudioDev/TagStudio/pull/703)
|
||||
- feat(ui): show filenames in thumbnail grid by [@CyanVoxel](https://github.com/CyanVoxel) in [#633](https://github.com/TagStudioDev/TagStudio/pull/633)
|
||||
- feat(about): clickable links to docs/discord/etc in about modal by [@SkeleyM](https://github.com/SkeleyM) in [#799](https://github.com/TagStudioDev/TagStudio/pull/799)
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix(ui): display all tags in panel during empty search by [@samuellieberman](https://github.com/samuellieberman) in [#328](https://github.com/TagStudioDev/TagStudio/pull/328)
|
||||
- fix: avoid `KeyError` in `add_folders_to_tree()` (fix [#346](https://github.com/TagStudioDev/TagStudio/issues/346)) by [@CyanVoxel](https://github.com/CyanVoxel) in [#347](https://github.com/TagStudioDev/TagStudio/pull/347)
|
||||
- fix: error on closing library by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#484](https://github.com/TagStudioDev/TagStudio/pull/484)
|
||||
- fix: resolution info [#550](https://github.com/TagStudioDev/TagStudio/issues/550) by [@Roc25](https://github.com/Roc25) in [#551](https://github.com/TagStudioDev/TagStudio/pull/551)
|
||||
- fix: remove queued thumnail jobs when closing library by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#583](https://github.com/TagStudioDev/TagStudio/pull/583)
|
||||
- fix: use absolute ffprobe path on macos (Fix [#511](https://github.com/TagStudioDev/TagStudio/issues/511)) by [@CyanVoxel](https://github.com/CyanVoxel) in [#629](https://github.com/TagStudioDev/TagStudio/pull/629)
|
||||
- fix(ui): prevent duplicate parent tags in UI by [@SkeleyM](https://github.com/SkeleyM) in [#665](https://github.com/TagStudioDev/TagStudio/pull/665)
|
||||
- fix: fix -o flag not working if path has whitespace around it by [@python357-1](https://github.com/python357-1) in [#670](https://github.com/TagStudioDev/TagStudio/pull/670)
|
||||
- fix: better file opening compatibility with non-ascii filenames by [@SkeleyM](https://github.com/SkeleyM) in [#667](https://github.com/TagStudioDev/TagStudio/pull/667)
|
||||
- fix: restore environment before launching external programs by [@mashed5894](https://github.com/mashed5894) in [#707](https://github.com/TagStudioDev/TagStudio/pull/707)
|
||||
- fix: have pydub use known ffmpeg + ffprobe locations by [@CyanVoxel](https://github.com/CyanVoxel) in [#724](https://github.com/TagStudioDev/TagStudio/pull/724)
|
||||
- fix: add ".DS_Store" to `GLOBAL_IGNORE_SET` by [@CyanVoxel](https://github.com/CyanVoxel) in [b72a2f2](https://github.com/TagStudioDev/TagStudio/commit/b72a2f233141db4db6aa6be8796b626ebd3f0756)
|
||||
- fix: don't add "._" files to libraries by [@CyanVoxel](https://github.com/CyanVoxel) in [eb1f634](https://github.com/TagStudioDev/TagStudio/commit/eb1f634d386cd8a5ecee1e6ff6a0b7d8811550fa)
|
||||
|
||||
### Changed
|
||||
|
||||
#### SQLite Save File Format
|
||||
|
||||
This was the main focus of this update, and where the majority of development time and resources have been spent since v9.4. These changes include everything that was done to migrate from the JSON format to SQLite starting from the initial SQLite PR, while re-implementing every feature from v9.4 as the initial SQLite PR was based on v9.3.x at the time.
|
||||
|
||||
- refactor!: use SQLite and SQLAlchemy for database backend by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#332](https://github.com/TagStudioDev/TagStudio/pull/332)
|
||||
- feat: make search results more ergonomic by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#498](https://github.com/TagStudioDev/TagStudio/pull/498)
|
||||
- feat: store `Entry` suffix separately by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#503](https://github.com/TagStudioDev/TagStudio/pull/503)
|
||||
- feat: port thumbnail ([#390](https://github.com/TagStudioDev/TagStudio/pull/390)) and related features to v9.5 by [@CyanVoxel](https://github.com/CyanVoxel) in [#522](https://github.com/TagStudioDev/TagStudio/pull/522)
|
||||
- fix: don't check db version with new library by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#536](https://github.com/TagStudioDev/TagStudio/pull/536)
|
||||
- fix(ui): update ui when removing fields by [@DandyDev01](https://github.com/DandyDev01) in [#560](https://github.com/TagStudioDev/TagStudio/pull/560)
|
||||
- feat(parity): backend for aliases and parent tags by [@DandyDev01](https://github.com/DandyDev01) in [#596](https://github.com/TagStudioDev/TagStudio/pull/596)
|
||||
- fix: "open in explorer" opens correct folder by [@KirilBourakov](https://github.com/KirilBourakov) in [#603](https://github.com/TagStudioDev/TagStudio/pull/603)
|
||||
- fix: ui/ux parity fixes for thumbnails and files by [@CyanVoxel](https://github.com/CyanVoxel) in [#608](https://github.com/TagStudioDev/TagStudio/pull/608)
|
||||
- feat(parity): migrate json libraries to sqlite by [@CyanVoxel](https://github.com/CyanVoxel) in [#604](https://github.com/TagStudioDev/TagStudio/pull/604)
|
||||
- fix: clear all setting values when opening a library by [@VasigaranAndAngel](https://github.com/VasigaranAndAngel) in [#622](https://github.com/TagStudioDev/TagStudio/pull/622)
|
||||
- fix: remove/rework windows path tests by [@VasigaranAndAngel](https://github.com/VasigaranAndAngel) in [#625](https://github.com/TagStudioDev/TagStudio/pull/625)
|
||||
- fix: add check to see if library is loaded in filter_items by [@Roc25](https://github.com/Roc25) in [#547](https://github.com/TagStudioDev/TagStudio/pull/547)
|
||||
- fix: multiple macro errors by [@Computerdores](https://github.com/Computerdores) in [#612](https://github.com/TagStudioDev/TagStudio/pull/612)
|
||||
- fix: don't allow blank tag alias values in db by [@CyanVoxel](https://github.com/CyanVoxel) in [#628](https://github.com/TagStudioDev/TagStudio/pull/628)
|
||||
- feat: Reimplement drag drop files on sql migration by [@seakrueger](https://github.com/seakrueger) in [#528](https://github.com/TagStudioDev/TagStudio/pull/528)
|
||||
- fix: stop sqlite db from being updated while running tests by [@python357-1](https://github.com/python357-1) in [#648](https://github.com/TagStudioDev/TagStudio/pull/648)
|
||||
- fix: enter/return adds top result tag by [@SkeleyM](https://github.com/SkeleyM) in [#651](https://github.com/TagStudioDev/TagStudio/pull/651)
|
||||
- fix: show correct unlinked files count by [@SkeleyM](https://github.com/SkeleyM) in [#653](https://github.com/TagStudioDev/TagStudio/pull/653)
|
||||
- feat: implement parent tag search by [@Computerdores](https://github.com/Computerdores) in [#673](https://github.com/TagStudioDev/TagStudio/pull/673)
|
||||
- fix: only close add tag menu with no search by [@SkeleyM](https://github.com/SkeleyM) in [#685](https://github.com/TagStudioDev/TagStudio/pull/685)
|
||||
- fix: drag and drop no longer resets by [@SkeleyM](https://github.com/SkeleyM) in [#710](https://github.com/TagStudioDev/TagStudio/pull/710)
|
||||
- feat(ui): port "create and add tag" to main branch by [@SkeleyM](https://github.com/SkeleyM) in [#711](https://github.com/TagStudioDev/TagStudio/pull/711)
|
||||
- fix: don't add default title field, use proper phrasing for adding files by [@CyanVoxel](https://github.com/CyanVoxel) in [#701](https://github.com/TagStudioDev/TagStudio/pull/701)
|
||||
- fix: preview panel + main window fixes and optimizations by [@CyanVoxel](https://github.com/CyanVoxel) in [#700](https://github.com/TagStudioDev/TagStudio/pull/700)
|
||||
- fix: sort tag results by [@mashed5894](https://github.com/mashed5894) in [#721](https://github.com/TagStudioDev/TagStudio/pull/721)
|
||||
- fix: restore opening last library on startup by [@SkeleyM](https://github.com/SkeleyM) in [#729](https://github.com/TagStudioDev/TagStudio/pull/729)
|
||||
- fix(ui): don't always create tag on enter by [@SkeleyM](https://github.com/SkeleyM) in [#731](https://github.com/TagStudioDev/TagStudio/pull/731)
|
||||
- fix: use tag aliases in tag search by [@CyanVoxel](https://github.com/CyanVoxel) in [#726](https://github.com/TagStudioDev/TagStudio/pull/726)
|
||||
- fix: keep initial id order in `get_entries_full()` by [@CyanVoxel](https://github.com/CyanVoxel) in [#736](https://github.com/TagStudioDev/TagStudio/pull/736)
|
||||
- fix: always catch db mismatch by [@CyanVoxel](https://github.com/CyanVoxel) in [#738](https://github.com/TagStudioDev/TagStudio/pull/738)
|
||||
- fix: relink unlinked entry to existing entry without sql error by [@mashed5894](https://github.com/mashed5894) in [#730](https://github.com/TagStudioDev/TagStudio/issues/730)
|
||||
- fix: refactor and fix bugs with missing_files.py by [@CyanVoxel](https://github.com/CyanVoxel) in [#739](https://github.com/TagStudioDev/TagStudio/pull/739)
|
||||
- fix: dragging files references correct entry IDs [@CyanVoxel](https://github.com/CyanVoxel) in [44ff17c](https://github.com/TagStudioDev/TagStudio/commit/44ff17c0b3f05570e356c112f005dbc14c7cc05d)
|
||||
- ui: port splash screen from Alpha-v9.4 by [@CyanVoxel](https://github.com/CyanVoxel) in [af760ee](https://github.com/TagStudioDev/TagStudio/commit/af760ee61a523c84bab0fb03a68d7465866d0e05)
|
||||
- fix: tags created from tag database now add aliases by [@CyanVoxel](https://github.com/CyanVoxel) in [2903dd2](https://github.com/TagStudioDev/TagStudio/commit/2903dd22c45c02498687073d075bb88886de6b62)
|
||||
- fix: check for tag name parity during JSON migration by [@CyanVoxel](https://github.com/CyanVoxel) in [#748](https://github.com/TagStudioDev/TagStudio/pull/748)
|
||||
- feat(ui): re-implement tag display names on sql by [@CyanVoxel](https://github.com/CyanVoxel) in [#747](https://github.com/TagStudioDev/TagStudio/pull/747)
|
||||
- fix(ui): restore Windows accent color on PySide 6.8.0.1 by [@CyanVoxel](https://github.com/CyanVoxel) in [#755](https://github.com/TagStudioDev/TagStudio/pull/755)
|
||||
- fix(ui): (mostly) fix right-click search option on tags by [@CyanVoxel](https://github.com/CyanVoxel) in [#756](https://github.com/TagStudioDev/TagStudio/pull/756)
|
||||
- feat: copy/paste fields and tags by [@mashed5894](https://github.com/mashed5894) in [#722](https://github.com/TagStudioDev/TagStudio/pull/722)
|
||||
- perf: optimize query methods and reduce preview panel updates by [@CyanVoxel](https://github.com/CyanVoxel) in [#794](https://github.com/TagStudioDev/TagStudio/pull/794)
|
||||
- feat: port file trashing ([#409](https://github.com/TagStudioDev/TagStudio/pull/409)) to v9.5 by [@CyanVoxel](https://github.com/CyanVoxel) in [#792](https://github.com/TagStudioDev/TagStudio/pull/792)
|
||||
- fix: prevent future library versions from being opened by [@CyanVoxel](https://github.com/CyanVoxel) in [bcf3b2f](https://github.com/TagStudioDev/TagStudio/commit/bcf3b2f96bc8b876ca4b0c1d1882ce14a190f249)
|
||||
|
||||
#### UI/UX
|
||||
|
||||
- feat(ui): pre-select default tag name in `BuildTagPanel` by [@Cool-Game-Dev](https://github.com/Cool-Game-Dev) in [#592](https://github.com/TagStudioDev/TagStudio/pull/592)
|
||||
- feat(ui): keyboard navigation for editing tags by [@Computerdores](https://github.com/Computerdores) in [#407](https://github.com/TagStudioDev/TagStudio/pull/407)
|
||||
- feat(ui): use tag query as default new tag name by [@CyanVoxel](https://github.com/CyanVoxel) in [29c0dfd](https://github.com/TagStudioDev/TagStudio/commit/29c0dfdb2d88e8f473e27c7f1fe7ede6e5bd0feb)
|
||||
- feat(ui): shortcut to add tags to selected entries; change click behavior of tags to edit by [@CyanVoxel](https://github.com/CyanVoxel) in [#749](https://github.com/TagStudioDev/TagStudio/pull/749)
|
||||
- fix(ui): use consistent dark mode colors for all systems by [@CyanVoxel](https://github.com/CyanVoxel) in [#752](https://github.com/TagStudioDev/TagStudio/pull/752)
|
||||
- fix(ui): use camera white balance for raw images by [@CyanVoxel](https://github.com/CyanVoxel) in [6ee5304](https://github.com/TagStudioDev/TagStudio/commit/6ee5304b52f217af0f5df543fcb389649203d6b2)
|
||||
- Mixed field editing has been limited due to various bugs in both the JSON and SQL implementations. This will be re-implemented in a future release.
|
||||
- fix(ui): improve tagging ux by [@CyanVoxel](https://github.com/CyanVoxel) in [#633](https://github.com/TagStudioDev/TagStudio/pull/633)
|
||||
- fix(ui): hide library actions when no library is open by [@CyanVoxel](https://github.com/CyanVoxel) in [#787](https://github.com/TagStudioDev/TagStudio/pull/787)
|
||||
- refactor(ui): recycle tag list in TagSearchPanel by [@CyanVoxel](https://github.com/CyanVoxel) in [#788](https://github.com/TagStudioDev/TagStudio/pull/788)
|
||||
- feat(ui): add tag view limit dropdown
|
||||
- fix(ui): expand usage of esc and enter for modals by [@CyanVoxel](https://github.com/CyanVoxel) in [#793](https://github.com/TagStudioDev/TagStudio/pull/793)
|
||||
|
||||
#### Performance
|
||||
|
||||
- feat: improve performance of "Delete Missing Entries" by [@Toby222](https://github.com/Toby222) and [@Computerdores](https://github.com/Computerdores) in [#696](https://github.com/TagStudioDev/TagStudio/pull/696)
|
||||
|
||||
#### Internal Changes
|
||||
|
||||
- refactor: combine open launch args by [@UnusualEgg](https://github.com/UnusualEgg) in [#364](https://github.com/TagStudioDev/TagStudio/pull/364)
|
||||
- feat: add date_created, date_modified, and date_added columns to entries table by [@CyanVoxel](https://github.com/CyanVoxel) in [#740](https://github.com/TagStudioDev/TagStudio/pull/740)
|
||||
|
||||
## [9.5.0 Pre-Release 4] - 2025-02-17
|
||||
|
||||
### Added
|
||||
|
||||
#### Custom User-Created Tag Colors ([@CyanVoxel](https://github.com/CyanVoxel) in [#801](https://github.com/TagStudioDev/TagStudio/pull/801))
|
||||
|
||||
Create your own custom tag colors via the new Tag Color Manager! Tag colors are assigned a namespace (group) and include a name, primary color, and optional secondary color. By default the secondary color is used for the tag text color, but this can also be toggled to apply to the border color as well!
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/413668576-b591f1fe-1c44-4d82-b6e5-d166590aeab1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTQ3MTYsIm5iZiI6MTc0NjY1NDQxNiwicGF0aCI6Ii80NjkzOTgyNy80MTM2Njg1NzYtYjU5MWYxZmUtMWM0NC00ZDgyLWI2ZTUtZDE2NjU5MGFlYWIxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIxNDY1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhYzUwZmExZjRlMWI4YzJjZTZmNDRiMjFiN2ZlZjg4ZjE3MWM4NzBkNmJlZWNjMzg2OWU5YTE2OWVmZTA2YTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nEs6bk1euKTEkIqDipNJBrXHbHegb3PHWoW3tKI02_8)
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/413668612-96e81b08-6993-4a5e-96d0-3b05b50fbe44.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTQ3MTYsIm5iZiI6MTc0NjY1NDQxNiwicGF0aCI6Ii80NjkzOTgyNy80MTM2Njg2MTItOTZlODFiMDgtNjk5My00YTVlLTk2ZDAtM2IwNWI1MGZiZTQ0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIxNDY1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhOGU2NjA2ZjRhMjNjZGYxZDE1ZWYzZmVjN2RjM2Q0YzA1NTcwZGE5OGFkMjc2MDIzMTk1YTFlYjY2NTQxNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VD2trGcVKQVKUpzVog1UhZUM0JRcEHUhwGCiHpZ8zF0)
|
||||
|
||||
#### Translations
|
||||
|
||||
TagStudio now has official translation support! Head to the new settings panel and select from one of the initial languages included. Note that many languages currently have incomplete translations.
|
||||
|
||||
Translation hosting generously provided by [Weblate](https://weblate.org/en/). Check out our [project page](https://hosted.weblate.org/projects/tagstudio/) to help translate TagStudio! Thank you to everyone who's helped contribute to the translations so far!
|
||||
|
||||
- translations: add string tokens for en.json by [@Bamowen](https://github.com/Bamowen) in [#507](https://github.com/TagStudioDev/TagStudio/pull/507)
|
||||
- feat: translations by [@Computerdores](https://github.com/Computerdores) in [#662](https://github.com/TagStudioDev/TagStudio/pull/662)
|
||||
- feat(ui): add language setting by [@CyanVoxel](https://github.com/CyanVoxel) in [#803](https://github.com/TagStudioDev/TagStudio/pull/803)
|
||||
|
||||
Initial Languages:
|
||||
|
||||
- Chinese (Traditional) (68%)
|
||||
- [@brisu](https://github.com/brisu)
|
||||
- Dutch (35%)
|
||||
- [@Pheubel](https://github.com/Pheubel)
|
||||
- Filipino (15%)
|
||||
- [@searinminecraft](https://github.com/searinminecraft)
|
||||
- French (89%)
|
||||
- [@Bamowen](https://github.com/Bamowen), [@alessdangelo](https://github.com/alessdangelo), [@kitsumed](https://github.com/kitsumed), Obscaeris
|
||||
- German (73%)
|
||||
- [@Ryussei](https://github.com/Ryussei), [@Computerdores](https://github.com/Computerdores), Aaron M
|
||||
- Hungarian (89%)
|
||||
- [@smileyhead](https://github.com/smileyhead)
|
||||
- Norwegian Bokmål (16%)
|
||||
- [@comradekingu](https://github.com/comradekingu)
|
||||
- Polish (76%)
|
||||
- Anonymous
|
||||
- Portuguese (Brazil) (22%)
|
||||
- [@LoboMetalurgico](https://github.com/LoboMetalurgico), [@SpaceFox1](https://github.com/SpaceFox1)
|
||||
- Russian (22%)
|
||||
- [@The-Stolas](https://github.com/The-Stolas)
|
||||
- Spanish (46%)
|
||||
- [@gallegonovato](https://github.com/gallegonovato), [@Nginearing](https://github.com/Nginearing), [@noceno](https://github.com/noceno)
|
||||
- Swedish (24%)
|
||||
- [@adampawelec](https://github.com/adampawelec), [@mashed5894](https://github.com/mashed5894)
|
||||
- Tamil (22%)
|
||||
- [@VasigaranAndAngel](https://github.com/VasigaranAndAngel)
|
||||
- Toki Pona (32%)
|
||||
- [@goldstargloww](https://github.com/goldstargloww)
|
||||
- Turkish (22%)
|
||||
- [@Nyghl](https://github.com/Nyghl)
|
||||
|
||||
### Fixed
|
||||
|
||||
- feat(about): clickable links to docs/discord/etc in about modal by [@SkeleyM](https://github.com/SkeleyM) in [#799](https://github.com/TagStudioDev/TagStudio/pull/799)
|
||||
|
||||
### Internal Changes
|
||||
|
||||
This release increases the internal `DB_VERSION` to 8. Libraries created with this version of TagStudio can still be opened in earlier v9.5.0 pre-release versions, however the behavior of custom color borders will not be identical to the behavior in this PR. Otherwise it should still be possible to use any custom colors created in this version in these earlier pre-releases (but not really recommended).
|
||||
|
||||
## [9.5.0 Pre-Release 3] - 2025-02-10
|
||||
|
||||
### Added
|
||||
|
||||
##### [#743](https://github.com/TagStudioDev/TagStudio/pull/743) by [@CyanVoxel](https://github.com/CyanVoxel)
|
||||
|
||||
Added "Smartcase" and Globless Path Search
|
||||
|
||||
- `path: temp`: Returns all paths that have "temp" **(Case insensitive)** somewhere in the name.
|
||||
|
||||
- `path: Temp`: Returns all paths that have "Temp" **(Case sensitive)** somewhere in the name.
|
||||
|
||||
|
||||
Glob Patterns w/ Smartcase
|
||||
|
||||
- `path: *temp*`: Returns all paths that have "temp" **(Case insensitive)** somewhere in the name.
|
||||
|
||||
- `path: *Temp*`: Returns all paths that have "Temp" **(Case sensitive)** somewhere in the name.
|
||||
|
||||
- `path: temp*`: Returns all paths that start with "temp" **(Case insensitive)** somewhere in the name.
|
||||
|
||||
- `path: Temp*`: Returns all paths that start with "Temp" **(Case sensitive)** somewhere in the name.
|
||||
|
||||
- `path: *temp`: Returns all paths that end with "temp" **(Case insensitive)** somewhere in the name.
|
||||
|
||||
- `path: *TEmP`: Returns all paths that end with "TEmP" **(Case sensitive)** somewhere in the name.
|
||||
|
||||
|
||||
##### [#788](https://github.com/TagStudioDev/TagStudio/pull/788) by [@CyanVoxel](https://github.com/CyanVoxel)
|
||||
|
||||
- Added a "View Limit" dropdown to tag search boxes to limit the number of on-screen tags. Previously this limit was hardcoded to 100, but now options range from 25 to unlimited.
|
||||
[](https://private-user-images.githubusercontent.com/46939827/411701461-7f7da065-888d-4fe5-a4e7-f99447bcce98.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTQ3MTYsIm5iZiI6MTc0NjY1NDQxNiwicGF0aCI6Ii80NjkzOTgyNy80MTE3MDE0NjEtN2Y3ZGEwNjUtODg4ZC00ZmU1LWE0ZTctZjk5NDQ3YmNjZTk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIxNDY1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVlZjVhZjYyNWQwY2FmMjhmMWI1MzI5ZDdjYWMxMmM0N2M0Nzc4MmY1YjE0NWY4MjVhZmIyMDI1NzQzY2M0YmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.a3xUaH5r3HsDgOb6-lo3T-xSRRSy7dDOrln5i62KFP8)
|
||||
|
||||
### Changed
|
||||
|
||||
- fix(ui): expand usage of esc and enter for modals by [@CyanVoxel](https://github.com/CyanVoxel) in [#793](https://github.com/TagStudioDev/TagStudio/pull/793)
|
||||
- perf: optimize query methods and reduce preview panel updates by [@CyanVoxel](https://github.com/CyanVoxel) in [#794](https://github.com/TagStudioDev/TagStudio/pull/794)
|
||||
|
||||
##### [#788](https://github.com/TagStudioDev/TagStudio/pull/788) by [@CyanVoxel](https://github.com/CyanVoxel)
|
||||
|
||||
- Improved performance of tag search boxes, including the tag manager
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix(ui): hide library actions when no library is open by [@CyanVoxel](https://github.com/CyanVoxel) in [#787](https://github.com/TagStudioDev/TagStudio/pull/787)
|
||||
- feat: port file trashing ([#409](https://github.com/TagStudioDev/TagStudio/pull/409)) to v9.5 by [@CyanVoxel](https://github.com/CyanVoxel) in [#792](https://github.com/TagStudioDev/TagStudio/pull/792)
|
||||
|
||||
### Docs
|
||||
|
||||
- Added references to alternative POSIX shells, as well as pyenv to CONTRIBUTING.md by [@ChloeZamorano](https://github.com/ChloeZamorano) in [#791](https://github.com/TagStudioDev/TagStudio/pull/791)
|
||||
## [9.5.0 Pre-Release 2] - 2025-02-03
|
||||
|
||||
### Added
|
||||
|
||||
##### [#784](https://github.com/TagStudioDev/TagStudio/pull/784) by [@CyanVoxel](https://github.com/CyanVoxel)
|
||||
|
||||
- Add Ctrl+M shortcut to open the "Tag Manager"
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix: don't wrap field names too early by [@CyanVoxel](https://github.com/CyanVoxel) in [2215403](https://github.com/TagStudioDev/TagStudio/commit/2215403201e3b416a43ead0a322688180af6d71b) and [90a826d](https://github.com/TagStudioDev/TagStudio/commit/90a826d12804b3386a0b9003abb20f23f88ab3be)
|
||||
- fix: save all tag attributes from "Create & Add" modal by [@SkeleyM](https://github.com/SkeleyM) in [#762](https://github.com/TagStudioDev/TagStudio/pull/762)
|
||||
- fix: allow tag names with colons in search by [@SkeleyM](https://github.com/SkeleyM) in [#765](https://github.com/TagStudioDev/TagStudio/pull/765)
|
||||
- fix: catch `ParsingError` by [@CyanVoxel](https://github.com/CyanVoxel) in [#779](https://github.com/TagStudioDev/TagStudio/pull/779)
|
||||
- fix: patch incorrect description type & invalid disambiguation_id refs by [@CyanVoxel](https://github.com/CyanVoxel) in [#782](https://github.com/TagStudioDev/TagStudio/pull/782)
|
||||
|
||||
##### [#784](https://github.com/TagStudioDev/TagStudio/pull/784) by [@CyanVoxel](https://github.com/CyanVoxel)
|
||||
|
||||
- Reset tag search box and focus each time a tag search panel is opened
|
||||
- Include tag parents in tag search results (v9.4 parity)
|
||||
- Lowercase tag names now get properly sorted with uppercase ones
|
||||
- Don't include tag display names in "closeness" factor when searching
|
||||
- Escape "&" characters inside tag names so Qt doesn't treat them as mnemonics
|
||||
- Set minimum tag width
|
||||
- Fix "Add Tags" panel missing its window title when accessing from the keyboard shortcut
|
||||
|
||||
### Changed
|
||||
|
||||
##### [#784](https://github.com/TagStudioDev/TagStudio/pull/784) by [@CyanVoxel](https://github.com/CyanVoxel)
|
||||
|
||||
- The "use for disambiguation" button has been moved to the right-hand side of parent tags in order to prevent accidental clicks involving the left-hand "remove tag" button
|
||||
- Add "Create & Add" button to the bottom of all non-whitespace searches, even if they return some tags
|
||||
- The awkward "+" button next to tags in the "Add Tags" panel has been removed in favor of clicking on tags themselves
|
||||
- Improved visual feedback for highlighting, keyboard focusing, and clicking tags
|
||||
- The clickable area of the "-" button on tags has been increased and has visual feedback when you hover and click it
|
||||
- You can now tab into the tag search list and add tags with a spacebar press (previously possible but very janky)
|
||||
- In tag search panels, pressing the Esc key will return your focus to the search bar and highlight your previous query. If the search box is already highlighted, pressing Esc will close the modal
|
||||
- In modals such as the "Add Tag" and "Edit Tag" panels, pressing Esc will cancel the operation and close the modal
|
||||
|
||||
### Internal Changes
|
||||
|
||||
- refactor: wrap migration_iterator lambda in a try/except block by [@CyanVoxel](https://github.com/CyanVoxel) in [#773](https://github.com/TagStudioDev/TagStudio/pull/773)
|
||||
|
||||
### Docs
|
||||
|
||||
- docs: update field and library pages by [@CyanVoxel](https://github.com/CyanVoxel) in [f5ff4d7](https://github.com/TagStudioDev/TagStudio/commit/f5ff4d78c1ad53134e9c64698886aee68c0f1dc1)
|
||||
- docs: add information about "tag manager" by [@CyanVoxel](https://github.com/CyanVoxel) in [9bdbafa](https://github.com/TagStudioDev/TagStudio/commit/9bdbafa40c4274922f6533b5b5fcee9a4fe43030)
|
||||
- docs: add note about glob searching in the readme by [@CyanVoxel](https://github.com/CyanVoxel) in [6e402ac](https://github.com/TagStudioDev/TagStudio/commit/6e402ac34d2d60e71fbd36ad234fe3914d5eb8e0)
|
||||
- docs: add library_search page by [@CyanVoxel](https://github.com/CyanVoxel) in [5be7dfc](https://github.com/TagStudioDev/TagStudio/commit/5be7dfc314b21042c18b2f08893f2b452d12394a)
|
||||
- docs: docs: add more links to index.md by [@CyanVoxel](https://github.com/CyanVoxel) in [d795889](https://github.com/TagStudioDev/TagStudio/commit/d7958892b7762586837204d686a6a2a993e3c26e)
|
||||
- docs: fix typo for "category" in usage.md by [@pinheadtf2](https://github.com/pinheadtf2) in [#760](https://github.com/TagStudioDev/TagStudio/pull/760)
|
||||
- fix(docs): fix screenshot sometimes not rendering by [@SkeleyM](https://github.com/SkeleyM) in [#775](https://github.com/TagStudioDev/TagStudio/pull/775)
|
||||
## [9.5.0 Pre-Release 1] - 2025-01-31
|
||||
|
||||
### Added
|
||||
|
||||
#### Overhauled Search Engine
|
||||
|
||||
##### Boolean Operators
|
||||
|
||||
- feat: implement query language by [@Computerdores](https://github.com/Computerdores) in [#606](https://github.com/TagStudioDev/TagStudio/pull/606)
|
||||
- feat: optimize AND queries by [@Computerdores](https://github.com/Computerdores) in [#679](https://github.com/TagStudioDev/TagStudio/pull/679)
|
||||
|
||||
##### Filetype, Mediatype, and Glob Path Searches
|
||||
|
||||
- fix: remove wildcard requirement for tags by [@Tyrannicodin](https://github.com/Tyrannicodin) in [#481](https://github.com/TagStudioDev/TagStudio/pull/481)
|
||||
- feat: add filetype and mediatype searches by [@python357-1](https://github.com/python357-1) in [#575](https://github.com/TagStudioDev/TagStudio/pull/575)
|
||||
- feat: make path search use globs by [@python357-1](https://github.com/python357-1) in [#582](https://github.com/TagStudioDev/TagStudio/pull/582)
|
||||
- feat: implement search equivalence of "jpg" and "jpeg" filetypes by [@Computerdores](https://github.com/Computerdores) in [#649](https://github.com/TagStudioDev/TagStudio/pull/649)
|
||||
|
||||
##### Sortable Results
|
||||
|
||||
- feat: sort by "date added" in library by [@Computerdores](https://github.com/Computerdores) in [#674](https://github.com/TagStudioDev/TagStudio/pull/674)
|
||||
|
||||
##### Autocomplete
|
||||
|
||||
- feat: add autocomplete for search engine by [@python357-1](https://github.com/python357-1) in [#586](https://github.com/TagStudioDev/TagStudio/pull/586)
|
||||
|
||||
#### Replaced "Tag Fields" with Tag Categories
|
||||
|
||||
Instead of tags needing to be added to a tag field type such as "Meta Tags", "Content Tags", or just the "Tags" field, tags are now added directly to file entries with no intermediary step. While tag field types offered a way to further organize tags, it was cumbersome, inflexible, and simply not fully fleshed out. Tag Categories offer all of the previous (intentional) functionality while greatly increasing the ease of use and customization.
|
||||
|
||||
- feat!: tag categories by [@CyanVoxel](https://github.com/CyanVoxel) in [#655](https://github.com/TagStudioDev/TagStudio/pull/655)
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/400138597-0b92eca5-db8f-4e3e-954b-1b4f3795f073.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTUwODcsIm5iZiI6MTc0NjY1NDc4NywicGF0aCI6Ii80NjkzOTgyNy80MDAxMzg1OTctMGI5MmVjYTUtZGI4Zi00ZTNlLTk1NGItMWI0ZjM3OTVmMDczLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIxNTMwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM1M2EwNGFjYmJiM2QwZjg2YzNmNTVjMGYwZDJkZGJkZTg5NjZjNDFhNTYyNDE0OGNlOWFhNzRkMzE3MjBkNzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.B5NRZmHygdHlMy2ZnZtHjfOs83jjEliwfxoe3eMBnEQ)
|
||||
|
||||
#### Thumbnails and File Previews
|
||||
|
||||
##### New Thumbnail Support
|
||||
|
||||
- feat: add svg thumbnail support (port [#442](https://github.com/TagStudioDev/TagStudio/pull/442)) by [@Tyrannicodin](https://github.com/Tyrannicodin) and [@CyanVoxel](https://github.com/CyanVoxel) in [#540](https://github.com/TagStudioDev/TagStudio/pull/540)
|
||||
- feat: add pdf thumbnail support (port [#378](https://github.com/TagStudioDev/TagStudio/pull/378)) by [@Heiholf](https://github.com/Heiholf) and [@CyanVoxel](https://github.com/CyanVoxel) in [#543](https://github.com/TagStudioDev/TagStudio/pull/543)
|
||||
- feat: add ePub thumbnail support (port [#387](https://github.com/TagStudioDev/TagStudio/pull/387)) by [@Heiholf](https://github.com/Heiholf) and [@CyanVoxel](https://github.com/CyanVoxel) in [#539](https://github.com/TagStudioDev/TagStudio/pull/539)
|
||||
- feat: add OpenDocument thumbnail support (port [#366](https://github.com/TagStudioDev/TagStudio/pull/366)) by [@Joshua-Beatty](https://github.com/Joshua-Beatty) and [@CyanVoxel](https://github.com/CyanVoxel) in [#545](https://github.com/TagStudioDev/TagStudio/pull/545)
|
||||
- feat: add JXL thumbnail and animated APNG + WEBP support (port [#344](https://github.com/TagStudioDev/TagStudio/pull/344) and partially port [#357](https://github.com/TagStudioDev/TagStudio/pull/357)) by [@BPplays](https://github.com/BPplays) and [@CyanVoxel](https://github.com/CyanVoxel) in [#549](https://github.com/TagStudioDev/TagStudio/pull/549)
|
||||
- fix: catch ImportError for pillow_jxl module by [@CyanVoxel](https://github.com/CyanVoxel) in [a2f9685](https://github.com/TagStudioDev/TagStudio/commit/a2f9685bc0d744ea6f5334c6d2926aad3f6d375a)
|
||||
|
||||
##### Audio Playback
|
||||
|
||||
- feat: audio playback by [@csponge](https://github.com/csponge) in [#576](https://github.com/TagStudioDev/TagStudio/pull/576)
|
||||
- feat(ui): add audio volume slider by [@SkeleyM](https://github.com/SkeleyM) in [#691](https://github.com/TagStudioDev/TagStudio/pull/691)
|
||||
|
||||
##### Thumbnail Caching
|
||||
|
||||
- feat(ui): add thumbnail caching by [@CyanVoxel](https://github.com/CyanVoxel) in [#694](https://github.com/TagStudioDev/TagStudio/pull/694)
|
||||
|
||||
#### Tags
|
||||
|
||||
##### Delete Tags _(Finally!)_
|
||||
|
||||
- feat: remove and create tags from tag database panel by [@DandyDev01](https://github.com/DandyDev01) in [#569](https://github.com/TagStudioDev/TagStudio/pull/569)
|
||||
|
||||
##### New Tag Colors + UI
|
||||
|
||||
- feat: expanded tag color system by [@CyanVoxel](https://github.com/CyanVoxel) in [#709](https://github.com/TagStudioDev/TagStudio/pull/709)
|
||||
- fix(ui): use correct pink tag color by [@CyanVoxel](https://github.com/CyanVoxel) in [431efe4](https://github.com/TagStudioDev/TagStudio/commit/431efe4fe93213141c763e59ca9887215766fd42)
|
||||
- fix(ui): use consistent tag outline colors by [@CyanVoxel](https://github.com/CyanVoxel) in [020a73d](https://github.com/TagStudioDev/TagStudio/commit/020a73d095c74283d6c80426d3c3db8874409952)
|
||||
|
||||
[](https://private-user-images.githubusercontent.com/46939827/408753168-c8f82d89-ad7e-4be6-830e-b91cdc58e4c6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDY2NTUwODcsIm5iZiI6MTc0NjY1NDc4NywicGF0aCI6Ii80NjkzOTgyNy80MDg3NTMxNjgtYzhmODJkODktYWQ3ZS00YmU2LTgzMGUtYjkxY2RjNThlNGM2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTA3VDIxNTMwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI3ZDk2MDg5ODVjYzA2ZGU2Njc1ODE5M2U4OWU4ZGMwY2MxNzUzM2M2YmM2ZmRiMTdlOTkyNGM3MjlhMWNiOWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.0RYUWgVW8VFvu2unzdWHtDCE4USYM77OcMvWeZkd8Hs)
|
||||
|
||||
##### New Tag Alias UI
|
||||
|
||||
- fix: preview panel aliases not staying up to date with database by [@DandyDev01](https://github.com/DandyDev01) in [#641](https://github.com/TagStudioDev/TagStudio/pull/641)
|
||||
- fix: subtags/parent tags & aliases update the UI for building a tag by [@DandyDev01](https://github.com/DandyDev01) in [#534](https://github.com/TagStudioDev/TagStudio/pull/534)
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
- feat: about section by [@mashed5894](https://github.com/mashed5894) in [#712](https://github.com/TagStudioDev/TagStudio/pull/712)
|
||||
- feat(ui): add configurable splash screens by [@CyanVoxel](https://github.com/CyanVoxel) in [#703](https://github.com/TagStudioDev/TagStudio/pull/703)
|
||||
- feat(ui): show filenames in thumbnail grid by [@CyanVoxel](https://github.com/CyanVoxel) in [#633](https://github.com/TagStudioDev/TagStudio/pull/633)
|
||||
|
||||
### Fixed
|
||||
|
||||
- fix(ui): display all tags in panel during empty search by [@samuellieberman](https://github.com/samuellieberman) in [#328](https://github.com/TagStudioDev/TagStudio/pull/328)
|
||||
- fix: avoid `KeyError` in `add_folders_to_tree()` (fix [#346](https://github.com/TagStudioDev/TagStudio/issues/346)) by [@CyanVoxel](https://github.com/CyanVoxel) in [#347](https://github.com/TagStudioDev/TagStudio/pull/347)
|
||||
- fix: error on closing library by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#484](https://github.com/TagStudioDev/TagStudio/pull/484)
|
||||
- fix: resolution info [#550](https://github.com/TagStudioDev/TagStudio/issues/550) by [@Roc25](https://github.com/Roc25) in [#551](https://github.com/TagStudioDev/TagStudio/pull/551)
|
||||
- fix: remove queued thumnail jobs when closing library by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#583](https://github.com/TagStudioDev/TagStudio/pull/583)
|
||||
- fix: use absolute ffprobe path on macos (Fix [#511](https://github.com/TagStudioDev/TagStudio/issues/511)) by [@CyanVoxel](https://github.com/CyanVoxel) in [#629](https://github.com/TagStudioDev/TagStudio/pull/629)
|
||||
- fix(ui): prevent duplicate parent tags in UI by [@SkeleyM](https://github.com/SkeleyM) in [#665](https://github.com/TagStudioDev/TagStudio/pull/665)
|
||||
- fix: fix -o flag not working if path has whitespace around it by [@python357-1](https://github.com/python357-1) in [#670](https://github.com/TagStudioDev/TagStudio/pull/670)
|
||||
- fix: better file opening compatibility with non-ascii filenames by [@SkeleyM](https://github.com/SkeleyM) in [#667](https://github.com/TagStudioDev/TagStudio/pull/667)
|
||||
- fix: restore environment before launching external programs by [@mashed5894](https://github.com/mashed5894) in [#707](https://github.com/TagStudioDev/TagStudio/pull/707)
|
||||
- fix: have pydub use known ffmpeg + ffprobe locations by [@CyanVoxel](https://github.com/CyanVoxel) in [#724](https://github.com/TagStudioDev/TagStudio/pull/724)
|
||||
- fix: add ".DS_Store" to `GLOBAL_IGNORE_SET` by [@CyanVoxel](https://github.com/CyanVoxel) in [b72a2f2](https://github.com/TagStudioDev/TagStudio/commit/b72a2f233141db4db6aa6be8796b626ebd3f0756)
|
||||
- fix: don't add "._" files to libraries by [@CyanVoxel](https://github.com/CyanVoxel) in [eb1f634](https://github.com/TagStudioDev/TagStudio/commit/eb1f634d386cd8a5ecee1e6ff6a0b7d8811550fa)
|
||||
|
||||
### Changed
|
||||
|
||||
#### SQLite Save File Format
|
||||
|
||||
This was the main focus of this update, and where the majority of development time and resources have been spent since v9.4. These changes include everything that was done to migrate from the JSON format to SQLite starting from the initial SQLite PR, while re-implementing every feature from v9.4 as the initial SQLite PR was based on v9.3.x at the time.
|
||||
|
||||
- refactor!: use SQLite and SQLAlchemy for database backend by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#332](https://github.com/TagStudioDev/TagStudio/pull/332)
|
||||
- feat: make search results more ergonomic by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#498](https://github.com/TagStudioDev/TagStudio/pull/498)
|
||||
- feat: store `Entry` suffix separately by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#503](https://github.com/TagStudioDev/TagStudio/pull/503)
|
||||
- feat: port thumbnail ([#390](https://github.com/TagStudioDev/TagStudio/pull/390)) and related features to v9.5 by [@CyanVoxel](https://github.com/CyanVoxel) in [#522](https://github.com/TagStudioDev/TagStudio/pull/522)
|
||||
- fix: don't check db version with new library by [@yedpodtrzitko](https://github.com/yedpodtrzitko) in [#536](https://github.com/TagStudioDev/TagStudio/pull/536)
|
||||
- fix(ui): update ui when removing fields by [@DandyDev01](https://github.com/DandyDev01) in [#560](https://github.com/TagStudioDev/TagStudio/pull/560)
|
||||
- feat(parity): backend for aliases and parent tags by [@DandyDev01](https://github.com/DandyDev01) in [#596](https://github.com/TagStudioDev/TagStudio/pull/596)
|
||||
- fix: "open in explorer" opens correct folder by [@KirilBourakov](https://github.com/KirilBourakov) in [#603](https://github.com/TagStudioDev/TagStudio/pull/603)
|
||||
- fix: ui/ux parity fixes for thumbnails and files by [@CyanVoxel](https://github.com/CyanVoxel) in [#608](https://github.com/TagStudioDev/TagStudio/pull/608)
|
||||
- feat(parity): migrate json libraries to sqlite by [@CyanVoxel](https://github.com/CyanVoxel) in [#604](https://github.com/TagStudioDev/TagStudio/pull/604)
|
||||
- fix: clear all setting values when opening a library by [@VasigaranAndAngel](https://github.com/VasigaranAndAngel) in [#622](https://github.com/TagStudioDev/TagStudio/pull/622)
|
||||
- fix: remove/rework windows path tests by [@VasigaranAndAngel](https://github.com/VasigaranAndAngel) in [#625](https://github.com/TagStudioDev/TagStudio/pull/625)
|
||||
- fix: add check to see if library is loaded in filter_items by [@Roc25](https://github.com/Roc25) in [#547](https://github.com/TagStudioDev/TagStudio/pull/547)
|
||||
- fix: multiple macro errors by [@Computerdores](https://github.com/Computerdores) in [#612](https://github.com/TagStudioDev/TagStudio/pull/612)
|
||||
- fix: don't allow blank tag alias values in db by [@CyanVoxel](https://github.com/CyanVoxel) in [#628](https://github.com/TagStudioDev/TagStudio/pull/628)
|
||||
- feat: Reimplement drag drop files on sql migration by [@seakrueger](https://github.com/seakrueger) in [#528](https://github.com/TagStudioDev/TagStudio/pull/528)
|
||||
- fix: stop sqlite db from being updated while running tests by [@python357-1](https://github.com/python357-1) in [#648](https://github.com/TagStudioDev/TagStudio/pull/648)
|
||||
- fix: enter/return adds top result tag by [@SkeleyM](https://github.com/SkeleyM) in [#651](https://github.com/TagStudioDev/TagStudio/pull/651)
|
||||
- fix: show correct unlinked files count by [@SkeleyM](https://github.com/SkeleyM) in [#653](https://github.com/TagStudioDev/TagStudio/pull/653)
|
||||
- feat: implement parent tag search by [@Computerdores](https://github.com/Computerdores) in [#673](https://github.com/TagStudioDev/TagStudio/pull/673)
|
||||
- fix: only close add tag menu with no search by [@SkeleyM](https://github.com/SkeleyM) in [#685](https://github.com/TagStudioDev/TagStudio/pull/685)
|
||||
- fix: drag and drop no longer resets by [@SkeleyM](https://github.com/SkeleyM) in [#710](https://github.com/TagStudioDev/TagStudio/pull/710)
|
||||
- feat(ui): port "create and add tag" to main branch by [@SkeleyM](https://github.com/SkeleyM) in [#711](https://github.com/TagStudioDev/TagStudio/pull/711)
|
||||
- fix: don't add default title field, use proper phrasing for adding files by [@CyanVoxel](https://github.com/CyanVoxel) in [#701](https://github.com/TagStudioDev/TagStudio/pull/701)
|
||||
- fix: preview panel + main window fixes and optimizations by [@CyanVoxel](https://github.com/CyanVoxel) in [#700](https://github.com/TagStudioDev/TagStudio/pull/700)
|
||||
- fix: sort tag results by [@mashed5894](https://github.com/mashed5894) in [#721](https://github.com/TagStudioDev/TagStudio/pull/721)
|
||||
- fix: restore opening last library on startup by [@SkeleyM](https://github.com/SkeleyM) in [#729](https://github.com/TagStudioDev/TagStudio/pull/729)
|
||||
- fix(ui): don't always create tag on enter by [@SkeleyM](https://github.com/SkeleyM) in [#731](https://github.com/TagStudioDev/TagStudio/pull/731)
|
||||
- fix: use tag aliases in tag search by [@CyanVoxel](https://github.com/CyanVoxel) in [#726](https://github.com/TagStudioDev/TagStudio/pull/726)
|
||||
- fix: keep initial id order in `get_entries_full()` by [@CyanVoxel](https://github.com/CyanVoxel) in [#736](https://github.com/TagStudioDev/TagStudio/pull/736)
|
||||
- fix: always catch db mismatch by [@CyanVoxel](https://github.com/CyanVoxel) in [#738](https://github.com/TagStudioDev/TagStudio/pull/738)
|
||||
- fix: relink unlinked entry to existing entry without sql error by [@mashed5894](https://github.com/mashed5894) in [#730](https://github.com/TagStudioDev/TagStudio/issues/730)
|
||||
- fix: refactor and fix bugs with missing_files.py by [@CyanVoxel](https://github.com/CyanVoxel) in [#739](https://github.com/TagStudioDev/TagStudio/pull/739)
|
||||
- fix: dragging files references correct entry IDs [@CyanVoxel](https://github.com/CyanVoxel) in [44ff17c](https://github.com/TagStudioDev/TagStudio/commit/44ff17c0b3f05570e356c112f005dbc14c7cc05d)
|
||||
- ui: port splash screen from Alpha-v9.4 by [@CyanVoxel](https://github.com/CyanVoxel) in [af760ee](https://github.com/TagStudioDev/TagStudio/commit/af760ee61a523c84bab0fb03a68d7465866d0e05)
|
||||
- fix: tags created from tag database now add aliases by [@CyanVoxel](https://github.com/CyanVoxel) in [2903dd2](https://github.com/TagStudioDev/TagStudio/commit/2903dd22c45c02498687073d075bb88886de6b62)
|
||||
- fix: check for tag name parity during JSON migration by [@CyanVoxel](https://github.com/CyanVoxel) in [#748](https://github.com/TagStudioDev/TagStudio/pull/748)
|
||||
- feat(ui): re-implement tag display names on sql by [@CyanVoxel](https://github.com/CyanVoxel) in [#747](https://github.com/TagStudioDev/TagStudio/pull/747)
|
||||
- fix(ui): restore Windows accent color on PySide 6.8.0.1 by [@CyanVoxel](https://github.com/CyanVoxel) in [#755](https://github.com/TagStudioDev/TagStudio/pull/755)
|
||||
- fix(ui): (mostly) fix right-click search option on tags by [@CyanVoxel](https://github.com/CyanVoxel) in [#756](https://github.com/TagStudioDev/TagStudio/pull/756)
|
||||
- feat: copy/paste fields and tags by [@mashed5894](https://github.com/mashed5894) in [#722](https://github.com/TagStudioDev/TagStudio/pull/722)
|
||||
|
||||
#### UI/UX
|
||||
|
||||
- feat(ui): pre-select default tag name in `BuildTagPanel` by [@Cool-Game-Dev](https://github.com/Cool-Game-Dev) in [#592](https://github.com/TagStudioDev/TagStudio/pull/592)
|
||||
- feat(ui): keyboard navigation for editing tags by [@Computerdores](https://github.com/Computerdores) in [#407](https://github.com/TagStudioDev/TagStudio/pull/407)
|
||||
- feat(ui): use tag query as default new tag name by [@CyanVoxel](https://github.com/CyanVoxel) in [29c0dfd](https://github.com/TagStudioDev/TagStudio/commit/29c0dfdb2d88e8f473e27c7f1fe7ede6e5bd0feb)
|
||||
- feat(ui): shortcut to add tags to selected entries; change click behavior of tags to edit by [@CyanVoxel](https://github.com/CyanVoxel) in [#749](https://github.com/TagStudioDev/TagStudio/pull/749)
|
||||
- fix(ui): use consistent dark mode colors for all systems by [@CyanVoxel](https://github.com/CyanVoxel) in [#752](https://github.com/TagStudioDev/TagStudio/pull/752)
|
||||
- fix(ui): use camera white balance for raw images by [@CyanVoxel](https://github.com/CyanVoxel) in [6ee5304](https://github.com/TagStudioDev/TagStudio/commit/6ee5304b52f217af0f5df543fcb389649203d6b2)
|
||||
- Mixed field editing has been limited due to various bugs in both the JSON and SQL implementations. This will be re-implemented in a future release.
|
||||
|
||||
#### Performance
|
||||
|
||||
- feat: improve performance of "Delete Missing Entries" by [@Toby222](https://github.com/Toby222) and [@Computerdores](https://github.com/Computerdores) in [#696](https://github.com/TagStudioDev/TagStudio/pull/696)
|
||||
|
||||
#### Internal Changes
|
||||
|
||||
- refactor: combine open launch args by [@UnusualEgg](https://github.com/UnusualEgg) in [#364](https://github.com/TagStudioDev/TagStudio/pull/364)
|
||||
- feat: add date_created, date_modified, and date_added columns to entries table by [@CyanVoxel](https://github.com/CyanVoxel) in [#740](https://github.com/TagStudioDev/TagStudio/pull/740)
|
||||
|
||||
## [9.4.2] - 2024-12-01
|
||||
|
||||
### Added/Fixed
|
||||
|
||||
- Create auto-backup of library for use in save failures (Fix [#343](https://github.com/TagStudioDev/TagStudio/issues/343)) by [@CyanVoxel](https://github.com/CyanVoxel) in [#554](https://github.com/TagStudioDev/TagStudio/pull/554)
|
||||
|
||||
## [9.4.1] - 2024-09-13
|
||||
|
||||
### Added
|
||||
|
||||
- Warn user if FFmpeg is not installed
|
||||
- Support for `.raf` and `.orf` raw image thumbnails and previews
|
||||
|
||||
### Fixed
|
||||
|
||||
- Use `birthtime` for file creation time on Mac & Windows
|
||||
- Use audio icon fallback when FFmpeg is not detected
|
||||
- Retain search query upon directory refresh
|
||||
|
||||
### Changed
|
||||
|
||||
- Significantly improve file re-scanning performance
|
||||
|
||||
## [9.4.0] - 2024-09-03
|
||||
|
||||
### Added
|
||||
|
||||
- Copy and paste fields
|
||||
- Add multiple fields at once
|
||||
- Drag and drop files in/out of the program
|
||||
- Files can be shared by dragging them from the thumbnail grid to other programs
|
||||
- Files can be added to library folder by dragging them into the program
|
||||
- Manage Python virtual environment in Nix flake
|
||||
- Ability to create tag when adding tags
|
||||
- Blender preview thumbnail support
|
||||
- File deletion/trashing
|
||||
- Added right-click option on thumbnails and preview panel to delete files
|
||||
- Added Edit Menu option for deleting files
|
||||
- Added <kbd>Delete</kbd> key shortcut for deleting files
|
||||
- Font preview thumbnail support
|
||||
- Short "Aa" previews for thumbnails
|
||||
- Full alphabet preview for the preview pane
|
||||
- Sort tags by alphabetical/color
|
||||
- File explorer action follows OS naming
|
||||
- Preview Source Engine files
|
||||
- Expanded thumbnail and preview features
|
||||
- Add album cover art thumbnails
|
||||
- Add audio waveform thumbnails for audio files without embedded cover art
|
||||
- Add new default file thumbnails, both for generic and specific file types
|
||||
- Change the unlinked file icon to better convey its meaning
|
||||
- Add dropdown for different thumbnail sizes
|
||||
- Show File Creation and Modified dates; Restyle file path label
|
||||
|
||||
### Fixed
|
||||
|
||||
- Backslashes in f-string on file dupe widget
|
||||
- Tags not shown when none searched
|
||||
- Avoid error from eagerly grabbing data values
|
||||
- Correct behavior for tag search options
|
||||
- Load Gallery-DL sidecar files correctly
|
||||
- Correct duplicate file matching
|
||||
- GPU hardware acceleration in Nix flake
|
||||
- Suppress command prompt windows for FFmpeg in builds
|
||||
|
||||
### Internal Changes
|
||||
|
||||
- Move type constants to media classes
|
||||
- Combine open launch arguments
|
||||
- Revamp Nix flake with devenv/direnv in cb4798b
|
||||
- Remove impurity of Nix flake when used with direnv in bc38e56
|
||||
|
||||
## [9.3.2] - 2024-07-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix signal log warning
|
||||
- Fix "Folders to Tags" feature
|
||||
- Fix search ignoring case of extension list
|
||||
|
||||
### Internal Changes
|
||||
|
||||
- Add tests into CI by
|
||||
- Create testing library files ad-hoc
|
||||
- Refactoring: centralize field IDs
|
||||
- Update to pyside6 version 6.7.1
|
||||
|
||||
## [9.3.1] - 2024-06-13
|
||||
|
||||
### Fixed
|
||||
|
||||
- Separately pin QT nixpkg version
|
||||
- Bugfix for #252, don't attempt to read video file if invalid or 0 frames long
|
||||
- Toggle Mouse Event Transparency on ItemThumbs
|
||||
- Refactor `video_player.py`
|
||||
|
||||
## [9.3.0] - 2024-06-08
|
||||
|
||||
### Added
|
||||
|
||||
- Added playback previews for video files
|
||||
- Added Boolean "and/or" search mode selection
|
||||
- Added ability to scan and fix duplicate entries (not to be confused with duplicate files) from the "Fix Unlinked Entries" menu
|
||||
- Added “Select All” (<kbd>Ctrl</kbd>+<kbd>A</kbd> / <kbd>⌘ Command</kbd>+<kbd>A</kbd>) hotkey for the library grid view
|
||||
- Added "Clear Selection" hotkey (<kbd>Esc</kbd>) for the library grid view
|
||||
- Added the ability to invert the file extension inclusion list into an exclusion list
|
||||
- Added default landing page when no library is open
|
||||
|
||||
### Fixed
|
||||
|
||||
- TagStudio will no longer attempt to or allow you to reopen a library from a missing location
|
||||
- Fixed `PermissionError` when attempting to access files with a higher permission level upon scanning the library directory
|
||||
- Fixed RAW image previews sometimes not loadingand
|
||||
- Fixed most non-UTF-8 encoded text files from not being able to be previewed
|
||||
- Fixed "Refresh Directories"/"Fix Unlinked Entries" creating duplicate entries
|
||||
- Other miscellaneous fixes
|
||||
|
||||
### Changed
|
||||
|
||||
- Renamed "Subtags" to "Parent Tags" to help better describe their function
|
||||
- Increased number of tags shown by default in the "Add Tag" modal from 29 to 100
|
||||
- Documentation is now split into individual linked files and updated to include future features
|
||||
- Replaced use of `os.path` with `pathlib`
|
||||
- `.cr2` files are now included in the list of RAW image file types
|
||||
- Minimum supported macOS version raised to 12.0
|
||||
|
||||
## [9.2.1] - 2024-05-23
|
||||
|
||||
### Added
|
||||
|
||||
- Basic thumbnail/preview support for RAW images (currently `.raw`, `.dng`, `.rw2`, `.nef`, `.arw`, `.crw`, `.cr3`)
|
||||
- NOTE: These previews are currently slow to load given the nature of rendering them. In the future once thumbnail caching is added, this process should only happen once.
|
||||
- Thumbnail/preview support for HEIF images
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed sidebar not expanding horizontally
|
||||
- Fixed "Recent Library" list not updating when creating a new library
|
||||
- Fixed palletized images not loading with alpha channels
|
||||
- Low resolution images (such as pixel art) now render with crisp edges in thumbnails and previews
|
||||
- Fixed visual bug where the edit icon would show for incorrect fields
|
||||
|
||||
## [9.2.0] - 2024-05-14
|
||||
|
||||
### Added
|
||||
|
||||
- Full macOS and Linux support
|
||||
- Ability to apply tags to multiple selections at once
|
||||
- Right-click context menu for opening files or their locations
|
||||
- Support for all filetypes inside of the library
|
||||
- Configurable filetype blacklist
|
||||
- Option to automatically open last used library on startup
|
||||
- Tool to convert folder structure to tag tree
|
||||
- SIGTERM handling in console window
|
||||
- Keyboard shortcuts for basic functions
|
||||
- Basic support for plaintext thumbnails
|
||||
- Default icon for files with no thumbnail support
|
||||
- Menu action to close library
|
||||
- All tags now show in the "Add Tag" panel by default
|
||||
- Modal view to view and manage all library tags
|
||||
- Build scripts for Windows and macOS
|
||||
- Help menu option to visit the GitHub repository
|
||||
- Toggleable "Recent Libraries" list in the entry side panel
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed errors when performing actions with no library open
|
||||
- Fixed bug where built-in tags were duplicated upon saving
|
||||
- QThreads are now properly terminated on application exit
|
||||
- Images with rotational EXIF data are now properly displayed
|
||||
- Fixed "truncated" images causing errors
|
||||
- Fixed images with large resolutions causing errors
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated minimum Python version to 3.12
|
||||
- Various UI improvements
|
||||
- Improved legibility of the Light Theme (still a WIP)
|
||||
- Updated Dark Theme
|
||||
- Added hand cursor to several clickable elements
|
||||
- Fixed network paths not being able to load
|
||||
- Various code cleanup and refactoring
|
||||
- New application icons
|
||||
|
||||
### Known Issues
|
||||
|
||||
- Using and editing multiple entry fields of the same type may result in incorrect field(s) being updated
|
||||
- Adding Favorite or Archived tags via the thumbnail badges may apply the tag(s) to incorrect fields
|
||||
- Searching for tag names with spaces does not currently function as intended
|
||||
- A temporary workaround it to omit spaces in tag names when searching
|
||||
- Sorting fields using the "Sort Fields" macro may result in edit icons being shown for incorrect fields
|
||||
|
||||
## [9.1.0] - 2024-04-22
|
||||
|
||||
### Added
|
||||
|
||||
- Initial public release
|
||||
1
CHANGELOG.md
Symbolic link
1
CHANGELOG.md
Symbolic link
@@ -0,0 +1 @@
|
||||
docs/changelog.md
|
||||
150
CONTRIBUTING.md
150
CONTRIBUTING.md
@@ -1,150 +0,0 @@
|
||||
# Contributing to TagStudio
|
||||
|
||||
_Last Updated: March 8th, 2025_
|
||||
|
||||
Thank you so much for showing interest in contributing to TagStudio! Here are a set of instructions and guidelines for contributing code or documentation to the project. This document will change over time, so make sure that your contributions still line up with the requirements here before submitting a pull request.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- Check the [Feature Roadmap](/docs/updates/roadmap.md) page to see what priority features there are, the [FAQ](/README.md/#faq), as well as the project's [Issues](https://github.com/TagStudioDev/TagStudio/issues) and [Pull Requests](https://github.com/TagStudioDev/TagStudio/pulls).
|
||||
- If you'd like to add a feature that isn't on the feature roadmap or doesn't have an open issue, **PLEASE create a feature request** issue for it discussing your intentions so any feedback or important information can be given by the team first.
|
||||
- We don't want you wasting time developing a feature or making a change that can't/won't be added for any reason ranging from pre-existing refactors to design philosophy differences.
|
||||
- **Please don't** create pull requests that consist of large refactors, _especially_ without discussing them with us first. These end up doing more harm than good for the project by continuously delaying progress and disrupting everyone else's work.
|
||||
- If you wish to discuss TagStudio further, feel free to join the [Discord Server](https://discord.com/invite/hRNnVKhF2G)!
|
||||
|
||||
### Contribution Checklist
|
||||
|
||||
- I've read the [Feature Roadmap](/docs/updates/roadmap.md) page
|
||||
- I've read the [FAQ](/README.md/#faq), including the "[Features I Likely Won't Add/Pull](/README.md/#features-i-likely-wont-addpull)" section
|
||||
- I've checked the project's [Issues](https://github.com/TagStudioDev/TagStudio/issues) and [Pull Requests](https://github.com/TagStudioDev/TagStudio/pulls)
|
||||
- **I've created a new issue for my feature/fix _before_ starting work on it**, or have at least notified others in the relevant existing issue(s) of my intention to work on it
|
||||
- I've set up my development environment including Ruff, Mypy, and PyTest
|
||||
- I've read the [Code Guidelines](#code-guidelines) and/or [Documentation Guidelines](#documentation-guidelines)
|
||||
- **_I mean it, I've found or created an issue for my feature/fix!_**
|
||||
|
||||
> [!NOTE]
|
||||
> If the fix is small and self-explanatory (i.e. a typo), then it doesn't require an issue to be opened first. Issue tracking is supposed to make our lives easier, not harder. Please use your best judgement to minimize the amount of work for everyone involved.
|
||||
|
||||
## Creating a Development Environment
|
||||
|
||||
If you wish to develop for TagStudio, you'll need to create a development environment by installing the required dependencies. You have a number of options depending on your level of experience and familiarly with existing Python toolchains.
|
||||
|
||||
If you know what you're doing and have developed for Python projects in the past, you can get started quickly with the "Brief Instructions" below. Otherwise, please see the full instructions on the documentation website for "[Creating a Development Environment](https://docs.tagstud.io/install/#creating-a-development-environment)".
|
||||
|
||||
### Brief Instructions
|
||||
|
||||
1. Have [Python 3.12](https://www.python.org/downloads/) and PIP installed. Also have [FFmpeg](https://ffmpeg.org/download.html) installed if you wish to have audio/video playback and thumbnails.
|
||||
2. Clone the repository to the folder of your choosing:
|
||||
```
|
||||
git clone https://github.com/TagStudioDev/TagStudio.git
|
||||
```
|
||||
3. Use a dependency manager such as [uv](https://docs.astral.sh/uv/) or [Poetry 2.0](https://python-poetry.org/blog/category/releases/) to install the required dependencies, or alternatively create and activate a [virtual environment](https://docs.tagstud.io/install/#manual-installation) with `venv`.
|
||||
|
||||
4. If using a virtual environment instead of a dependency manager, install an editable version of the program and development dependencies with the following PIP command:
|
||||
|
||||
```
|
||||
pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
Otherwise, modify the command above for use with your dependency manager of choice. For example if using uv, you may use this:
|
||||
|
||||
```
|
||||
uv pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## Workflow Checks
|
||||
|
||||
When pushing your code, several automated workflows will check it against predefined tests and style checks. It's _highly recommended_ that you run these checks locally beforehand to avoid having to fight back-and-forth with the workflow checks inside your pull requests.
|
||||
|
||||
> [!TIP]
|
||||
> To format the code automatically before each commit, there's a configured action available for the `pre-commit` hook. Install it by running `pre-commit install`. The hook will be executed each time on running `git commit`.
|
||||
|
||||
### [Ruff](https://github.com/astral-sh/ruff)
|
||||
|
||||
A Python linter and code formatter. Ruff uses the `pyproject.toml` as its config file and runs whenever code is pushed or pulled into the project.
|
||||
|
||||
#### Running Locally
|
||||
|
||||
Inside the root repository directory:
|
||||
|
||||
- Lint code with `ruff check`
|
||||
- Some linting suggestions can be automatically formatted with `ruff check --fix`
|
||||
- Format code with `ruff format`
|
||||
|
||||
Ruff should automatically discover the configuration options inside the [pyproject.toml](https://github.com/TagStudioDev/TagStudio/blob/main/pyproject.toml) file. For more information, see the [ruff configuration discovery docs](https://docs.astral.sh/ruff/configuration/#config-file-discovery).
|
||||
|
||||
Ruff is also available as a VS Code [extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff), PyCharm [plugin](https://plugins.jetbrains.com/plugin/20574-ruff), and [more](https://docs.astral.sh/ruff/integrations/).
|
||||
|
||||
### [Mypy](https://github.com/python/mypy)
|
||||
|
||||
Mypy is a static type checker for Python. It sure has a lot to say sometimes, but we recommend you take its advice when possible. Mypy also uses the `pyproject.toml` as its config file and runs whenever code is pushed or pulled into the project.
|
||||
|
||||
#### Running Locally
|
||||
|
||||
- **(First time only)** Run the following:
|
||||
- `mkdir -p .mypy_cache`
|
||||
- `mypy --install-types --non-interactive`
|
||||
- You can now check code by running `mypy --config-file pyproject.toml .` in the repository root. _(Don't forget the "." at the end!)_
|
||||
|
||||
Mypy is also available as a VS Code [extension](https://marketplace.visualstudio.com/items?itemName=matangover.mypy), PyCharm [plugin](https://plugins.jetbrains.com/plugin/11086-mypy), and [more](https://plugins.jetbrains.com/plugin/11086-mypy).
|
||||
|
||||
### PyTest
|
||||
|
||||
- Run all tests by running `pytest tests/` in the repository root.
|
||||
|
||||
## Code Style
|
||||
See the [Style Guide](/STYLE.md)
|
||||
|
||||
### Modules & Implementations
|
||||
|
||||
- **Do not** modify legacy library code in the `src/core/library/json/` directory
|
||||
- Avoid direct calls to `os`
|
||||
- Use `Pathlib` library instead of `os.path`
|
||||
- Use `platform.system()` instead of `os.name` and `sys.platform`
|
||||
- Don't prepend local imports with `tagstudio`, stick to `src`
|
||||
- Use the `logger` system instead of `print` statements
|
||||
- Avoid nested f-strings
|
||||
- Use HTML-like tags inside Qt widgets over stylesheets where possible
|
||||
|
||||
### Commit and Pull Request Style
|
||||
|
||||
- Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) as a guideline for commit messages. This allows us to easily generate changelogs for releases.
|
||||
- See some [examples](https://www.conventionalcommits.org/en/v1.0.0/#examples) of what this looks like in practice.
|
||||
- Use clear and concise commit messages. If your commit does too much, either consider breaking it up into smaller commits or providing extra detail in the commit description.
|
||||
- Pull requests should have an adequate title and description which clearly outline your intentions and changes/additions. Feel free to provide screenshots, GIFs, or videos, especially for UI changes.
|
||||
- Pull requests should ideally be limited to **a single** feature or fix.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Please do not force push if your PR is open for review!
|
||||
>
|
||||
> Force pushing makes it impossible to discern which changes have already been reviewed and which haven't. This means a reviewer will then have to re-review all the already reviewed code, which is a lot of unnecessary work for reviewers.
|
||||
|
||||
> [!TIP]
|
||||
> If you're unsure where to stop the scope of your PR, ask yourself: _"If I broke this up, could any parts of it still be used by the project in the meantime?"_
|
||||
|
||||
### Runtime Requirements
|
||||
|
||||
- Final code must function on supported versions of Windows, macOS, and Linux:
|
||||
- Windows: 10, 11
|
||||
- macOS: 13.0+
|
||||
- Linux: _Varies_
|
||||
- Final code must **_NOT:_**
|
||||
- Contain superfluous or unnecessary logging statements
|
||||
- Cause unreasonable slowdowns to the program outside of a progress-indicated task
|
||||
- Cause undesirable visual glitches or artifacts on screen
|
||||
|
||||
## Documentation Guidelines
|
||||
|
||||
Documentation contributions include anything inside of the `docs/` folder, as well as the `README.md` and `CONTRIBUTING.md` files. Documentation inside the `docs/` folder is built and hosted on our static documentation site, [docs.tagstud.io](https://docs.tagstud.io/).
|
||||
|
||||
- Use "[snake_case](https://developer.mozilla.org/en-US/docs/Glossary/Snake_case)" for file and folder names
|
||||
- Follow the folder structure pattern
|
||||
- Don't add images or other media with excessively large file sizes
|
||||
- Provide alt text for all embedded media
|
||||
- Use "[Title Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case)" for title capitalization
|
||||
|
||||
## Translation Guidelines
|
||||
|
||||
Translations are performed on the TagStudio [Weblate project](https://hosted.weblate.org/projects/tagstudio/).
|
||||
|
||||
_Translation guidelines coming soon._
|
||||
1
CONTRIBUTING.md
Symbolic link
1
CONTRIBUTING.md
Symbolic link
@@ -0,0 +1 @@
|
||||
docs/contributing.md
|
||||
84
STYLE.md
84
STYLE.md
@@ -1,84 +0,0 @@
|
||||
# Code Style
|
||||
|
||||
Most of the style guidelines can be checked, fixed, and enforced via Ruff. Older code may not be adhering to all of these guidelines, in which case _"do as I say, not as I do"..._
|
||||
|
||||
- Do your best to write clear, concise, and modular code.
|
||||
- This should include making methods private by default (e.g. `__method()`)
|
||||
- Methods should only be protected (e.g. `_method()`) or public (e.g. `method()`) when needed and warranted
|
||||
- Keep a maximum column width of no more than **100** characters.
|
||||
- Code comments should be used to help describe sections of code that can't speak for themselves.
|
||||
- Use [Google style](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings) docstrings for any classes and functions you add.
|
||||
- If you're modifying an existing function that does _not_ have docstrings, you don't _have_ to add docstrings to it... but it would be pretty cool if you did ;)
|
||||
- Imports should be ordered alphabetically.
|
||||
- Lists of values should be ordered using their [natural sort order](https://en.wikipedia.org/wiki/Natural_sort_order).
|
||||
- Some files have their methods ordered alphabetically as well (i.e. [`thumb_renderer`](https://github.com/TagStudioDev/TagStudio/blob/main/src/tagstudio/qt/widgets/thumb_renderer.py)). If you're working in a file and notice this, please try and keep to the pattern.
|
||||
- When writing text for window titles or form titles, use "[Title Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case)" capitalization. Your IDE may have a command to format this for you automatically, although some may incorrectly capitalize short prepositions. In a pinch you can use a website such as [capitalizemytitle.com](https://capitalizemytitle.com/) to check.
|
||||
- If it wasn't mentioned above, then stick to [**PEP-8**](https://peps.python.org/pep-0008/)!
|
||||
|
||||
## QT
|
||||
As of writing this section, the QT part of the code base is quite unstructured and the View and Controller parts are completely intermixed[^1]. This makes maintenance, fixes and general understanding of the code base quite challenging, because the interesting parts you are looking for are entangled in a bunch of repetitive UI setup code. To address this we are aiming to more strictly separate the view and controller aspects of the QT frontend.
|
||||
|
||||
The general structure of the QT code base should look like this:
|
||||
```
|
||||
qt
|
||||
├── controllers
|
||||
│ ├── widgets
|
||||
│ │ └── preview_panel_controller.py
|
||||
│ └── main_window_controller.py
|
||||
├── views
|
||||
│ ├── widgets
|
||||
│ │ └── preview_panel_view.py
|
||||
│ └── main_window_view.py
|
||||
├── ts_qt.py
|
||||
└── mixed.py
|
||||
```
|
||||
|
||||
In this structure there are the `views` and `controllers` sub-directories. They have the exact same structure and for every `<component>_view.py` there is a `<component>_controller.py` at the same location in the other subdirectory and vice versa.
|
||||
|
||||
Typically the classes should look like this:
|
||||
```py
|
||||
# my_cool_widget_view.py
|
||||
class MyCoolWidgetView(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.__button = QPushButton()
|
||||
self.__color_dropdown = QComboBox()
|
||||
# ...
|
||||
self.__connect_callbacks()
|
||||
|
||||
def __connect_callbacks(self):
|
||||
self.__button.clicked.connect(self._button_click_callback)
|
||||
self.__color_dropdown.currentIndexChanged.connect(
|
||||
lambda idx: self._color_dropdown_callback(self.__color_dropdown.itemData(idx))
|
||||
)
|
||||
|
||||
def _button_click_callback(self):
|
||||
raise NotImplementedError()
|
||||
```
|
||||
```py
|
||||
# my_cool_widget_controller.py
|
||||
class MyCoolWidget(MyCoolWidgetView):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def _button_click_callback(self):
|
||||
print("Button was clicked!")
|
||||
|
||||
def _color_dropdown_callback(self, color: Color):
|
||||
print(f"The selected color is now: {color}")
|
||||
```
|
||||
|
||||
Observe the following key aspects of this example:
|
||||
- The Controller is just called `MyCoolWidget` instead of `MyCoolWidgetController` as it will be directly used by other code
|
||||
- The UI elements are in private variables
|
||||
- This enforces that the controller shouldn't directly access UI elements
|
||||
- Instead the view should provide a protected API (e.g. `_get_color()`) for things like setting/getting the value of a dropdown, etc.
|
||||
- Instead of `_get_color()` there could also be a `_color` method marked with `@property`
|
||||
- The callback methods are already defined as protected methods with NotImplementedErrors
|
||||
- Defines the interface the callbacks
|
||||
- Enforces that UI events be handled
|
||||
|
||||
> [!TIP]
|
||||
> A good (non-exhaustive) rule of thumb is: If it requires a non-UI import, then it doesn't belong in the `*_view.py` file.
|
||||
|
||||
[^1]: For an explanation of the Model-View-Controller (MVC) Model, checkout this article: [MVC Framework Introduction](https://www.geeksforgeeks.org/mvc-framework-introduction/).
|
||||
1062
docs/changelog.md
Normal file
1062
docs/changelog.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
icon: material/palette
|
||||
---
|
||||
|
||||
# :material-palette: Tag Colors
|
||||
# :material-palette: Colors
|
||||
|
||||
TagStudio features a variety of built-in tag colors, alongside the ability for users to create their own custom tag color palettes.
|
||||
|
||||
@@ -10,7 +10,7 @@ TagStudio features a variety of built-in tag colors, alongside the ability for u
|
||||
|
||||
The Tag Color Manager is where you can create and manage your custom tag colors and associated namespaces. You can access the Tag Color Manager from the "File -> Manage Tag Colors" option in the menu bar.
|
||||
|
||||

|
||||

|
||||
|
||||
## Creating a Namespace
|
||||
|
||||
@@ -20,7 +20,7 @@ _\* Color pack sharing coming in a future update_
|
||||
|
||||
To create your first namespace, either click the "New Namespace" button or the large button prompt underneath the built-in colors.
|
||||
|
||||

|
||||

|
||||
|
||||
### Name
|
||||
|
||||
@@ -40,7 +40,7 @@ Namespaces beginning with "tagstudio" are reserved by TagStudio and will automat
|
||||
|
||||
Once you've created your first namespace, click the "+" button inside the namespace section to create a color. To edit a color that you've previously created, either click on the color name or right click and select "Edit Color" from the context menu.
|
||||
|
||||

|
||||

|
||||
|
||||
### Name
|
||||
|
||||
@@ -62,14 +62,14 @@ The primary color is used as the main tag color and by default is used as the ba
|
||||
|
||||
By default, the secondary color is only used as an optional override for the tag text color. This color can be cleared by clicking the adjacent "Reset" button.
|
||||
|
||||

|
||||

|
||||
|
||||
The secondary color can also be used as the tag border color by checking the "Use Secondary Color for Border" box.
|
||||
|
||||

|
||||

|
||||
|
||||
## Using Colors
|
||||
|
||||
When editing a tag, click the tag color button to bring up the tag color selection panel. From here you can choose any built-in TagStudio color as well as any of your custom colors.
|
||||
|
||||

|
||||

|
||||
155
docs/contributing.md
Normal file
155
docs/contributing.md
Normal file
@@ -0,0 +1,155 @@
|
||||
---
|
||||
icon: material/file-plus
|
||||
---
|
||||
|
||||
# :material-file-plus: Contributing
|
||||
|
||||
Thank you so much for showing interest in contributing to TagStudio! Here are a set of instructions and guidelines for contributing code or documentation to the project. This document will change over time, so make sure that your contributions still line up with the requirements here before submitting a pull request.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- Check the [Feature Roadmap](roadmap.md) page to see what priority features there are, the [FAQ](https://github.com/TagStudioDev/TagStudio/blob/main/README.md#faq), as well as the project's [Issues](https://github.com/TagStudioDev/TagStudio/issues) and [Pull Requests](https://github.com/TagStudioDev/TagStudio/pulls).
|
||||
- If you'd like to add a feature that isn't on the feature roadmap or doesn't have an open issue, **PLEASE create a feature request** issue for it discussing your intentions so any feedback or important information can be given by the team first.
|
||||
- We don't want you wasting time developing a feature or making a change that can't/won't be added for any reason ranging from pre-existing refactors to design philosophy differences.
|
||||
- **Please don't** create pull requests that consist of large refactors, _especially_ without discussing them with us first. These end up doing more harm than good for the project by continuously delaying progress and disrupting everyone else's work.
|
||||
- If you wish to discuss TagStudio further, feel free to join the [Discord Server](https://discord.com/invite/hRNnVKhF2G)!
|
||||
|
||||
### Contribution Checklist
|
||||
|
||||
- I've read the [Feature Roadmap](roadmap.md) page
|
||||
- I've read the [FAQ](https://github.com/TagStudioDev/TagStudio/blob/main/README.md#faq)
|
||||
- I've checked the project's [Issues](https://github.com/TagStudioDev/TagStudio/issues) and [Pull Requests](https://github.com/TagStudioDev/TagStudio/pulls)
|
||||
- **I've created a new issue for my feature/fix _before_ starting work on it**, or have at least notified others in the relevant existing issue(s) of my intention to work on it
|
||||
- I've set up my development environment including Ruff, Mypy, and PyTest
|
||||
- I've read the CONTRIBUTING.md/Contributing page on the documentation site as well as the and/or [Style Guide](style.md)
|
||||
- **_I mean it, I've found or created an issue for my feature/fix!_**
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note
|
||||
If the fix is small and self-explanatory (i.e. a typo), then it doesn't require an issue to be opened first. Issue tracking is supposed to make our lives easier, not harder. Please use your best judgement to minimize the amount of work for everyone involved.
|
||||
|
||||
## Creating a Development Environment
|
||||
|
||||
If you wish to develop for TagStudio, you'll need to create a development environment by installing the required dependencies. You have a number of options depending on your level of experience and familiarly with existing Python toolchains.
|
||||
|
||||
If you know what you're doing and have developed for Python projects in the past, you can get started quickly with the "Brief Instructions" below. Otherwise, please see the full instructions on the documentation website for "[Creating a Development Environment](https://docs.tagstud.io/install/#creating-a-development-environment)".
|
||||
|
||||
### Brief Instructions
|
||||
|
||||
1. Have [Python 3.12](https://www.python.org/downloads/) and PIP installed. Also have [FFmpeg](https://ffmpeg.org/download.html) installed if you wish to have audio/video playback and thumbnails.
|
||||
2. Clone the repository to the folder of your choosing:
|
||||
```
|
||||
git clone https://github.com/TagStudioDev/TagStudio.git
|
||||
```
|
||||
3. Use a dependency manager such as [uv](https://docs.astral.sh/uv/) or [Poetry 2.0](https://python-poetry.org/blog/category/releases/) to install the required dependencies, or alternatively create and activate a [virtual environment](https://docs.tagstud.io/install/#manual-installation) with `venv`.
|
||||
|
||||
4. If using a virtual environment instead of a dependency manager, install an editable version of the program and development dependencies with the following PIP command:
|
||||
|
||||
```
|
||||
pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
Otherwise, modify the command above for use with your dependency manager of choice. For example if using uv, you may use this:
|
||||
|
||||
```
|
||||
uv pip install -e ".[dev]"
|
||||
```
|
||||
|
||||
## Workflow Checks
|
||||
|
||||
When pushing your code, several automated workflows will check it against predefined tests and style checks. It's _highly recommended_ that you run these checks locally beforehand to avoid having to fight back-and-forth with the workflow checks inside your pull requests.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! tip
|
||||
To format the code automatically before each commit, there's a configured action available for the `pre-commit` hook. Install it by running `pre-commit install`. The hook will be executed each time on running `git commit`.
|
||||
|
||||
### [Ruff](https://github.com/astral-sh/ruff)
|
||||
|
||||
A Python linter and code formatter. Ruff uses the `pyproject.toml` as its config file and runs whenever code is pushed or pulled into the project.
|
||||
|
||||
#### Running Locally
|
||||
|
||||
Inside the root repository directory:
|
||||
|
||||
- Lint code with `ruff check`
|
||||
- Some linting suggestions can be automatically formatted with `ruff check --fix`
|
||||
- Format code with `ruff format`
|
||||
|
||||
Ruff should automatically discover the configuration options inside the [pyproject.toml](https://github.com/TagStudioDev/TagStudio/blob/main/pyproject.toml) file. For more information, see the [ruff configuration discovery docs](https://docs.astral.sh/ruff/configuration/#config-file-discovery).
|
||||
|
||||
Ruff is also available as a VS Code [extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff), PyCharm [plugin](https://plugins.jetbrains.com/plugin/20574-ruff), and [more](https://docs.astral.sh/ruff/integrations/).
|
||||
|
||||
### [Mypy](https://github.com/python/mypy)
|
||||
|
||||
Mypy is a static type checker for Python. It sure has a lot to say sometimes, but we recommend you take its advice when possible. Mypy also uses the `pyproject.toml` as its config file and runs whenever code is pushed or pulled into the project.
|
||||
|
||||
#### Running Locally
|
||||
|
||||
- **(First time only)** Run the following:
|
||||
- `mkdir -p .mypy_cache`
|
||||
- `mypy --install-types --non-interactive`
|
||||
- You can now check code by running `mypy --config-file pyproject.toml .` in the repository root. _(Don't forget the "." at the end!)_
|
||||
|
||||
Mypy is also available as a VS Code [extension](https://marketplace.visualstudio.com/items?itemName=matangover.mypy), PyCharm [plugin](https://plugins.jetbrains.com/plugin/11086-mypy), and [more](https://plugins.jetbrains.com/plugin/11086-mypy).
|
||||
|
||||
### PyTest
|
||||
|
||||
- Run all tests by running `pytest tests/` in the repository root.
|
||||
|
||||
## Code Style
|
||||
|
||||
See the [Style Guide](style.md)
|
||||
|
||||
### Modules & Implementations
|
||||
|
||||
- **Do not** modify legacy library code in the `src/core/library/json/` directory
|
||||
- Avoid direct calls to `os`
|
||||
- Use `Pathlib` library instead of `os.path`
|
||||
- Use `platform.system()` instead of `os.name` and `sys.platform`
|
||||
- Don't prepend local imports with `tagstudio`, stick to `src`
|
||||
- Use the `logger` system instead of `print` statements
|
||||
- Avoid nested f-strings
|
||||
- Use HTML-like tags inside Qt widgets over stylesheets where possible
|
||||
|
||||
### Commit and Pull Request Style
|
||||
|
||||
- Use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) as a guideline for commit messages. This allows us to easily generate changelogs for releases.
|
||||
- See some [examples](https://www.conventionalcommits.org/en/v1.0.0/#examples) of what this looks like in practice.
|
||||
- Use clear and concise commit messages. If your commit does too much, either consider breaking it up into smaller commits or providing extra detail in the commit description.
|
||||
- Pull requests should have an adequate title and description which clearly outline your intentions and changes/additions. Feel free to provide screenshots, GIFs, or videos, especially for UI changes.
|
||||
- Pull requests should ideally be limited to **a single** feature or fix.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! important
|
||||
**Please do not force push if your PR is open for review!** Force pushing makes it impossible to discern which changes have already been reviewed and which haven't. This means a reviewer will then have to re-review all the already reviewed code, which is a lot of unnecessary work for reviewers.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! tip
|
||||
If you're unsure where to stop the scope of your PR, ask yourself: _"If I broke this up, could any parts of it still be used by the project in the meantime?"_
|
||||
|
||||
### Runtime Requirements
|
||||
|
||||
- Final code must function on supported versions of Windows, macOS, and Linux:
|
||||
- Windows: 10, 11
|
||||
- macOS: 13.0+
|
||||
- Linux: _Varies_
|
||||
- Final code must **_NOT:_**
|
||||
- Contain superfluous or unnecessary logging statements
|
||||
- Cause unreasonable slowdowns to the program outside of a progress-indicated task
|
||||
- Cause undesirable visual glitches or artifacts on screen
|
||||
|
||||
## Documentation Guidelines
|
||||
|
||||
Documentation contributions include anything inside of the `docs/` folder, as well as the `README.md` and `CONTRIBUTING.md` files. Documentation inside the `docs/` folder is built and hosted on our static documentation site, [docs.tagstud.io](https://docs.tagstud.io/).
|
||||
|
||||
- Use "[dash-case / kebab-case](https://developer.mozilla.org/en-US/docs/Glossary/Kebab_case)" for file and folder names
|
||||
- Follow the folder structure pattern
|
||||
- Don't add images or other media with excessively large file sizes
|
||||
- Provide alt text for all embedded media
|
||||
- Use "[Title Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case)" for title capitalization
|
||||
|
||||
## Translation Guidelines
|
||||
|
||||
Translations are performed on the TagStudio [Weblate project](https://hosted.weblate.org/projects/tagstudio/).
|
||||
|
||||
_Translation guidelines coming soon._
|
||||
@@ -121,7 +121,7 @@ A reference `.envrc` is provided for use with [direnv](#direnv), see [`contrib/.
|
||||
|
||||
### Editor Integration
|
||||
|
||||
The entry point for TagStudio is `src/tagstudio/main.py`. You can target this file from your IDE to run or connect a debug session. The example(s) below show off example launch scripts for different IDEs. Here you can also take advantage of [launch arguments](./usage.md/#launch-arguments) to pass your own test [libraries](./library/index.md) to use while developing. You can find more editor configurations in [`contrib`](https://github.com/TagStudioDev/TagStudio/tree/main/contrib).
|
||||
The entry point for TagStudio is `src/tagstudio/main.py`. You can target this file from your IDE to run or connect a debug session. The example(s) below show off example launch scripts for different IDEs. Here you can also take advantage of [launch arguments](./usage.md/#launch-arguments) to pass your own test [libraries](libraries.md) to use while developing. You can find more editor configurations in [`contrib`](https://github.com/TagStudioDev/TagStudio/tree/main/contrib).
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "VS Code"
|
||||
@@ -4,7 +4,7 @@ icon: material/file
|
||||
|
||||
# :material-file: Entries
|
||||
|
||||
Entries are the individual representations of your files inside a TagStudio [library](./index.md). Each one corresponds one-to-one to a file on disk, and tracks all of the additional [tags](tag.md) and metadata that you attach to it inside TagStudio.
|
||||
Entries are the individual representations of your files inside a TagStudio [library](./index.md). Each one corresponds one-to-one to a file on disk, and tracks all of the additional [tags](tags.md) and metadata that you attach to it inside TagStudio.
|
||||
|
||||
## Storage
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: material/text-box
|
||||
|
||||
# :material-text-box: Fields
|
||||
|
||||
Fields are additional types of metadata that you can attach to [file entries](./entry.md). Like [tags](./tag.md), fields are not stored inside files themselves nor in sidecar files, but rather inside the respective TagStudio [library](./index.md) save file.
|
||||
Fields are additional types of metadata that you can attach to [file entries](./entries.md). Like [tags](tags.md), fields are not stored inside files themselves nor in sidecar files, but rather inside the respective TagStudio [library](./index.md) save file.
|
||||
|
||||
## Field Types
|
||||
|
||||
@@ -20,7 +20,7 @@ A long string of text displayed as a box of text.
|
||||
|
||||
- e.g: Description, Notes, etc.
|
||||
|
||||
### Datetime [WIP]
|
||||
### Datetime
|
||||
|
||||
A date and time value.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
icon: material/movie-open-cog
|
||||
---
|
||||
|
||||
# :material-movie-open-cog: FFmpeg
|
||||
# :material-movie-open-cog: Installing FFmpeg
|
||||
|
||||
FFmpeg is required for thumbnail previews and playback features on audio and video files. FFmpeg is a free Open Source project dedicated to the handling of multimedia (video, audio, etc) files. For more information, see their official website at [ffmpeg.org](https://www.ffmpeg.org/).
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: Ignore Files
|
||||
title: Ignoring Files
|
||||
icon: material/file-document-remove
|
||||
---
|
||||
|
||||
# :material-file-document-remove: Ignore Files & Directories
|
||||
# :material-file-document-remove: Ignoring Files & Directories
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! warning "Legacy File Extension Ignoring"
|
||||
@@ -11,7 +11,7 @@ icon: material/file-document-remove
|
||||
|
||||
If you're still running an older version of TagStudio in the meantime, you can access the legacy system by going to "Edit -> Manage File Extensions" in the menubar.
|
||||
|
||||
TagStudio offers the ability to ignore specific files and directories via a `.ts_ignore` file located inside your [library's](../library/index.md) `.TagStudio` folder. This file is designed to use very similar [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>)-style pattern matching as the [`.gitignore`](https://git-scm.com/docs/gitignore) file used by Git™[^1]. It can be edited within TagStudio or opened to edit with an external program by going to the "Edit -> Ignore Files" option in the menubar.
|
||||
TagStudio offers the ability to ignore specific files and directories via a `.ts_ignore` file located inside your [library's](libraries.md) `.TagStudio` folder. This file is designed to use very similar [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>)-style pattern matching as the [`.gitignore`](https://git-scm.com/docs/gitignore) file used by Git™[^1]. It can be edited within TagStudio or opened to edit with an external program by going to the "Edit -> Ignore Files" option in the menubar.
|
||||
|
||||
This file is only referenced when scanning directories for new files to add to your library, and does not apply to files that have already been added to your library.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: Home
|
||||
hide:
|
||||
- toc
|
||||
- navigation
|
||||
---
|
||||
|
||||
#
|
||||
@@ -35,15 +36,15 @@ hide:
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-file-multiple:{ .lg .middle } **[All Files](./library/entry.md) Welcome**
|
||||
- :material-file-multiple:{ .lg .middle } **[All Files](entries.md) Welcome**
|
||||
|
||||
***
|
||||
|
||||
TagStudio works with photos, videos, music, documents, and more! **All file types** are recognized by TagStudio, with most common ones having built-in preview support.
|
||||
|
||||
[:material-arrow-right: See Full Preview Support](./library/index.md#preview-support)
|
||||
[:material-arrow-right: See Full Preview Support](preview-support.md)
|
||||
|
||||
- :material-tag-text:{ .lg .middle } **Create [Tags](./library/tag.md) Your Way**
|
||||
- :material-tag-text:{ .lg .middle } **Create [Tags](tags.md) Your Way**
|
||||
|
||||
***
|
||||
|
||||
@@ -53,17 +54,17 @@ hide:
|
||||
- :material-tag-multiple: Tags can be tagged with other tags!
|
||||
- :material-star-four-points: And more!
|
||||
|
||||
- :material-magnify:{ .lg .middle } **Powerful [Search](./library/library_search.md)**
|
||||
- :material-magnify:{ .lg .middle } **Powerful [Search](search.md)**
|
||||
|
||||
***
|
||||
|
||||
- Full [Boolean operator](./library/library_search.md) support
|
||||
- Full [Boolean operator](search.md) support
|
||||
- Filenames, paths, and extensions with [glob](<https://en.wikipedia.org/wiki/Glob_(programming)>) syntax
|
||||
- General media types (e.g. "Photo", "Video", "Document")
|
||||
- Special searches (e.g. "Untagged")
|
||||
- "[Smartcase](./library/library_search.md#case-sensitivity)" case sensitivity
|
||||
- "[Smartcase](search.md#case-sensitivity)" case sensitivity
|
||||
|
||||
- :material-text-box:{ .lg .middle } **Text and Date [Fields](./library/field.md)**
|
||||
- :material-text-box:{ .lg .middle } **Text and Date [Fields](fields.md)**
|
||||
|
||||
***
|
||||
|
||||
@@ -85,15 +86,15 @@ hide:
|
||||
|
||||
[:material-arrow-right: View License](https://github.com/TagStudioDev/TagStudio/blob/main/LICENSE)
|
||||
|
||||
[:material-arrow-right: Roadmap to MIT Core Library License](./updates/roadmap.md#core-library-api)
|
||||
[:material-arrow-right: Roadmap to MIT Core Library License](roadmap.md#core-library-api)
|
||||
|
||||
- :material-database:{ .lg .middle } **Central Save File**
|
||||
|
||||
***
|
||||
|
||||
Apposed to filling your drives with [sidecar files](https://en.wikipedia.org/wiki/Sidecar_file), TagStudio uses a project-like [library](./library/index.md) system that stores your tags and metadata inside a single save file per-library.
|
||||
Apposed to filling your drives with [sidecar files](https://en.wikipedia.org/wiki/Sidecar_file), TagStudio uses a project-like [library](libraries.md) system that stores your tags and metadata inside a single save file per-library.
|
||||
|
||||
[:material-arrow-right: Learn About the Format](./library/index.md)
|
||||
[:material-arrow-right: Learn About the Format](libraries.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -105,6 +106,6 @@ TagStudio aims to create an **open** and **robust** format for file tagging that
|
||||
|
||||
<div class="grid cards" markdown>
|
||||
|
||||
- :material-map-check:{ .lg .middle } See the [**Roadmap**](./updates/roadmap.md) for future features and updates
|
||||
- :material-map-check:{ .lg .middle } See the [**Roadmap**](roadmap.md) for future features and updates
|
||||
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: material/download
|
||||
|
||||
# :material-download: Installation
|
||||
|
||||
TagStudio provides [releases](https://github.com/TagStudioDev/TagStudio/releases) as well as full access to its [source code](https://github.com/TagStudioDev/TagStudio) under the [GPLv3](https://github.com/TagStudioDev/TagStudio/blob/main/LICENSE) license.
|
||||
TagStudio provides executable [releases](https://github.com/TagStudioDev/TagStudio/releases) as well as full access to its [source code](https://github.com/TagStudioDev/TagStudio) under the [GPLv3](https://github.com/TagStudioDev/TagStudio/blob/main/LICENSE) license.
|
||||
|
||||
## Executables
|
||||
|
||||
@@ -52,7 +52,7 @@ pip install .
|
||||
```sh
|
||||
pip install -e ".[dev]"
|
||||
```
|
||||
_See more under "[Developing](./develop.md)"_
|
||||
_See more under "[Developing](developing.md)"_
|
||||
|
||||
TagStudio can now be launched via the `tagstudio` command in your terminal.
|
||||
|
||||
@@ -239,4 +239,4 @@ To generate thumbnails for RAR-based files (like `.cbr`) you'll need an extracto
|
||||
|
||||
### ripgrep
|
||||
|
||||
A recommended tool to improve the performance of directory scanning is [`ripgrep`](https://github.com/BurntSushi/ripgrep), a Rust-based directory walker that natively integrates with our [`.ts_ignore`](./utilities/ignore.md) (`.gitignore`-style) pattern matching system for excluding files and directories. Ripgrep is already pre-installed on some Linux distributions and also available from several package managers.
|
||||
A recommended tool to improve the performance of directory scanning is [`ripgrep`](https://github.com/BurntSushi/ripgrep), a Rust-based directory walker that natively integrates with our [`.ts_ignore`](ignore.md) (`.gitignore`-style) pattern matching system for excluding files and directories. Ripgrep is already pre-installed on some Linux distributions and also available from several package managers.
|
||||
|
||||
13
docs/libraries.md
Normal file
13
docs/libraries.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
icon: material/database
|
||||
---
|
||||
|
||||
# :material-database: Libraries
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! info
|
||||
This page is a work in progress and needs to be updated with additional information.
|
||||
|
||||
The library is how TagStudio represents your chosen directory, with every file inside being represented by a [file entry](entries.md). You can have as many or few libraries as you wish, since each libraries' data is stored within a `.TagStudio` folder at its root. From there the library save file itself is stored as `ts_library.sqlite`, with TagStudio versions 9.4 and below using a the legacy `ts_library.json` format.
|
||||
|
||||
Note that this means [tags](tags.md) you create only exist _per-library_. Global tags along with other library structure updates are planned for future releases on the [roadmap](roadmap.md#library).
|
||||
@@ -2,7 +2,7 @@
|
||||
icon: material/database-edit
|
||||
---
|
||||
|
||||
# :material-database-edit: Save Format Changes
|
||||
# :material-database-edit: Library Format
|
||||
|
||||
This page outlines the various changes made to the TagStudio library save file format over time, sometimes referred to as the "database" or "database file".
|
||||
|
||||
@@ -75,7 +75,7 @@ Migration from the legacy JSON format is provided via a walkthrough when opening
|
||||
| ------------------------------------------------------------------------------- | ------ | ----------------------------------------------- |
|
||||
| [v9.5.0-pr4](https://github.com/TagStudioDev/TagStudio/releases/tag/v9.5.0-pr4) | SQLite | `<Library Folder>`/.TagStudio/ts_library.sqlite |
|
||||
|
||||
- Adds the `color_border` column to the `tag_colors` table. Used for instructing the [secondary color](../library/tag_color.md#secondary-color) to apply to a tag's border as a new optional behavior.
|
||||
- Adds the `color_border` column to the `tag_colors` table. Used for instructing the [secondary color](colors.md#secondary-color) to apply to a tag's border as a new optional behavior.
|
||||
- Adds three new default colors: "Burgundy (TagStudio Shades)", "Dark Teal (TagStudio Shades)", and "Dark Lavender (TagStudio Shades)".
|
||||
- Updates Neon colors to use the new `color_border` property.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
icon: material/shape-plus
|
||||
---
|
||||
|
||||
# :material-shape-plus: Tag Categories
|
||||
|
||||
The "Is Category" property of tags determines if a tag should be treated as a category itself when being organized inside the preview panel. Tags marked as categories will show themselves and all tags inheriting from it (including recursively) underneath a field-like section with the tag's name. This means that duplicates of tags can appear on entries if the tag inherits from multiple parent categories, however this is by design and reflects the nature of multiple inheritance. Any tags not inheriting from a category tag will simply show under a default "Tag" section.
|
||||
|
||||

|
||||
|
||||
### Built-In Tags and Categories
|
||||
|
||||
The built-in tags "Favorite" and "Archived" inherit from the built-in "Meta Tags" category which is marked as a category by default. This behavior of default tags can be fully customized by disabling the category option and/or by adding/removing the tags' Parent Tags.
|
||||
|
||||
### Migrating from v9.4 Libraries
|
||||
|
||||
Due to the nature of how tags and Tag Felids operated prior to v9.5, the organization style of Tag Categories vs Tag Fields is not 1:1. Instead of tags being organized into fields on a per-entry basis, tags themselves determine their organizational layout via the "Is Property" flag. Any tags _(not currently inheriting from either the "Favorite" or "Archived" tags)_ will be shown under the default "Tags" header upon migrating to the v9.5+ library format. Similar organization to Tag Fields can be achieved by using the built-in "Meta Tags" tag or any other marked with "Is Category" and then setting those tags as parents for other tags to inherit from.
|
||||
521
docs/macros.md
Normal file
521
docs/macros.md
Normal file
@@ -0,0 +1,521 @@
|
||||
---
|
||||
icon: material/script-text
|
||||
---
|
||||
|
||||
# :material-script-text: Macros
|
||||
|
||||
TagStudio features a configurable macro system which allows you to set up automatic or manually triggered actions to perform a wide array of operations on your [library](libraries.md). Each macro is stored in an individual script file and is created using [TOML](https://toml.io/en/) with a predefined schema described below. Macro files are stored in your library's "`.TagStudio/macros`" folder.
|
||||
|
||||
## Schema Version
|
||||
|
||||
The `schema_version` key declares which version of the macro schema is currently being used. Current schema version: 1.
|
||||
|
||||
```toml
|
||||
schema_version = 1
|
||||
```
|
||||
|
||||
## Triggers
|
||||
|
||||
The `triggers` key declares when a macro may be automatically ran. Macros can still be manually triggered even if they have automatic triggers defined.
|
||||
|
||||
- `on_open`: Run when the TagStudio library is opened.
|
||||
- `on_refresh`: Run when the TagStudio library's directories have been refreshed.
|
||||
- `on_new_entry`: Run a new [file entry](entries.md) that has been created.
|
||||
|
||||
```toml
|
||||
triggers = ["on_new_entry"]
|
||||
```
|
||||
|
||||
## Actions
|
||||
|
||||
Actions are broad categories of operations that your macro will perform. They are represented by TOML tables and must have a unique name in your macro file, but the name itself has no importance to the macro. A single macro file can contain multiple actions and each action can contain multiple tasks.
|
||||
|
||||
An action table with a name of your choosing (e.g. `[action]`) will contain the general configuration for your action, and nested task tables (e.g. `[action.task]`) will define the specifics of your action's tasks.
|
||||
|
||||
Action tables must have an `action` key with one of the following valid action values:
|
||||
|
||||
- [`import_data`](#import-data): Import data from a supported external source.
|
||||
- [`add_data`](#add-data): Add data declared inside the macro file.
|
||||
|
||||
```toml
|
||||
[newgrounds]
|
||||
action = "import_data"
|
||||
```
|
||||
|
||||
Most of the configuration of actions comes at the [task configuration](#task-configuration) level. This is where you will build out exactly how your action will translate data and instructions into results for your TagStudio library.
|
||||
|
||||
---
|
||||
|
||||
### Add Data
|
||||
|
||||
The `add_data` action lets you add data to a [file entry](entries.md) given one or more conditional statements. Unlike the [`import_data`](#import-data) action, the `add_data` action adds data declared in the macro itself rather than importing it form a source external to the macro.
|
||||
|
||||
Compatible Keys:
|
||||
|
||||
- [`source_filters`](#source_filters)
|
||||
- [`value`](#value)
|
||||
|
||||
---
|
||||
|
||||
### Import Data
|
||||
|
||||
The `import_data` action allows you to import external data into your TagStudio library in the form of [tags](tags.md) and [fields](fields.md). While some sources need explicit support (e.g. ID3, EXIF) generic sources such as JSON sidecar files can leverage a wide array of data shaping options that allow the underlying data structure to be abstracted from TagStudio's internal data structures. This macro pairs very well with tools that download sidecar files for data such as [gallery-dl](https://github.com/mikf/gallery-dl).
|
||||
|
||||
Compatible Keys:
|
||||
|
||||
- [`key`](#key)
|
||||
- [`source_location`](#source_location)
|
||||
- [`source_format`](#source_format)
|
||||
- [`is_embedded`](#is_embedded)
|
||||
|
||||
If you're importing from an object-like source (e.g. JSON), you'll need to create a nested task table with the format `[action.task]` and provide a [`key`](#key) field filled with the name of the targeted source key. In this case the task name does not matter as long as it doesn't conflict with one of the built-in task names (i.e. "`map`", "`inverse_map`, "`template`").
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "Importable JSON Data"
|
||||
```json
|
||||
{
|
||||
"newgrounds": {
|
||||
"tags": ["tag1", "tag2"]
|
||||
}
|
||||
}
|
||||
```
|
||||
=== "TOML Macro"
|
||||
```toml
|
||||
[newgrounds]
|
||||
action="import_data"
|
||||
[newgrounds.tags]
|
||||
key="tags"
|
||||
```
|
||||
|
||||
Inside the new table we can now declare additional information about the native data formats and how they should be imported into TagStudio.
|
||||
|
||||
---
|
||||
|
||||
### Action Configuration
|
||||
|
||||
#### `source_format`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`import_data`](#import-data)
|
||||
|
||||
The `source_format` key is used to declare what type of source data will be imported from.
|
||||
|
||||
```toml
|
||||
[newgrounds]
|
||||
action = "import_data"
|
||||
source_format = "json"
|
||||
```
|
||||
|
||||
- `exif`: Embedded EXIF metadata
|
||||
- `id3`: Embedded ID3 metadata
|
||||
- `json`: A JSON formatted file
|
||||
- `text`: A plaintext file
|
||||
- `xml`: An XML formatted file
|
||||
- `xmp`: Embedded XMP metadata or an XMP sidecar file
|
||||
|
||||
---
|
||||
|
||||
#### `source_location`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`import_data`](#import-data)
|
||||
|
||||
The `source_location` key is used to declare where the metadata should be imported from. This can be a relative or absolute path, and can reference the targeted filename with the `{filename}` placeholder.
|
||||
|
||||
```toml
|
||||
[newgrounds]
|
||||
action = "import_data"
|
||||
source_format = "json"
|
||||
source_location = "{filename}.json" # Relative sidecar file
|
||||
```
|
||||
|
||||
<!-- - `absolute`: An absolute file location
|
||||
- `embedded`: Data that's embedded within the targeted file
|
||||
- `sidecar`: A sidecar file with a relative file location -->
|
||||
|
||||
---
|
||||
|
||||
#### `is_embedded`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`import_data`](#import-data)
|
||||
|
||||
If targeting embedded data, add the `is_embedded` key and set it to `true`. If no `source_location` is used then the file this macro is targeting will be used as a source.
|
||||
|
||||
```toml
|
||||
[newgrounds]
|
||||
action = "import_data"
|
||||
source_format = "id3"
|
||||
is_embedded = true
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### `source_filters`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`add_data`](#add-data), [`import_data`](#import-data)
|
||||
|
||||
`source_filters` are used to declare a glob list of files that are able to be targeted by this action. An entry filepath only needs to fall under one of the given source filters in order for the macro to continue. If not, then the macro will be skipped for this file entry.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "import_data"
|
||||
```toml
|
||||
[newgrounds]
|
||||
action = "import_data"
|
||||
source_format = "json"
|
||||
source_location = "{filename}.json"
|
||||
source_filters = ["**/Newgrounds/**"]
|
||||
```
|
||||
=== "add_data"
|
||||
```toml
|
||||
[animated]
|
||||
action = "add_data"
|
||||
source_filters = ["**/*.gif", "**/*.apng"]
|
||||
```
|
||||
|
||||
<!-- ### Source Types
|
||||
|
||||
The `source_type` key allows for the explicit declaration of the type and/or format of the source data. When this key is omitted, TagStudio will default to the data type that makes the most sense for the destination [TagStudio type](#tagstudio-types).
|
||||
|
||||
- `string`: A character string (text)
|
||||
- `integer`: An integer
|
||||
- `float`: A floating point number
|
||||
- `url`: A string with a special URL formatting pass
|
||||
- [`ISO8601`](https://en.wikipedia.org/wiki/ISO_8601) A standard datetime format
|
||||
- `list:string`: List of strings (text)
|
||||
- `list:integer`: List of integers
|
||||
- `list:float`: List of floating point numbers -->
|
||||
|
||||
---
|
||||
|
||||
## Task Configuration
|
||||
|
||||
An [action's](#actions) tasks need to be configured using the built-in keys available to each action. These keys may be specific to certain actions, required or optional, or expect other specific formatting. The actions section will list each action's available keys, and the following list of keys will likewise list which actions they are compatible with along with any other rules.
|
||||
|
||||
Along with generally defining your own custom tasks, there are a few built-in tasks that have reserved names and offer extra functionality on top of your own tasks. These currently include:
|
||||
|
||||
- [`.inverse-map`](#many-to-1-inverse-map) (Inverse Tag Maps)
|
||||
- [`.map`](#manual-tag-mapping) (Tag Maps)
|
||||
- [`.template`](#templates) (Templates)
|
||||
|
||||
---
|
||||
|
||||
### `key`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`import_data`](#import-data)
|
||||
|
||||
The `key` key is used to specify the object key to target in your data source. If you're targeting a nested object, separate the names of the keys with a dot.
|
||||
|
||||
```toml
|
||||
[artstation]
|
||||
action = "import_data"
|
||||
source_format = "json"
|
||||
[artstation.tags]
|
||||
key="tags"
|
||||
ts_type = "tags"
|
||||
[artstation.mediums]
|
||||
key="mediums.name" # Nested key
|
||||
ts_type = "tags"
|
||||
```
|
||||
|
||||
When importing from the same key multiple times, you have the option to either choose different names for your task tables or use the same name with these tables wrapped in an extra pair of brackets.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "Single Import"
|
||||
```toml
|
||||
[newgrounds]
|
||||
# Newgrounds table info here
|
||||
[newgrounds.artist]
|
||||
key="artist"
|
||||
ts_type = "tags"
|
||||
use_context = false
|
||||
on_missing = "create"
|
||||
```
|
||||
=== "Multiple Imports"
|
||||
```toml
|
||||
[newgrounds]
|
||||
# Newgrounds table info here
|
||||
[newgrounds.artist_tag]
|
||||
key="artist"
|
||||
ts_type = "tags"
|
||||
use_context = false
|
||||
on_missing = "skip"
|
||||
[newgrounds.artist_text]
|
||||
key="artist"
|
||||
ts_type = "text_line"
|
||||
name = "Artist"
|
||||
```
|
||||
=== "Multiple Imports (Wrapped)"
|
||||
```toml
|
||||
[newgrounds]
|
||||
# Newgrounds table info here
|
||||
[[newgrounds.artist]]
|
||||
key="artist"
|
||||
ts_type = "tags"
|
||||
use_context = false
|
||||
on_missing = "skip"
|
||||
[[newgrounds.artist]]
|
||||
key="artist"
|
||||
ts_type = "text_line"
|
||||
name = "Artist"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### `ts_type`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`add_data`](#add-data), [`import_data`](#import-data)
|
||||
|
||||
The required `ts_type` key defines the destination data format inside TagStudio itself. This can be [tags](tags.md) or any [field](fields.md) type.
|
||||
|
||||
- [`tags`](tags.md)
|
||||
- [`text_line`](fields.md#text-line)
|
||||
- [`text_box`](fields.md#text-box)
|
||||
- [`datetime`](fields.md#datetime)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "Title Field"
|
||||
```toml
|
||||
[newgrounds]
|
||||
# newgrounds table info here
|
||||
[newgrounds.title]
|
||||
ts_type = "text_line"
|
||||
name = "Title"
|
||||
```
|
||||
=== "Tags"
|
||||
```toml
|
||||
[newgrounds]
|
||||
# newgrounds table info here
|
||||
[newgrounds.tags]
|
||||
ts_type = "tags"
|
||||
```
|
||||
|
||||
#### Field Specific Keys
|
||||
|
||||
`name`: The name of the field to import into.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "text_line"
|
||||
```toml
|
||||
[newgrounds.user]
|
||||
key="user"
|
||||
ts_type = "text_line"
|
||||
name = "Author"
|
||||
```
|
||||
=== "text_box"
|
||||
```toml
|
||||
[newgrounds.content]
|
||||
key="content"
|
||||
ts_type = "text_box"
|
||||
name = "Description"
|
||||
```
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note
|
||||
As of writing (v9.5.3) TagStudio fields still do not allow for custom names. The macro system is designed to be forward-thinking with this feature in mind, however only existing TagStudio field names are currently considered valid. Any invalid field names will default to the "Notes" field.
|
||||
|
||||
#### Tag Specific Keys
|
||||
|
||||
Since TagStudio tags are more complex than other traditional tag formats, there are several options for fine-tuning how tags should be imported.
|
||||
|
||||
`delimiter`: The delimiter between string tags to use.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "Comma + Space Separation"
|
||||
```toml
|
||||
[newgrounds.tags]
|
||||
ts_type = "tags"
|
||||
delimiter = ", "
|
||||
```
|
||||
=== "Newline Separation"
|
||||
```toml
|
||||
[newgrounds.tags]
|
||||
ts_type = "tags"
|
||||
delimiter = "\n"
|
||||
```
|
||||
|
||||
`on_missing`: Determines the behavior of how to react to source tags with no match in the library.
|
||||
|
||||
- `"prompt"`: Ask the user if they wish to create, skip, or manually choose an existing tag.
|
||||
- `"create"`: Automatically create a new TagStudio tag based on the source tag.
|
||||
- `"skip"` (Default): Ignore the unmatched tags.
|
||||
|
||||
```toml
|
||||
[newgrounds.tags]
|
||||
ts_type = "tags"
|
||||
strict = false
|
||||
use_context = true
|
||||
on_missing = "create"
|
||||
```
|
||||
|
||||
`prefix`: An optional prefix to remove.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! example
|
||||
Given a list of tags such as `["#tag1", "#tag2", "#tag3"]`, you may wish to remove the "`#`" prefix.
|
||||
|
||||
```toml
|
||||
[instagram.tags]
|
||||
ts_type = "tags"
|
||||
prefix = "#"
|
||||
```
|
||||
|
||||
`strict`: A flag that determines what [names](tags.md#naming-tags) of the TagStudio tags should be used to compare against the source data when matching.
|
||||
|
||||
- `true`: Only match against the TagStudio tag [name](tags.md#name) field.
|
||||
- `false` (Default): Match against any TagStudio tag name field including [shorthands](tags.md#shorthand), [aliases](tags.md#aliases), and the [disambiguation name](tags.md#disambiguation).
|
||||
|
||||
`use_context`: A flag that determines if TagStudio should use context clues from other source tags to provide more accurate tag matches.
|
||||
|
||||
- `true` (Default): Use context clue matching (slower, less ambiguous).
|
||||
- `false`: Ignore surrounding source tags (faster, more ambiguous).
|
||||
\*\*
|
||||
|
||||
---
|
||||
|
||||
### `value`
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! note ""
|
||||
Compatible Actions: [`add_data`](#add-data)
|
||||
|
||||
The `value` key is use specifically with the [`add_data`](#add-data) action to define what value should be added to the file entry.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "Title Field"
|
||||
```toml
|
||||
[animated]
|
||||
action = "add_data"
|
||||
source_filters = ["**/*.gif", "**/*.apng"]
|
||||
[animated.title]
|
||||
ts_type = "text_line"
|
||||
name = "Title"
|
||||
value = "Animated Image"
|
||||
```
|
||||
=== "Tags"
|
||||
```toml
|
||||
[animated]
|
||||
action = "add_data"
|
||||
source_filters = ["**/*.gif", "**/*.apng"]
|
||||
[animated.tags]
|
||||
ts_type = "tags"
|
||||
value = ["Animated"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Manual Tag Mapping
|
||||
|
||||
If the automatic tag matching system isn't enough to import tags the way you'd like, you can manually specify mappings between source and destination tags. Tables with the `.map` or `.inverse_map` task suffixes will be used to map tags in the nearest scope.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
=== "Global Scope"
|
||||
```toml
|
||||
# Applies to all actions in the macro file
|
||||
[map]
|
||||
```
|
||||
=== "Action Scope"
|
||||
```toml
|
||||
# Applies to all tasks in the "newgrounds" action
|
||||
[newgrounds.map]
|
||||
```
|
||||
=== "Key Scope"
|
||||
```toml
|
||||
# Only applies to the "ratings" task inside the "newgrounds" action
|
||||
[newgrounds.ratings.map]
|
||||
```
|
||||
|
||||
- `map`: Used for "[1 to 0](#1-to-0-ignore-matches)", "[1 to 1](#1-to-1)", and "[1 to many](#1-to-many)" mappings
|
||||
- `inverse_map`: Used for "[many to 1](#many-to-1-inverse-map)" mappings
|
||||
|
||||
---
|
||||
|
||||
#### 1 to 0 (Ignore Matches)
|
||||
|
||||
By mapping the key of the source tag name to an empty string, you can ignore that tag when matching with your own tags. This is useful if you're importing from a source that uses tags you don't wish to use or create inside your own libraries.
|
||||
|
||||
```toml
|
||||
[newgrounds.tags.map]
|
||||
# Source Tag Name = Nothing, Ignore Matches
|
||||
favorite = ""
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 1 to 1
|
||||
|
||||
By mapping the key or quoted string of a source tag to one of your TagStudio tags, you can directly specify a destination tag while bypassing the matching algorithm.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! tip
|
||||
Consider using tag [aliases](tags.md#aliases) instead of 1 to 1 mapping. This mapping technique is useful if you want to map a specific source tag to a destination tag that you otherwise don't consider to be an alternate name for the destination tag.
|
||||
|
||||
```toml
|
||||
[newgrounds.tags.map]
|
||||
# Source Tag Name = TagStudio Tag Name
|
||||
colored_pencil = "Drawing"
|
||||
"Colored Pencil" = "Drawing"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### 1 to Many
|
||||
|
||||
By mapping the key or quoted string of a source tag to a **list of your TagStudio tags**, you can cause one source tag to import as more than one of your TagStudio tags.
|
||||
|
||||
```toml
|
||||
[newgrounds.tags.map]
|
||||
# Source Tag Name = List of TagStudio Tag Names
|
||||
drawing = ["Drawing (2D)", "Image (Meta Tags)"]
|
||||
video = ["Animation (2D)", "Animated (Meta Tags)"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### Many to 1 (Inverse Map)
|
||||
|
||||
By mapping the key or quoted string of one of your TagStudio tags to a **list of source tags**, you can declare a combination of required source tags that result in a wholly new matched TagStudio tag. This is useful if you use a single tag in your TagStudio library that is represented by multiple separate tags from your source.
|
||||
|
||||
```toml
|
||||
[newgrounds.tags.inverse_map]
|
||||
# TagStudio Tag Name = List of Source Tag Names
|
||||
"Animation (2D)" = ["drawing", "video"]
|
||||
"Animation (3D)" = ["3D", "video"]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Templates
|
||||
|
||||
Templates are part of the `input_data` action and allow you to take data from one or more keys of a source and combine them into a single value. Template sub-action tables must begin with the action name and end with `.template` (e.g. `[action.template]`). Source object keys can be embedded in a string value if surrounded by curly braces (`{}`). Nested keys are accessed by separating the keys with a dot (e.g. `{key.nested_key}`).
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
=== "Composite Template"
|
||||
```toml
|
||||
[bluesky.template]
|
||||
template = "https://www.bsky.app/profile/{author.handle}/post/{post_id}"
|
||||
ts_type = "text_line"
|
||||
name = "Source"
|
||||
```
|
||||
=== "Multiple Templates per Action"
|
||||
```toml
|
||||
[[artstation.template]]
|
||||
template = "Original Tags: {tags}"
|
||||
ts_type = "text_box"
|
||||
name = "Notes"
|
||||
|
||||
[[artstation.template]]
|
||||
template = "Original Mediums: {mediums}"
|
||||
ts_type = "text_box"
|
||||
name = "Notes"
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
@@ -1,16 +1,8 @@
|
||||
# :material-database: Library
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! info
|
||||
This page is a work in progress and needs to be updated with additional information.
|
||||
|
||||
The library is how TagStudio represents your chosen directory, with every file inside being represented by a [file entry](./entry.md). You can have as many or few libraries as you wish, since each libraries' data is stored within a `.TagStudio` folder at its root. From there the library save file itself is stored as `ts_library.sqlite`, with TagStudio versions 9.4 and below using a the legacy `ts_library.json` format.
|
||||
|
||||
Note that this means [tags](./tag.md) you create only exist _per-library_. Global tags along with other library structure updates are planned for future releases on the [roadmap](../updates/roadmap.md#library).
|
||||
|
||||
---
|
||||
icon: material/image-check
|
||||
---
|
||||
|
||||
## Preview Support
|
||||
# :material-image-check: Supported Previews
|
||||
|
||||
TagStudio offers built-in preview and thumbnail support for a wide variety of file types. Files that don't have explicit support can still be added to your library like normal, they will just show a default icon for thumbnails and previews. TagStudio also references the file's [MIME](https://en.wikipedia.org/wiki/Media_type) type in an attempt to render previews for file types that haven't gained explicit support yet.
|
||||
|
||||
@@ -31,7 +23,7 @@ Images will generate thumbnails the first time they are viewed or since the last
|
||||
| OpenEXR | `.exr` | :material-minus-circle:{.lg .gray} |
|
||||
| OpenRaster | `.ora` | :material-minus-circle:{.lg .gray} |
|
||||
| PNG | `.png` | :material-minus-circle:{.lg .gray} |
|
||||
| SVG | `.svg` | :material-minus-circle:{.lg .gray} |
|
||||
| SVG | `.svg` | :material-close-circle:{.lg .red} |
|
||||
| TIFF | `.tiff`, `.tif` | :material-minus-circle:{.lg .gray} |
|
||||
| Valve Texture Format | `.vtf` | :material-close-circle:{.lg .red} |
|
||||
| WebP | `.webp` | :material-check-circle:{.lg .green} |
|
||||
@@ -51,7 +43,7 @@ Images will generate thumbnails the first time they are viewed or since the last
|
||||
|
||||
### :material-movie-open: Videos
|
||||
|
||||
Video thumbnails will default to the closest viable frame from the middle of the video. Both thumbnail generation and video playback in the Preview Panel requires [FFmpeg](../install.md#third-party-dependencies) installed on your system.
|
||||
Video thumbnails will default to the closest viable frame from the middle of the video. Both thumbnail generation and video playback in the Preview Panel requires [FFmpeg](install.md#third-party-dependencies) installed on your system.
|
||||
|
||||
| Filetype | Extensions | Dependencies |
|
||||
| --------------------- | ----------------------- | :----------: |
|
||||
@@ -69,7 +61,7 @@ Video thumbnails will default to the closest viable frame from the middle of the
|
||||
|
||||
### :material-sine-wave: Audio
|
||||
|
||||
Audio thumbnails will default to embedded cover art (if any) andfallback to generated waveform thumbnails. Audio file playback is supported in the Preview Panel if you have [FFmpeg](../install.md#third-party-dependencies) installed on your system. Audio waveforms are currently not cached.
|
||||
Audio thumbnails will default to embedded cover art (if any) andfallback to generated waveform thumbnails. Audio file playback is supported in the Preview Panel if you have [FFmpeg](install.md#third-party-dependencies) installed on your system. Audio waveforms are currently not cached.
|
||||
|
||||
| Filetype | Extensions | Dependencies |
|
||||
| ------------------- | ------------------------ | :----------: |
|
||||
@@ -101,11 +93,18 @@ Preview support for office documents or well-known project file formats varies b
|
||||
| Photoshop | `.psd` | Flattened image render |
|
||||
| PowerPoint (Microsoft Office) | `.pptx`, `.ppt` | Embedded thumbnail :material-alert-circle:{ title="If available in file" } |
|
||||
|
||||
### 3D Models
|
||||
### :material-book: eBooks
|
||||
|
||||
| Filetype | Extensions | Preview Type |
|
||||
| ------------------ | --------------------- | ---------------------------- |
|
||||
| EPUB | `.epub` | Embedded cover |
|
||||
| Comic Book Archive | `.cbr`, `.cbt` `.cbz` | Embedded cover or first page |
|
||||
|
||||
### :material-cube-outline: 3D Models
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! failure "3D Model Support"
|
||||
TagStudio does not currently support previews for 3D model files *(outside of Blender project embedded thumbnails)*. This is on our [roadmap](../updates/roadmap.md#uiux) for future features.
|
||||
TagStudio does not currently support previews for 3D model files *(outside of Blender project embedded thumbnails)*. This is on our [roadmap](roadmap.md#uiux) for a future release.
|
||||
|
||||
### :material-format-font: Fonts
|
||||
|
||||
@@ -123,7 +122,7 @@ Font thumbnails will use a "Aa" example preview of the font, with a full alphanu
|
||||
!!! info "Plain Text Support"
|
||||
TagStudio supports the *vast* majority of files considered to be "[plain text](https://en.wikipedia.org/wiki/Plain_text)". If an extension or format is not listed here, odds are it's still supported anyway.
|
||||
|
||||
Text files render the first 256 bytes of text information to an image preview for thumbnails and the Preview Panel. Improved thumbnails, full scrollable text, and syntax highlighting are on our [roadmap](../updates/roadmap.md#uiux) for future features.
|
||||
Text files render the first 256 bytes of text information to an image preview for thumbnails and the Preview Panel. Improved thumbnails, full scrollable text, and syntax highlighting are on our [roadmap](roadmap.md#uiux) for future features.
|
||||
|
||||
| Filetype | Extensions | Syntax Highlighting |
|
||||
| ---------- | --------------------------------------------- | :--------------------------------: |
|
||||
@@ -136,12 +135,6 @@ Text files render the first 256 bytes of text information to an image preview fo
|
||||
| XML | `.xml`, `.xul` | :material-close-circle:{.lg .red} |
|
||||
| YAML | `.yaml`, `.yml` | :material-close-circle:{.lg .red} |
|
||||
|
||||
### :material-file: Other
|
||||
|
||||
| Filetype | Extensions | Preview Type |
|
||||
| -------- | ---------- | -------------------- |
|
||||
| EPUB | `.epub` | Embedded ebook cover |
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
[^1]:
|
||||
The `.jpg_large` extension is unofficial and instead the byproduct of how [Google Chrome used to download images from Twitter](https://fileinfo.com/extension/jpg_large). Since this mangled extension is still in circulation, TagStudio supports it.
|
||||
34
docs/relinking.md
Normal file
34
docs/relinking.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: Entry Relinking
|
||||
icon: material/link-variant
|
||||
---
|
||||
|
||||
# :material-link-variant: Entry Relinking
|
||||
|
||||
### Fix Unlinked Entries
|
||||
|
||||
This tool displays the number of unlinked [entries](entries.md), and some options for their resolution.
|
||||
|
||||
Refresh
|
||||
|
||||
- Scans through the library and updates the unlinked entry count.
|
||||
|
||||
Search & Relink
|
||||
|
||||
- Attempts to automatically find and reassign missing files.
|
||||
|
||||
Delete Unlinked Entries
|
||||
|
||||
- Displays a confirmation prompt containing the list of all missing files to be deleted before committing to or cancelling the operation.
|
||||
|
||||
### Fix Duplicate Files
|
||||
|
||||
This tool allows for management of duplicate files in the library using a [DupeGuru](https://dupeguru.voltaicideas.net/) file.
|
||||
|
||||
Load DupeGuru File
|
||||
|
||||
- load the "results" file created from a DupeGuru scan
|
||||
|
||||
Mirror Entries
|
||||
|
||||
- Duplicate entries will have their contents mirrored across all instances. This allows for duplicate files to then be deleted with DupeGuru as desired, without losing the [field](fields.md) data that has been assigned to either. (Once deleted, the "Fix Unlinked Entries" tool can be used to clean up the duplicates)
|
||||
@@ -39,8 +39,8 @@ Must be finalized or deemed "feature complete" before other core features are de
|
||||
!!! note
|
||||
See the "[Library](#library)" section for features related to the library database rather than the underlying schema.
|
||||
|
||||
- [x] A SQLite-based library save file format **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [ ] Cached File Properties Table :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [x] A SQLite-based library save file format **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [ ] Cached File Properties Table :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [x] Date Entry Added to Library :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Date File Created :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Date File Modified :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
@@ -77,16 +77,16 @@ A detailed written specification for the TagStudio tag and/or library format. In
|
||||
- [ ] Lightbox View :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- Similar to List View in concept, but displays one large preview that can cycle back/forth between entries.
|
||||
- [ ] Smaller thumbnails of immediate adjacent entries below :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [x] Library Statistics Screen :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.5.4]**
|
||||
- [ ] Unified Library Health/Cleanup Screen :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.5.4]**
|
||||
- [x] Library Statistics Screen **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [x] Unified Library Health/Cleanup Screen **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [x] Fix Unlinked Entries
|
||||
- [x] Fix Duplicate Files
|
||||
- [x] ~~Fix Duplicate Entries~~
|
||||
- [ ] Remove Ignored Entries :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.4]**
|
||||
- [ ] Delete Old Backups :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.5.5]**
|
||||
- [ ] Delete Legacy JSON File :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.5.5]**
|
||||
- [x] Remove Ignored Entries **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [x] Delete Old Backups **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [x] Delete Legacy JSON File **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [x] Translations
|
||||
- [ ] Search Bar Rework :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.0]**
|
||||
- [ ] Search Bar Rework :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.x]**
|
||||
- [ ] Improved Tag Autocomplete :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Tags appear as widgets in search bar :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Unified Media Player
|
||||
@@ -111,9 +111,9 @@ A detailed written specification for the TagStudio tag and/or library format. In
|
||||
- [ ] Recent Tags
|
||||
- [ ] Tag Search
|
||||
- [ ] Pinned Tags
|
||||
- [ ] New Tabbed Tag Building UI to Support New Tag Features :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] New Tabbed Tag Building UI to Support New Tag Features :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Custom Thumbnail Overrides :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Media Duration Labels :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Media Duration Labels :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Word/Line Count Labels :material-chevron-up:{ .priority-low title="Low Priority" }
|
||||
- [ ] Custom Tag Badges :material-chevron-up:{ .priority-low title="Low Priority" }
|
||||
- Would serve as an addition/alternative to the Favorite and Archived badges.
|
||||
@@ -125,7 +125,7 @@ A detailed written specification for the TagStudio tag and/or library format. In
|
||||
- [x] Language
|
||||
- [x] Date and Time Format
|
||||
- [x] Theme
|
||||
- [x] Thumbnail Generation :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.5.4]**
|
||||
- [x] Thumbnail Generation **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [x] Configurable Page Size
|
||||
- [ ] Library Settings :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Stored in `.TagStudio` folder :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
@@ -140,24 +140,24 @@ Some form of official plugin support for TagStudio, likely with its own API that
|
||||
|
||||
---
|
||||
|
||||
## [Library](../library/index.md)
|
||||
## [Library](libraries.md)
|
||||
|
||||
### :material-wrench: Library Mechanics
|
||||
|
||||
- [x] Per-Library Tags
|
||||
- [ ] Global Tags :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Multiple Root Directories :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Ability to store TagStudio library folder separate from library files :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Automatic Entry Relinking :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.0]**
|
||||
- [ ] Multiple Root Directories :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Ability to store TagStudio library folder separate from library files :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Automatic Entry Relinking :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.x]**
|
||||
- [ ] Detect Renames :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Detect Moves :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Detect Deletions :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Performant :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Background File Scanning :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.0]**
|
||||
- [x] Thumbnail Caching **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [ ] Audio Waveform Caching :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.7.0]**
|
||||
- [ ] Background File Scanning :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.x]**
|
||||
- [x] Thumbnail Caching **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [ ] Audio Waveform Caching :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.7.x]**
|
||||
|
||||
### :material-grid: [Entries](../library/entry.md)
|
||||
### :material-grid: [Entries](entries.md)
|
||||
|
||||
Library representations of files or file-like objects.
|
||||
|
||||
@@ -167,10 +167,10 @@ Library representations of files or file-like objects.
|
||||
- [x] Fields
|
||||
- [x] Text Lines
|
||||
- [x] Text Boxes
|
||||
- [x] Datetimes **[v9.5.4]**
|
||||
- [ ] User-Titled Fields :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Removal of Deprecated Fields :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Entry Groups :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.0]**
|
||||
- [x] Datetimes **[[v9.5.4](changelog.md#954-september-1st-2025)]**
|
||||
- [ ] User-Titled Fields :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Removal of Deprecated Fields :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Entry Groups :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.7.x]**
|
||||
- [ ] Non-exclusive; Entries can be in multiple groups :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Ability to number entries within group :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Ability to set sorting method for group :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
@@ -178,83 +178,92 @@ Library representations of files or file-like objects.
|
||||
- [ ] Group is treated as entry with tags and metadata :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Nested groups :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
|
||||
### :material-tag-text: [Tags](../library/tag.md)
|
||||
### :material-tag-text: [Tags](tags.md)
|
||||
|
||||
Discrete library objects representing [attributes](<https://en.wikipedia.org/wiki/Property_(philosophy)>). Can be applied to library [entries](../library/entry.md), or applied to other tags to build traversable relationships.
|
||||
Discrete library objects representing [attributes](<https://en.wikipedia.org/wiki/Property_(philosophy)>). Can be applied to library [entries](entries.md), or applied to other tags to build traversable relationships.
|
||||
|
||||
- [x] Tag Name **[v8.0.0]**
|
||||
- [x] Tag Shorthand Name **[v8.0.0]**
|
||||
- [x] Tag Aliases List **[v8.0.0]**
|
||||
- [x] Tag Color **[v8.0.0]**
|
||||
- [ ] Tag Description :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.6.0]**
|
||||
- [ ] Tag Description :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.6.x]**
|
||||
- [x] Tag Colors
|
||||
- [x] Built-in Color Palette **[v8.0.0]**
|
||||
- [x] User-Defined Colors **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Primary and Secondary Colors **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [ ] Tag Icons :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Small Icons :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Large Icons for Profiles :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.6.0]**
|
||||
- [ ] Built-in Icon Packs (i.e. Boxicons) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] User-Defined Icons :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [x] [Category Property](../library/tag_categories.md) **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] User-Defined Colors **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Primary and Secondary Colors **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [ ] Tag Icons :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Small Icons :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Large Icons for Profiles :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.6.x]**
|
||||
- [ ] Built-in Icon Packs (i.e. Boxicons) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] User-Defined Icons :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [x] [Category Property](tags.md#is-category) **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Property available for tags that allow the tag and any inheriting from it to be displayed separately in the preview panel under a title
|
||||
- [ ] Fine-tuned exclusion from categories :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Hidden Property :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Built-in "Archived" tag has this property by default :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Checkbox near search bar to show hidden tags in search :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Fine-tuned exclusion from categories :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Hidden Property :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Built-in "Archived" tag has this property by default :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Checkbox near search bar to show hidden tags in search :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Tag Relationships
|
||||
- [x] [Parent Tags](../library/tag.md#parent-tags) ([Inheritance](<https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)>) Relationship) **[v9.0.0]**
|
||||
- [ ] [Component Tags](../library/tag.md#component-tags) ([Composition](https://en.wikipedia.org/wiki/Object_composition) Relationship) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Multiple Language Support :material-chevron-up:{ .priority-low title="Low Priority" } **[v9.9.0]**
|
||||
- [x] [Parent Tags](tags.md#parent-tags) ([Inheritance](<https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)>) Relationship) **[v9.0.0]**
|
||||
- [ ] [Component Tags](tags.md#component-tags) ([Composition](https://en.wikipedia.org/wiki/Object_composition) Relationship) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Multiple Language Support :material-chevron-up:{ .priority-low title="Low Priority" } **[v9.9.x]**
|
||||
- [ ] Tag Overrides :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Tag Merging :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
|
||||
### :material-magnify: [Search](../library/library_search.md)
|
||||
### :material-magnify: [Search](search.md)
|
||||
|
||||
- [x] Tag Search **[v8.0.0]**
|
||||
- [x] Filename Search **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Glob Search **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Filetype Search **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Search by Extension (e.g. ".jpg", ".png") **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Optional consolidation of extension synonyms (i.e. ".jpg" can equal ".jpeg") **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Search by media type (e.g. "image", "video", "document") **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [ ] Field Content Search :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [x] [Boolean Operators](../library/library_search.md) **[[v9.5.0](./changelog.md#950-2025-03-03)]**
|
||||
- [x] Filename Search **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Glob Search **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Filetype Search **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Search by Extension (e.g. ".jpg", ".png") **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Optional consolidation of extension synonyms (i.e. ".jpg" can equal ".jpeg") **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] Search by media type (e.g. "image", "video", "document") **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [ ] Field Content Search :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [x] [Boolean Operators](search.md) **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [x] `AND` Operator
|
||||
- [x] `OR` Operator
|
||||
- [x] `NOT` Operator
|
||||
- [x] Parenthesis Grouping
|
||||
- [x] Character Escaping
|
||||
- [ ] `HAS` Operator (for [Component Tags](../library/tag.md#component-tags)) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Conditional Search :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.7.0]**
|
||||
- [ ] `HAS` Operator (for [Component Tags](tags.md#component-tags)) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Conditional Search :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.7.x]**
|
||||
- [ ] Compare Dates :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Compare Durations :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Compare File Sizes :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Compare Dimensions :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [x] Smartcase Search [[v9.5.0](./changelog.md#950-2025-03-03)]
|
||||
- [x] Smartcase Search **[[v9.5.0](changelog.md#950-march-3rd-2025)]**
|
||||
- [ ] Search Result Sorting
|
||||
- [x] Sort by Filename **[[v9.5.2](./changelog.md#952-2025-03-31)]**
|
||||
- [x] Sort by Date Entry Added to Library **[[v9.5.2](./changelog.md#952-2025-03-31)]**
|
||||
- [ ] Sort by File Creation Date :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Sort by File Modification Date :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [x] Sort by Filename **[[v9.5.2](changelog.md#952-march-31st-2025)]**
|
||||
- [x] Sort by Date Entry Added to Library **[[v9.5.2](changelog.md#952-march-31st-2025)]**
|
||||
- [ ] Sort by File Creation Date :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Sort by File Modification Date :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [ ] Sort by File Modification Date :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Sort by Date Taken (Photos) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.0]**
|
||||
- [ ] Sort by Date Taken (Photos) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.6.x]**
|
||||
- [x] Random/Shuffle Sort
|
||||
- [ ] OCR Search :material-chevron-up:{ .priority-low title="Low Priority" }
|
||||
- [ ] Fuzzy Search :material-chevron-up:{ .priority-low title="Low Priority" }
|
||||
|
||||
### :material-file-cog: [Macros](../utilities/macro.md)
|
||||
### :material-script-text: [Macros](macros.md)
|
||||
|
||||
- [ ] Standard, Human Readable Format (TOML) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.5]**
|
||||
- [ ] Versioning System :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.5]**
|
||||
- [ ] Standard, Human Readable Format (TOML) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.x]**
|
||||
- [ ] Versioning System :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.x]**
|
||||
- [ ] # Triggers **[v9.5.x]**
|
||||
- [x] Standard, Human Readable Format (TOML) :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.5]**
|
||||
- [x] Versioning System :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.5]**
|
||||
- [ ] Triggers **[v9.5.5]**
|
||||
- [ ] On File Added :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] On Library Refresh :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] [...]
|
||||
- [ ] Actions **[v9.5.5]**
|
||||
- [ ] Add Tag(s) :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Add Field(s) :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Set Field Content :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Actions **[v9.5.x]**
|
||||
- [x] Import from JSON file :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Import from plaintext file :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Import from XML file :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Create templated fields from other table keys :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Remove tag prefixes from import sources :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Specify tag delimiters from import sources :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Add data (tags + fields) configured in macro :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Glob filter for entry file :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Map source tags to TagStudio tags :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] [...]
|
||||
|
||||
### :material-table-arrow-right: Sharable Data
|
||||
@@ -262,22 +271,22 @@ Discrete library objects representing [attributes](<https://en.wikipedia.org/wik
|
||||
Sharable TagStudio library data in the form of data packs (tags, colors, etc.) or other formats.
|
||||
Packs are intended as an easy way to import and export specific data between libraries and users, while export-only formats are intended to be imported by other programs.
|
||||
|
||||
- [ ] Color Packs :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.5]**
|
||||
- [ ] Color Packs :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.x]**
|
||||
- [ ] Importable
|
||||
- [ ] Exportable
|
||||
- [x] UUIDs + Namespaces :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Standard, Human Readable Format (TOML) :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Versioning System :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Tag Packs :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.9.0]**
|
||||
- [ ] Tag Packs :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.9.x]**
|
||||
- [ ] Importable :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Exportable :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] UUIDs + Namespaces :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Standard, Human Readable Format (TOML) :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Versioning System :material-chevron-double-up:{ .priority-med title="Medium Priority" }
|
||||
- [ ] Macro Sharing :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.5]**
|
||||
- [ ] Importable :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Exportable :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Sharable Entry Data :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.9.0]**
|
||||
- [x] Macro Sharing :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v9.5.x]**
|
||||
- [x] Importable :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [x] Exportable :material-chevron-triple-up:{ .priority-high title="High Priority" }
|
||||
- [ ] Sharable Entry Data :material-chevron-double-up:{ .priority-med title="Medium Priority" } **[v9.9.x]**
|
||||
- _Specifics of this are yet to be determined_
|
||||
- [ ] Export Library to Human Readable Format :material-chevron-triple-up:{ .priority-high title="High Priority" } **[v10.0.0]**
|
||||
- Intended to give users more flexible options with their data if they wish to migrate away from TagStudio
|
||||
@@ -2,7 +2,7 @@
|
||||
icon: material/magnify
|
||||
---
|
||||
|
||||
# :material-magnify: Search
|
||||
# :material-magnify: Searching
|
||||
|
||||
TagStudio provides various methods to search your library, ranging from TagStudio data such as tags to inherent file data such as paths or media types.
|
||||
|
||||
@@ -58,13 +58,13 @@ Sometimes search queries have ambiguous characters and need to be "escaped". Thi
|
||||
|
||||
## Tags
|
||||
|
||||
[Tag](#tags) search is the default mode of file entry search in TagStudio. No keyword prefix is required, however using `tag:` will also work. The tag search attempts to match tag [names](./tag.md#name), [shorthands](./tag.md#shorthand), [aliases](./tag.md#aliases), as well as allows for tags to [substitute](./tag.md#intuition-via-substitution) in for any of their [parent tags](./tag.md#parent-tags).
|
||||
[Tag](#tags) search is the default mode of file entry search in TagStudio. No keyword prefix is required, however using `tag:` will also work. The tag search attempts to match tag [names](tags.md#name), [shorthands](tags.md#shorthand), [aliases](tags.md#aliases), as well as allows for tags to [substitute](tags.md#intuition-via-substitution) in for any of their [parent tags](tags.md#parent-tags).
|
||||
|
||||
You may also see the `tag_id:` prefix keyword show up when using the right-click "Search for Tag" option on tags. This is meant for internal use, and eventually will not be displayed or accessible to the user.
|
||||
|
||||
## Fields
|
||||
|
||||
_[Field](./field.md) search is currently not in the program, however is coming in a future version._
|
||||
_[Field](fields.md) search is currently not in the program, however is coming in a future version._
|
||||
|
||||
## File Entry Search
|
||||
|
||||
96
docs/style.md
Normal file
96
docs/style.md
Normal file
@@ -0,0 +1,96 @@
|
||||
---
|
||||
icon: material/sign-text
|
||||
---
|
||||
|
||||
# :material-sign-text: Style Guide
|
||||
|
||||
## Formatting
|
||||
|
||||
Most of the style guidelines can be checked, fixed, and enforced via Ruff. Older code may not be adhering to all of these guidelines, in which case _"do as I say, not as I do"..._
|
||||
|
||||
- Do your best to write clear, concise, and modular code.
|
||||
- This should include making methods private by default (e.g. `__method()`)
|
||||
- Methods should only be protected (e.g. `_method()`) or public (e.g. `method()`) when needed and warranted
|
||||
- Keep a maximum column width of no more than **100** characters.
|
||||
- Code comments should be used to help describe sections of code that can't speak for themselves.
|
||||
- Use [Google style](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings) docstrings for any classes and functions you add.
|
||||
- If you're modifying an existing function that does _not_ have docstrings, you don't _have_ to add docstrings to it... but it would be pretty cool if you did ;)
|
||||
- Imports should be ordered alphabetically.
|
||||
- Lists of values should be ordered using their [natural sort order](https://en.wikipedia.org/wiki/Natural_sort_order).
|
||||
- Some files have their methods ordered alphabetically as well (i.e. [`thumb_renderer`](https://github.com/TagStudioDev/TagStudio/blob/main/src/tagstudio/qt/widgets/thumb_renderer.py)). If you're working in a file and notice this, please try and keep to the pattern.
|
||||
- When writing text for window titles or form titles, use "[Title Case](https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case)" capitalization. Your IDE may have a command to format this for you automatically, although some may incorrectly capitalize short prepositions. In a pinch you can use a website such as [capitalizemytitle.com](https://capitalizemytitle.com/) to check.
|
||||
- If it wasn't mentioned above, then stick to [**PEP-8**](https://peps.python.org/pep-0008/)!
|
||||
|
||||
## Qt
|
||||
|
||||
As of writing this section, the QT part of the code base is quite unstructured and the View and Controller parts are completely intermixed[^1]. This makes maintenance, fixes and general understanding of the code base quite challenging, because the interesting parts you are looking for are entangled in a bunch of repetitive UI setup code. To address this we are aiming to more strictly separate the view and controller aspects of the QT frontend.
|
||||
|
||||
The general structure of the QT code base should look like this:
|
||||
|
||||
```
|
||||
qt
|
||||
├── controllers
|
||||
│ ├── widgets
|
||||
│ │ └── preview_panel_controller.py
|
||||
│ └── main_window_controller.py
|
||||
├── views
|
||||
│ ├── widgets
|
||||
│ │ └── preview_panel_view.py
|
||||
│ └── main_window_view.py
|
||||
├── ts_qt.py
|
||||
└── mixed.py
|
||||
```
|
||||
|
||||
In this structure there are the `views` and `controllers` sub-directories. They have the exact same structure and for every `<component>_view.py` there is a `<component>_controller.py` at the same location in the other subdirectory and vice versa.
|
||||
|
||||
Typically the classes should look like this:
|
||||
|
||||
```py
|
||||
# my_cool_widget_view.py
|
||||
class MyCoolWidgetView(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.__button = QPushButton()
|
||||
self.__color_dropdown = QComboBox()
|
||||
# ...
|
||||
self.__connect_callbacks()
|
||||
|
||||
def __connect_callbacks(self):
|
||||
self.__button.clicked.connect(self._button_click_callback)
|
||||
self.__color_dropdown.currentIndexChanged.connect(
|
||||
lambda idx: self._color_dropdown_callback(self.__color_dropdown.itemData(idx))
|
||||
)
|
||||
|
||||
def _button_click_callback(self):
|
||||
raise NotImplementedError()
|
||||
```
|
||||
|
||||
```py
|
||||
# my_cool_widget_controller.py
|
||||
class MyCoolWidget(MyCoolWidgetView):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
def _button_click_callback(self):
|
||||
print("Button was clicked!")
|
||||
|
||||
def _color_dropdown_callback(self, color: Color):
|
||||
print(f"The selected color is now: {color}")
|
||||
```
|
||||
|
||||
Observe the following key aspects of this example:
|
||||
|
||||
- The Controller is just called `MyCoolWidget` instead of `MyCoolWidgetController` as it will be directly used by other code
|
||||
- The UI elements are in private variables
|
||||
- This enforces that the controller shouldn't directly access UI elements
|
||||
- Instead the view should provide a protected API (e.g. `_get_color()`) for things like setting/getting the value of a dropdown, etc.
|
||||
- Instead of `_get_color()` there could also be a `_color` method marked with `@property`
|
||||
- The callback methods are already defined as protected methods with NotImplementedErrors
|
||||
- Defines the interface the callbacks
|
||||
- Enforces that UI events be handled
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
!!! tip
|
||||
A good (non-exhaustive) rule of thumb is: If it requires a non-UI import, then it doesn't belong in the `*_view.py` file.
|
||||
|
||||
[^1]: For an explanation of the Model-View-Controller (MVC) Model, checkout this article: [MVC Framework Introduction](https://www.geeksforgeeks.org/mvc-framework-introduction/).
|
||||
@@ -26,6 +26,36 @@
|
||||
);
|
||||
}
|
||||
|
||||
.md-tabs {
|
||||
background: none;
|
||||
font-family: "Bai Jamjuree", Roboto, sans-serif;
|
||||
font-weight: 500;
|
||||
letter-spacing: -0.05rem !important;
|
||||
}
|
||||
.md-tabs__link {
|
||||
opacity: 1;
|
||||
color: var(--md-default-fg-color--light);
|
||||
padding: 0.1rem;
|
||||
}
|
||||
.md-tabs__link:hover {
|
||||
color: var(--md-accent-fg-color) !important;
|
||||
}
|
||||
.md-tabs__item--active {
|
||||
color: var(--md-typeset-a-color) !important;
|
||||
|
||||
border-color: var(--md-typeset-a-color) !important;
|
||||
border-width: 0 0 2px 0 !important;
|
||||
border: solid;
|
||||
}
|
||||
.md-tabs__item {
|
||||
height: 1.8rem;
|
||||
}
|
||||
.md-tabs__link {
|
||||
font-size: 0.8rem;
|
||||
margin-top: 0.2rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
|
||||
/* Mobile Nav Header */
|
||||
.md-nav__source {
|
||||
background: linear-gradient(
|
||||
@@ -43,6 +73,15 @@ td {
|
||||
padding: 0.5em 1em 0.5em 1em !important;
|
||||
}
|
||||
|
||||
.md-typeset ul li ul {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.1rem;
|
||||
}
|
||||
|
||||
.md-typeset ul li {
|
||||
margin-bottom: 0.1rem;
|
||||
}
|
||||
|
||||
.md-header {
|
||||
border-style: solid;
|
||||
border-width: 0 0 2px 0;
|
||||
|
||||
@@ -12,3 +12,16 @@ h2 {
|
||||
font-size: 1rem !important;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
|
||||
.md-content {
|
||||
margin-left: 5.5rem;
|
||||
margin-right: 5.5rem;
|
||||
}
|
||||
|
||||
/* Keeps four cards in a square on all screens */
|
||||
@media screen and (max-width: 64em) {
|
||||
.md-content {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +26,15 @@ This is a special type of alias that's used for shortening the tag name under sp
|
||||
|
||||
Aliases are alternate names that the tag can go by. This may include individual first names for people, alternate spellings, shortened names, and more. If there's a common abbreviation or shortened name for your tag, it's recommended to use the [shorthand](#shorthand) field for this instead.
|
||||
|
||||
When searching for a tag, aliases (including the shorthand) can also be used to find the tag. This not only includes searching for tags themselves, but for tagged [file entries](./entry.md) as well!
|
||||
When searching for a tag, aliases (including the shorthand) can also be used to find the tag. This not only includes searching for tags themselves, but for tagged [file entries](entries.md) as well!
|
||||
|
||||
### Automatic Disambiguation
|
||||
### Disambiguation
|
||||
|
||||
Just as in real life, sometimes there are different attributes that share the same name with one another. The process of adding specificity to something in order to not confuse it with something similar is known as [disambiguation](https://en.wikipedia.org/wiki/Word-sense_disambiguation). In TagStudio we give the option to automatically disambiguate tag names based on a specially marked [Parent Tag](#parent-tags). Parent tags are explained in further detail below, but for the purposes of tag names they can lend themselves to clarifying the name of a tag without the user needing to manually change the name or add complicated aliases.
|
||||
|
||||
Given a tag named "Freddy", we may confuse it with other "Freddy" tags in our library. There are lots of Freddys in the world, after all. If we're talking about Freddy from "Five Nights at Freddy's", then we may already (and likely should) have a separate "Five Nights at Freddy's" tag added as a parent tag. When the disambiguation box next to a parent tag is selected (see image below) then our tag name will automatically display its name with that parent tag's name (or shorthand if available) in parentheses.
|
||||
|
||||

|
||||

|
||||
|
||||
So if the "Five Nights at Freddy's" tag is added as a parent tag on the "Freddy" tag, and the disambiguation box next to it is checked, then our tag name will automatically be displayed as "Freddy (Five Nights at Freddy's)". Better yet, if the "Five Nights at Freddy's" tag has a shorthand such as "FNAF", then our "Freddy" tag will be displayed as "Freddy (FNAF)". This process preserves our base tag name ("Freddy") and provides an option to get a clean and consistent method to display disambiguating parent categories, rather than having to type this information in manually for each applicable tag.
|
||||
|
||||
@@ -52,7 +52,7 @@ One of the core properties of tags in TagStudio is their ability to form relatio
|
||||
|
||||
In a system where tags have no relationships, you're required to add as many tags as you possibly can to describe every last element of an image or file. If you want to tag an image of Shrek, you need to add a tag for `Shrek` himself, a `Character` tag since he's a character, a `Movie` and perhaps `Dreamworks` tag since he's a character from a movie, or perhaps a `Book` tag if we're talking about the original character, and then of course tags for every other attribute of Shrek shown or implied. By allowing tags to have inheritance relationships, we can have a single `Shrek` tag inherit from `Character` (Shrek IS a character) as well as from a separate `Shrek (Movie Franchise)` tag that itself inherits from `Movie Franchise` and `Dreamworks`. Now by simply adding the `Shrek` tag to an image, we've effectively also added the `Character`, `Shrek (Move Franchise)`, `Movie Franchise`, and `Dreamworks` attributes all in one go. On the image entry itself we only see `Shrek`, but the rest of the attributes are implied.
|
||||
|
||||

|
||||

|
||||
|
||||
#### Intuition via Substitution
|
||||
|
||||
@@ -64,7 +64,9 @@ Lastly, when searching your files with broader categories such as `Character` or
|
||||
|
||||
### Component Tags
|
||||
|
||||
**_Coming in version 9.6_**
|
||||
<!-- prettier-ignore -->
|
||||
!!! warning ""
|
||||
**_Coming in version 9.6.x_**
|
||||
|
||||
Component tags will be built from a composition-based, or "HAS" type relationship between tags. This takes care of instances where an attribute may "have" another attribute, but doesn't inherit from it. Shrek may be an `Ogre`, he may be a `Character`, but he is NOT a `Leather Vest` - even if he's commonly seen _with_ it. Component tags, along with the upcoming "Tag Override" feature, are built to handle these cases in a way that still simplifies the tagging process without adding too much undue complexity for the user.
|
||||
|
||||
@@ -74,17 +76,19 @@ Component tags will be built from a composition-based, or "HAS" type relationshi
|
||||
|
||||
Tags use a default uncolored appearance by default, however can take on a number of built-in and user-created colors and color palettes! Tag color palettes can be based on a single color value (see: TagStudio Standard, TagStudio Shades, TagStudio Pastels) or use an optional secondary color use for the text and optionally the tag border (e.g. TagStudio Neon).
|
||||
|
||||

|
||||

|
||||
|
||||
#### User-Created Colors
|
||||
|
||||
Custom palettes and colors can be created via the [Tag Color Manager](./tag_color.md). These colors will display alongside the built-in colors inside the tag selection window and are separated by their namespace names. Colors which use the secondary color for the tag border will be outlined in that color, otherwise they will only display the secondary color on the bottom of the swatch to indicate at a glance that the text colors are different.
|
||||
Custom palettes and colors can be created via the [Tag Color Manager](colors.md). These colors will display alongside the built-in colors inside the tag selection window and are separated by their namespace names. Colors which use the secondary color for the tag border will be outlined in that color, otherwise they will only display the secondary color on the bottom of the swatch to indicate at a glance that the text colors are different.
|
||||
|
||||

|
||||

|
||||
|
||||
### Icon
|
||||
|
||||
**_Coming in version 9.6_**
|
||||
<!-- prettier-ignore -->
|
||||
!!! warning ""
|
||||
**_Coming in version 9.6.x_**
|
||||
|
||||
## Tag Properties
|
||||
|
||||
@@ -92,13 +96,25 @@ Properties are special attributes of tags that change their behavior in some way
|
||||
|
||||
#### Is Category
|
||||
|
||||
When the "Is Category" property is checked, this tag now acts as a category separator inside the preview panel. If this tag or any tags inheriting from this tag (i.e. tags that have this tag as a "[Parent Tag](#parent-tags)"), then these tags will appear under a separated group that's named after this tag. Tags inheriting from multiple "category tags" will still show up under any applicable category. _Read more under: [Tag Categories](../library/tag_categories.md)._
|
||||
The "Is Category" property of tags determines if a tag should be treated as a category itself when being organized inside the preview panel. If this tag or any tags inheriting from this tag (i.e. tags that have this tag as a "[Parent Tag](#parent-tags)"), then these tags will appear under a separated group that's named after this tag. Tags inheriting from multiple "category tags" will still show up under any applicable category.
|
||||
|
||||

|
||||
This means that duplicates of tags can appear on entries if the tag inherits from multiple parent categories, however this is by design and reflects the nature of multiple inheritance. Any tags not inheriting from a category tag will simply show under a default "Tag" section.
|
||||
|
||||

|
||||
|
||||
### Built-In Tags and Categories
|
||||
|
||||
The built-in tags "Favorite" and "Archived" inherit from the built-in "Meta Tags" category which is marked as a category by default. This behavior of default tags can be fully customized by disabling the category option and/or by adding/removing the tags' Parent Tags.
|
||||
|
||||
### Migrating from v9.4 Libraries
|
||||
|
||||
Due to the nature of how tags and Tag Felids operated prior to v9.5, the organization style of Tag Categories vs Tag Fields is not 1:1. Instead of tags being organized into fields on a per-entry basis, tags themselves determine their organizational layout via the "Is Property" flag. Any tags _(not currently inheriting from either the "Favorite" or "Archived" tags)_ will be shown under the default "Tags" header upon migrating to the v9.5+ library format. Similar organization to Tag Fields can be achieved by using the built-in "Meta Tags" tag or any other marked with "Is Category" and then setting those tags as parents for other tags to inherit from.
|
||||
|
||||
#### Is Hidden
|
||||
|
||||
**_Coming in version 9.6_**
|
||||
<!-- prettier-ignore -->
|
||||
!!! warning ""
|
||||
**_Coming in version 9.6.x_**
|
||||
|
||||
When the "Is Hidden" property is checked, any file entries tagged with this tag will not show up in searches by default. This property comes by default with the built-in "Archived" tag.
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: Changelog
|
||||
icon: material/list-status
|
||||
---
|
||||
|
||||
--8<-- "CHANGELOG.md"
|
||||
@@ -2,7 +2,7 @@
|
||||
icon: material/mouse
|
||||
---
|
||||
|
||||
# :material-mouse: Usage
|
||||
# :material-mouse: Basic Usage
|
||||
|
||||
## Creating/Opening a Library
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
icon: material/script-text
|
||||
---
|
||||
|
||||
# :material-script-text: Tools & Macros
|
||||
|
||||
Tools and macros are features that serve to create a more fluid [library](../library/index.md)-managing process, or provide some extra functionality. Please note that some are still in active development and will be fleshed out in future updates.
|
||||
|
||||
## Tools
|
||||
|
||||
### Fix Unlinked Entries
|
||||
|
||||
This tool displays the number of unlinked [entries](../library/entry.md), and some options for their resolution.
|
||||
|
||||
Refresh
|
||||
: Scans through the library and updates the unlinked entry count.
|
||||
|
||||
Search & Relink
|
||||
: Attempts to automatically find and reassign missing files.
|
||||
|
||||
Delete Unlinked Entries
|
||||
: Displays a confirmation prompt containing the list of all missing files to be deleted before committing to or cancelling the operation.
|
||||
|
||||
### Fix Duplicate Files
|
||||
|
||||
This tool allows for management of duplicate files in the library using a [DupeGuru](https://dupeguru.voltaicideas.net/) file.
|
||||
|
||||
Load DupeGuru File
|
||||
: load the "results" file created from a DupeGuru scan
|
||||
|
||||
Mirror Entries
|
||||
: Duplicate entries will have their contents mirrored across all instances. This allows for duplicate files to then be deleted with DupeGuru as desired, without losing the [field](../library/field.md) data that has been assigned to either. (Once deleted, the "Fix Unlinked Entries" tool can be used to clean up the duplicates)
|
||||
|
||||
### Create Collage
|
||||
|
||||
This tool is a preview of an upcoming feature. When selected, TagStudio will generate a collage of all the contents in a Library, which can be found in the Library folder ("/your-folder/.TagStudio/collages/"). Note that this feature is still in early development, and doesn't yet offer any customization options.
|
||||
|
||||
## Macros
|
||||
|
||||
### Auto-fill [WIP]
|
||||
|
||||
Tool is in development and will be documented in a future update.
|
||||
|
||||
### Sort fields
|
||||
|
||||
Tool is in development. Will allow for user-defined sorting of [fields](../library/field.md).
|
||||
|
||||
### Folders to Tags
|
||||
|
||||
Creates tags from the existing folder structure in the library, which are previewed in a hierarchy view for the user to confirm. A tag will be created for each folder and applied to all entries, with each subfolder being linked to the parent folder as a [parent tag](../library/tag.md#parent-tags). Tags will initially be named after the folders, but can be fully edited and customized afterwards.
|
||||
12
flake.lock
generated
12
flake.lock
generated
@@ -7,11 +7,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1754487366,
|
||||
"narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=",
|
||||
"lastModified": 1756770412,
|
||||
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18",
|
||||
"rev": "4524271976b625a4a605beefd893f270620fd751",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -22,11 +22,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1755615617,
|
||||
"narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=",
|
||||
"lastModified": 1757487488,
|
||||
"narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "20075955deac2583bb12f07151c2df830ef346b4",
|
||||
"rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
73
mkdocs.yml
73
mkdocs.yml
@@ -29,26 +29,34 @@ extra:
|
||||
nav:
|
||||
- Home:
|
||||
- index.md
|
||||
- Getting Started:
|
||||
- install.md
|
||||
- usage.md
|
||||
- develop.md
|
||||
- Help:
|
||||
- help/ffmpeg.md
|
||||
- Library:
|
||||
- library/index.md
|
||||
- library/library_search.md
|
||||
- library/entry.md
|
||||
- library/field.md
|
||||
- library/tag.md
|
||||
- library/tag_categories.md
|
||||
- library/tag_color.md
|
||||
- Utilities:
|
||||
- utilities/ignore.md
|
||||
- utilities/macro.md
|
||||
- Developing:
|
||||
- developing.md
|
||||
- contributing.md
|
||||
- style.md
|
||||
- Help:
|
||||
- help/ffmpeg.md
|
||||
- Using Libraries:
|
||||
- libraries.md
|
||||
- entries.md
|
||||
- preview-support.md
|
||||
- search.md
|
||||
- macros.md
|
||||
- Management:
|
||||
- relinking.md
|
||||
- ignore.md
|
||||
- Fields:
|
||||
- fields.md
|
||||
- Tags:
|
||||
- tags.md
|
||||
- colors.md
|
||||
- Updates:
|
||||
- updates/changelog.md
|
||||
- updates/roadmap.md
|
||||
- updates/schema_changes.md
|
||||
- changelog.md
|
||||
- roadmap.md
|
||||
- Schema History:
|
||||
- library-changes.md
|
||||
|
||||
theme:
|
||||
name: material
|
||||
@@ -81,16 +89,17 @@ theme:
|
||||
code: Jetbrains Mono
|
||||
language: en
|
||||
features:
|
||||
- navigation.instant
|
||||
- navigation.indexes
|
||||
- navigation.tracking
|
||||
- navigation.expand
|
||||
- navigation.sections
|
||||
- search.suggest
|
||||
- content.action.edit
|
||||
- content.code.annotate
|
||||
- content.code.copy
|
||||
- content.action.edit
|
||||
- content.tooltips
|
||||
- navigation.indexes
|
||||
- navigation.instant
|
||||
- navigation.sections
|
||||
- navigation.tabs
|
||||
# - navigation.tabs.sticky
|
||||
- navigation.tracking
|
||||
- search.suggest
|
||||
icon:
|
||||
repo: fontawesome/brands/github
|
||||
tag:
|
||||
@@ -108,6 +117,7 @@ markdown_extensions:
|
||||
- tables
|
||||
- toc:
|
||||
permalink: true
|
||||
toc_depth: 3
|
||||
|
||||
# Python Markdown Extensions
|
||||
- pymdownx.arithmatex:
|
||||
@@ -142,6 +152,21 @@ plugins:
|
||||
- tags
|
||||
- social: # social embed cards
|
||||
enabled: !ENV [CI, false] # enabled only when running in CI (eg GitHub Actions)
|
||||
- redirects:
|
||||
redirect_maps:
|
||||
"develop.md": "developing.md"
|
||||
"library/entry.md": "entries.md"
|
||||
"library/field.md": "fields.md"
|
||||
"library/index.md": "libraries.md"
|
||||
"library/library_search.md": "search.md"
|
||||
"library/tag_categories.md": "tags.md"
|
||||
"library/tag_color.md": "colors.md"
|
||||
"library/tag.md": "tags.md"
|
||||
"updates/changelog.md": "changelog.md"
|
||||
"updates/roadmap.md": "roadmap.md"
|
||||
"updates/schema_changes.md": "library-changes.md"
|
||||
"utilities/ignore.md": "ignore.md"
|
||||
"utilities/macro.md": "macros.md"
|
||||
|
||||
extra_css:
|
||||
- stylesheets/extra.css
|
||||
|
||||
@@ -55,14 +55,14 @@ python3Packages.buildPythonApplication {
|
||||
dontWrapGApps = true;
|
||||
dontWrapQtApps = true;
|
||||
makeWrapperArgs = [
|
||||
"--prefix PATH : ${
|
||||
"--suffix PATH : ${
|
||||
lib.makeBinPath [
|
||||
ffmpeg-headless
|
||||
ripgrep
|
||||
]
|
||||
}"
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isLinux "--prefix LD_LIBRARY_PATH : ${
|
||||
++ lib.optional stdenv.hostPlatform.isLinux "--suffix LD_LIBRARY_PATH : ${
|
||||
lib.makeLibraryPath [ pipewire ]
|
||||
}"
|
||||
++ [
|
||||
@@ -77,7 +77,9 @@ python3Packages.buildPythonApplication {
|
||||
"pillow-avif-plugin"
|
||||
"pillow-heif"
|
||||
"pillow-jxl-plugin"
|
||||
"py7zr"
|
||||
"pyside6"
|
||||
"rarfile"
|
||||
"structlog"
|
||||
"typing-extensions"
|
||||
];
|
||||
@@ -96,9 +98,11 @@ python3Packages.buildPythonApplication {
|
||||
pillow
|
||||
pillow-avif-plugin
|
||||
pillow-heif
|
||||
py7zr
|
||||
pydantic
|
||||
pydub
|
||||
pyside6
|
||||
rarfile
|
||||
rawpy
|
||||
send2trash
|
||||
sqlalchemy
|
||||
@@ -115,6 +119,7 @@ python3Packages.buildPythonApplication {
|
||||
disabledTests = [
|
||||
"test_badge_visual_state"
|
||||
"test_browsing_state_update"
|
||||
"test_close_library" # TODO: Look into segfault.
|
||||
"test_flow_layout_happy_path"
|
||||
"test_get" # TODO: Look further into, might be possible to run.
|
||||
"test_json_migration"
|
||||
|
||||
@@ -60,7 +60,7 @@ let
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/${python3.meta.mainProgram} \
|
||||
--prefix ${libraryPath} : ${pythonLibraryPath} \
|
||||
--suffix ${libraryPath} : ${pythonLibraryPath} \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
"''${qtWrapperArgs[@]}"
|
||||
'';
|
||||
|
||||
43
overrides/partials/toc-item.html
Normal file
43
overrides/partials/toc-item.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!--
|
||||
Copyright (c) 2016-2025 Martin Donath <martin.donath@squidfunk.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- Table of contents item -->
|
||||
<li class="md-nav__item">
|
||||
<a href="{{ toc_item.url }}" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
{{ toc_item.title }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<!-- Table of contents list -->
|
||||
{% if toc_item.children %}
|
||||
<nav class="md-nav" aria-label="{{ toc_item.title | striptags | e }}">
|
||||
<ul class="md-nav__list">
|
||||
{% for toc_item in toc_item.children %}
|
||||
{% if not page.meta.toc_depth or toc_item.level <= page.meta.toc_depth %}
|
||||
{% include "partials/toc-item.html" %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
</li>
|
||||
@@ -20,6 +20,7 @@ dependencies = [
|
||||
"pillow-avif-plugin~=1.5",
|
||||
"pillow-heif~=0.22",
|
||||
"pillow-jxl-plugin~=1.3",
|
||||
"py7zr==1.0.0",
|
||||
"pydantic~=2.10",
|
||||
"pydub~=0.25",
|
||||
"PySide6==6.8.0.*",
|
||||
@@ -37,7 +38,7 @@ dependencies = [
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["tagstudio[mkdocs,mypy,pre-commit,pyinstaller,pytest,ruff]"]
|
||||
mkdocs = ["mkdocs-material[imaging]>=9.6.14"]
|
||||
mkdocs = ["mkdocs-material[imaging]>=9.6.14", "mkdocs-redirects~=1.2"]
|
||||
mypy = ["mypy==1.15.0", "mypy-extensions==1.*", "types-ujson~=5.10"]
|
||||
pre-commit = ["pre-commit~=4.2"]
|
||||
pyinstaller = ["Pyinstaller~=6.13"]
|
||||
|
||||
@@ -10,6 +10,7 @@ TS_FOLDER_NAME: str = ".TagStudio"
|
||||
BACKUP_FOLDER_NAME: str = "backups"
|
||||
COLLAGE_FOLDER_NAME: str = "collages"
|
||||
IGNORE_NAME: str = ".ts_ignore"
|
||||
MACROS_FOLDER_NAME: str = "macros"
|
||||
THUMB_CACHE_NAME: str = "thumbs"
|
||||
|
||||
FONT_SAMPLE_TEXT: str = (
|
||||
|
||||
@@ -51,14 +51,6 @@ class OpenStatus(enum.IntEnum):
|
||||
CORRUPTED = 2
|
||||
|
||||
|
||||
class MacroID(enum.Enum):
|
||||
AUTOFILL = "autofill"
|
||||
SIDECAR = "sidecar"
|
||||
BUILD_URL = "build_url"
|
||||
MATCH = "match"
|
||||
CLEAN_URL = "clean_url"
|
||||
|
||||
|
||||
class DefaultEnum(enum.Enum):
|
||||
"""Allow saving multiple identical values in property called .default."""
|
||||
|
||||
|
||||
@@ -994,7 +994,14 @@ class Library:
|
||||
assert self.library_dir
|
||||
|
||||
with Session(unwrap(self.engine), expire_on_commit=False) as session:
|
||||
statement = select(Entry.id, func.count().over())
|
||||
if page_size:
|
||||
statement = (
|
||||
select(Entry.id, func.count().over())
|
||||
.offset(search.page_index * page_size)
|
||||
.limit(page_size)
|
||||
)
|
||||
else:
|
||||
statement = select(Entry.id)
|
||||
|
||||
if search.ast:
|
||||
start_time = time.time()
|
||||
@@ -1017,8 +1024,6 @@ class Library:
|
||||
sort_on = func.sin(Entry.id * search.random_seed)
|
||||
|
||||
statement = statement.order_by(asc(sort_on) if search.ascending else desc(sort_on))
|
||||
if page_size is not None:
|
||||
statement = statement.limit(page_size).offset(search.page_index * page_size)
|
||||
|
||||
logger.info(
|
||||
"searching library",
|
||||
@@ -1027,17 +1032,21 @@ class Library:
|
||||
)
|
||||
|
||||
start_time = time.time()
|
||||
rows = session.execute(statement).fetchall()
|
||||
ids = []
|
||||
count = 0
|
||||
for row in rows:
|
||||
id, count = row._tuple() # pyright: ignore[reportPrivateUsage]
|
||||
ids.append(id)
|
||||
if page_size:
|
||||
rows = session.execute(statement).fetchall()
|
||||
ids = []
|
||||
total_count = 0
|
||||
for row in rows:
|
||||
ids.append(row[0])
|
||||
total_count = row[1]
|
||||
else:
|
||||
ids = list(session.scalars(statement))
|
||||
total_count = len(ids)
|
||||
end_time = time.time()
|
||||
logger.info(f"SQL Execution finished ({format_timespan(end_time - start_time)})")
|
||||
|
||||
res = SearchResult(
|
||||
total_count=count,
|
||||
total_count=total_count,
|
||||
ids=ids,
|
||||
)
|
||||
|
||||
@@ -1053,19 +1062,21 @@ class Library:
|
||||
selectinload(Tag.parent_tags),
|
||||
selectinload(Tag.aliases),
|
||||
)
|
||||
|
||||
if limit > 0:
|
||||
query = query.limit(limit)
|
||||
|
||||
if name:
|
||||
query = query.where(
|
||||
or_(
|
||||
Tag.name.icontains(name),
|
||||
Tag.shorthand.icontains(name),
|
||||
TagAlias.name.icontains(name),
|
||||
Tag.name.istartswith(name),
|
||||
Tag.shorthand.istartswith(name),
|
||||
TagAlias.name.istartswith(name),
|
||||
)
|
||||
)
|
||||
|
||||
direct_tags = set(session.scalars(query))
|
||||
|
||||
ancestor_tag_ids: list[Tag] = []
|
||||
for tag in direct_tags:
|
||||
ancestor_tag_ids.extend(
|
||||
@@ -1083,14 +1094,6 @@ class Library:
|
||||
{at for at in ancestor_tags if at not in direct_tags},
|
||||
]
|
||||
|
||||
logger.info(
|
||||
"searching tags",
|
||||
search=name,
|
||||
limit=limit,
|
||||
statement=str(query),
|
||||
results=len(res),
|
||||
)
|
||||
|
||||
session.expunge_all()
|
||||
|
||||
return res
|
||||
@@ -1247,7 +1250,7 @@ class Library:
|
||||
with Session(self.engine) as session:
|
||||
return {x.key: x for x in session.scalars(select(ValueType)).all()}
|
||||
|
||||
def get_value_type(self, field_key: str) -> ValueType:
|
||||
def get_value_type(self, field_key: str | None) -> ValueType | None:
|
||||
with Session(self.engine) as session:
|
||||
field = unwrap(session.scalar(select(ValueType).where(ValueType.key == field_key)))
|
||||
session.expunge(field)
|
||||
@@ -1260,6 +1263,7 @@ class Library:
|
||||
field: ValueType | None = None,
|
||||
field_id: FieldID | str | None = None,
|
||||
value: str | datetime | None = None,
|
||||
skip_on_exists: bool = False,
|
||||
) -> bool:
|
||||
logger.info(
|
||||
"[Library][add_field_to_entry]",
|
||||
@@ -1276,6 +1280,27 @@ class Library:
|
||||
field_id = field_id.name
|
||||
field = self.get_value_type(unwrap(field_id))
|
||||
|
||||
if not field:
|
||||
logger.error(
|
||||
"[Library] Could not add field to entry, invalid field type.", entry_id=entry_id
|
||||
)
|
||||
return False
|
||||
|
||||
if skip_on_exists:
|
||||
entry = self.get_entry_full(entry_id, with_tags=False)
|
||||
if not entry:
|
||||
logger.exception("[Library] Entry does not exist", entry_id=entry_id)
|
||||
return False
|
||||
for field_ in entry.fields:
|
||||
if field_.value == value and field_.type_key == field_id:
|
||||
logger.info(
|
||||
"[Library] Field value already exists for entry",
|
||||
entry_id=entry_id,
|
||||
value=value,
|
||||
type=field_id,
|
||||
)
|
||||
return False
|
||||
|
||||
field_model: TextField | DatetimeField
|
||||
if field.type in (FieldTypeEnum.TEXT_LINE, FieldTypeEnum.TEXT_BOX):
|
||||
field_model = TextField(
|
||||
@@ -1454,10 +1479,21 @@ class Library:
|
||||
for tag_id in tag_ids_:
|
||||
for entry_id in entry_ids_:
|
||||
try:
|
||||
logger.info(
|
||||
"[Library][add_tags_to_entries] Adding tag to entry...",
|
||||
tag_id=tag_id,
|
||||
entry_id=entry_id,
|
||||
)
|
||||
session.add(TagEntry(tag_id=tag_id, entry_id=entry_id))
|
||||
total_added += 1
|
||||
session.commit()
|
||||
except IntegrityError:
|
||||
except IntegrityError as e:
|
||||
logger.warning(
|
||||
"[Library][add_tags_to_entries] Tag already on entry",
|
||||
warning=e,
|
||||
tag_id=tag_id,
|
||||
entry_id=entry_id,
|
||||
)
|
||||
session.rollback()
|
||||
|
||||
return total_added
|
||||
@@ -1554,6 +1590,7 @@ class Library:
|
||||
|
||||
return tag
|
||||
|
||||
# TODO: Fix and consolidate code with search_tags()
|
||||
def get_tag_by_name(self, tag_name: str) -> Tag | None:
|
||||
with Session(self.engine) as session:
|
||||
statement = (
|
||||
@@ -1854,9 +1891,13 @@ class Library:
|
||||
# load given item from Preferences table
|
||||
with Session(self.engine) as session:
|
||||
if isinstance(key, LibraryPrefs):
|
||||
return session.scalar(select(Preferences).where(Preferences.key == key.name)).value # pyright: ignore
|
||||
return unwrap(
|
||||
session.scalar(select(Preferences).where(Preferences.key == key.name))
|
||||
).value # pyright: ignore[reportUnknownVariableType]
|
||||
else:
|
||||
return session.scalar(select(Preferences).where(Preferences.key == key)).value # pyright: ignore
|
||||
return unwrap(
|
||||
session.scalar(select(Preferences).where(Preferences.key == key))
|
||||
).value # pyright: ignore[reportUnknownVariableType]
|
||||
|
||||
# TODO: Remove this once the 'preferences' table is removed.
|
||||
@deprecated("Use `get_version() for version and `ts_ignore` system for extension exclusion.")
|
||||
|
||||
@@ -163,6 +163,11 @@ class Tag(Base):
|
||||
def __hash__(self) -> int:
|
||||
return hash(self.id)
|
||||
|
||||
def __eq__(self, value: object) -> bool:
|
||||
if not isinstance(value, Tag):
|
||||
return False
|
||||
return self.id == value.id
|
||||
|
||||
def __lt__(self, other: "Tag") -> bool:
|
||||
return self.name < other.name
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from wcmatch import pathlib
|
||||
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.core.library.ignore import PATH_GLOB_FLAGS, Ignore
|
||||
from tagstudio.core.library.ignore import PATH_GLOB_FLAGS, Ignore, ignore_to_glob
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
|
||||
logger = structlog.get_logger()
|
||||
@@ -47,7 +47,8 @@ class UnlinkedRegistry:
|
||||
library_dir = unwrap(self.lib.library_dir)
|
||||
matches: list[Path] = []
|
||||
|
||||
ignore_patterns = Ignore.get_patterns(library_dir)
|
||||
# NOTE: ignore_to_glob() is needed for wcmatch, not ripgrep.
|
||||
ignore_patterns = ignore_to_glob(Ignore.get_patterns(library_dir))
|
||||
for path in pathlib.Path(str(library_dir)).glob(
|
||||
f"***/{match_entry.path.name}",
|
||||
flags=PATH_GLOB_FLAGS,
|
||||
|
||||
@@ -38,7 +38,7 @@ GLOBAL_IGNORE = [
|
||||
|
||||
|
||||
def ignore_to_glob(ignore_patterns: list[str]) -> list[str]:
|
||||
"""Convert .gitignore-like patterns to explicit glob syntax.
|
||||
"""Convert .gitignore-like patterns to Unix-like glob syntax.
|
||||
|
||||
Args:
|
||||
ignore_patterns (list[str]): The .gitignore-like patterns to convert.
|
||||
@@ -48,7 +48,7 @@ def ignore_to_glob(ignore_patterns: list[str]) -> list[str]:
|
||||
additional_patterns: list[str] = []
|
||||
root_patterns: list[str] = []
|
||||
|
||||
# Mimic implicit .gitignore syntax behavior for the SQLite GLOB function.
|
||||
# Expand .gitignore patterns to mimic the same behavior with unix-like glob patterns.
|
||||
for pattern in glob_patterns:
|
||||
# Temporarily remove any exclusion character before processing
|
||||
exclusion_char = ""
|
||||
@@ -62,9 +62,6 @@ def ignore_to_glob(ignore_patterns: list[str]) -> list[str]:
|
||||
gp = "**/" + gp
|
||||
additional_patterns.append(exclusion_char + gp)
|
||||
|
||||
gp = gp.removesuffix("/**").removesuffix("/*").removesuffix("/")
|
||||
additional_patterns.append(exclusion_char + gp)
|
||||
|
||||
gp = gp.removeprefix("**/").removeprefix("*/")
|
||||
additional_patterns.append(exclusion_char + gp)
|
||||
|
||||
|
||||
544
src/tagstudio/core/macro_parser.py
Normal file
544
src/tagstudio/core/macro_parser.py
Normal file
@@ -0,0 +1,544 @@
|
||||
# Copyright (C) 2025 Travis Abendshien (CyanVoxel).
|
||||
# Licensed under the GPL-3.0 License.
|
||||
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
|
||||
|
||||
import json
|
||||
from copy import deepcopy
|
||||
from enum import StrEnum
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, override
|
||||
|
||||
import structlog
|
||||
import toml
|
||||
from wcmatch import glob
|
||||
|
||||
from tagstudio.core.library.alchemy.fields import FieldID
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Tag
|
||||
|
||||
|
||||
logger = structlog.get_logger(__name__)
|
||||
|
||||
SCHEMA_VERSION = "schema_version"
|
||||
TRIGGERS = "triggers"
|
||||
ACTION = "action"
|
||||
|
||||
SOURCE_LOCATION = "source_location"
|
||||
SOURCE_FILER = "source_filters"
|
||||
SOURCE_FORMAT = "source_format"
|
||||
FILENAME_PLACEHOLDER = "{filename}"
|
||||
EXT_PLACEHOLDER = "{ext}"
|
||||
TEMPLATE = "template"
|
||||
KEY = "key"
|
||||
|
||||
SOURCE_TYPE = "source_type"
|
||||
TS_TYPE = "ts_type"
|
||||
NAME = "name"
|
||||
|
||||
VALUE = "value"
|
||||
TAGS = "tags"
|
||||
TEXT_LINE = "text_line"
|
||||
TEXT_BOX = "text_box"
|
||||
DATETIME = "datetime"
|
||||
|
||||
PREFIX = "prefix"
|
||||
DELIMITER = "delimiter"
|
||||
STRICT = "strict"
|
||||
USE_CONTEXT = "use_context"
|
||||
ON_MISSING = "on_missing"
|
||||
|
||||
JSON = "json"
|
||||
XMP = "xmp"
|
||||
EXIF = "exif"
|
||||
ID3 = "id3"
|
||||
|
||||
MAP = "map"
|
||||
INVERSE_MAP = "inverse_map"
|
||||
|
||||
|
||||
class Actions(StrEnum):
|
||||
IMPORT_DATA = "import_data"
|
||||
ADD_DATA = "add_data"
|
||||
|
||||
|
||||
class OnMissing(StrEnum):
|
||||
PROMPT = "prompt"
|
||||
CREATE = "create"
|
||||
SKIP = "skip"
|
||||
|
||||
|
||||
class Instruction:
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
|
||||
class AddFieldInstruction(Instruction):
|
||||
def __init__(self, content, name: FieldID, field_type: str) -> None:
|
||||
super().__init__()
|
||||
self.content = content
|
||||
self.name = name
|
||||
self.type = field_type
|
||||
|
||||
@override
|
||||
def __str__(self) -> str:
|
||||
return str(self.content)
|
||||
|
||||
|
||||
class AddTagInstruction(Instruction):
|
||||
def __init__(
|
||||
self,
|
||||
tag_strings: list[str],
|
||||
use_context: bool = True,
|
||||
strict: bool = False,
|
||||
on_missing: str = OnMissing.SKIP,
|
||||
prefix: str = "",
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.tag_strings = tag_strings
|
||||
self.use_context = use_context
|
||||
self.strict = strict
|
||||
self.on_missing = on_missing
|
||||
self.prefix = prefix
|
||||
|
||||
@override
|
||||
def __str__(self) -> str:
|
||||
return str(self.tag_strings)
|
||||
|
||||
|
||||
def get_macro_name(
|
||||
macro_path: Path,
|
||||
) -> str:
|
||||
"""Return the name of a macro, as read from the file.
|
||||
|
||||
Defaults to the filename if no name is declared or able to be read.
|
||||
|
||||
Args:
|
||||
macro_path (Path): The full path of the macro file.
|
||||
"""
|
||||
name = macro_path.name
|
||||
logger.info("[MacroParser] Parsing Macro for Name", macro_path=macro_path)
|
||||
|
||||
if not macro_path.exists():
|
||||
logger.error("[MacroParser] Macro path does not exist", macro_path=macro_path)
|
||||
return name
|
||||
|
||||
if not macro_path.exists():
|
||||
logger.error("[MacroParser] Filepath does not exist", macro_path=macro_path)
|
||||
return name
|
||||
|
||||
with open(macro_path) as f:
|
||||
try:
|
||||
macro = toml.load(f)
|
||||
name = str(macro.get("name", name))
|
||||
except toml.TomlDecodeError as e:
|
||||
logger.error("[MacroParser] Could not parse macro", macro_path=macro_path, error=e)
|
||||
logger.info("[MacroParser] Macro Name:", name=name, macro_path=macro_path)
|
||||
return name
|
||||
|
||||
|
||||
def parse_macro_file(
|
||||
macro_path: Path,
|
||||
filepath: Path,
|
||||
) -> list[Instruction]:
|
||||
"""Parse a macro file and return a list of actions for TagStudio to perform.
|
||||
|
||||
Args:
|
||||
macro_path (Path): The full path of the macro file.
|
||||
filepath (Path): The filepath associated with Entry being operated upon.
|
||||
"""
|
||||
results: list[Instruction] = []
|
||||
logger.info("[MacroParser] Parsing Macro", macro_path=macro_path, filepath=filepath)
|
||||
|
||||
if not macro_path.exists():
|
||||
logger.error("[MacroParser] Macro path does not exist", macro_path=macro_path)
|
||||
return results
|
||||
|
||||
if not filepath.exists():
|
||||
logger.error("[MacroParser] Filepath does not exist", filepath=filepath)
|
||||
return results
|
||||
|
||||
with open(macro_path) as f:
|
||||
try:
|
||||
macro = toml.load(f)
|
||||
except toml.TomlDecodeError as e:
|
||||
logger.error("[MacroParser] Could not parse macro", macro_path=macro_path, error=e)
|
||||
return results
|
||||
|
||||
logger.info(macro)
|
||||
|
||||
# Check Schema Version
|
||||
schema_ver = macro.get(SCHEMA_VERSION, 0)
|
||||
if not isinstance(schema_ver, int):
|
||||
logger.error(
|
||||
f"[MacroParser] Incorrect type for {SCHEMA_VERSION}, expected int",
|
||||
schema_ver=schema_ver,
|
||||
)
|
||||
return results
|
||||
|
||||
if schema_ver != 1:
|
||||
logger.error(f"[MacroParser] Unsupported Schema Version: {schema_ver}")
|
||||
return results
|
||||
|
||||
logger.info(f"[MacroParser] Schema Version: {schema_ver}")
|
||||
|
||||
# Load Triggers
|
||||
triggers = macro.get(TRIGGERS)
|
||||
if triggers and not isinstance(triggers, list):
|
||||
logger.error(
|
||||
f"[MacroParser] Incorrect type for {TRIGGERS}, expected list", triggers=triggers
|
||||
)
|
||||
|
||||
# Parse each action table
|
||||
for table_key in macro:
|
||||
if table_key in {SCHEMA_VERSION, TRIGGERS, NAME}:
|
||||
continue
|
||||
|
||||
logger.info("[MacroParser] Parsing Table", table_key=table_key)
|
||||
table: dict[str, Any] = macro[table_key]
|
||||
logger.info(table.keys())
|
||||
|
||||
# TODO: Replace with table conditionals
|
||||
source_filters: list[str] = table.get(SOURCE_FILER, [])
|
||||
conditions_met: bool = False
|
||||
if not source_filters:
|
||||
conditions_met = True
|
||||
else:
|
||||
for filter_ in source_filters:
|
||||
if glob.globmatch(filepath, filter_, flags=glob.GLOBSTAR):
|
||||
logger.info(
|
||||
f"[MacroParser] [{table_key}] "
|
||||
f'{SOURCE_FILER}" Met filter requirement: {filter_}'
|
||||
)
|
||||
conditions_met = True
|
||||
|
||||
if not conditions_met:
|
||||
logger.warning(
|
||||
f"[MacroParser] [{table_key}] File didn't meet any path filter requirement",
|
||||
filters=source_filters,
|
||||
filepath=filepath,
|
||||
)
|
||||
continue
|
||||
|
||||
action: str = table.get(ACTION, "")
|
||||
logger.info(f'[MacroParser] [{table_key}] "{ACTION}": {action}')
|
||||
|
||||
if action == Actions.IMPORT_DATA:
|
||||
results.extend(_import_data(table, table_key, filepath))
|
||||
elif action == Actions.ADD_DATA:
|
||||
results.extend(_add_data(table))
|
||||
|
||||
logger.info(results)
|
||||
return results
|
||||
|
||||
|
||||
def _import_data(table: dict[str, Any], table_key: str, filepath: Path) -> list[Instruction]:
|
||||
"""Process an import_data instruction and return a list of DataResults.
|
||||
|
||||
Importing data refers to importing data from a source external to TagStudio or any macro.
|
||||
"""
|
||||
results: list[Instruction] = []
|
||||
|
||||
source_format: str = str(table.get(SOURCE_FORMAT, ""))
|
||||
if not source_format:
|
||||
logger.error('[MacroParser] Parser Error: No "{SOURCE_FORMAT}" provided for table')
|
||||
logger.info(f'[MacroParser] [{table_key}] "{SOURCE_FORMAT}": {source_format}')
|
||||
|
||||
raw_source_location = str(table.get(SOURCE_LOCATION, ""))
|
||||
if FILENAME_PLACEHOLDER in raw_source_location:
|
||||
# logger.info(f"[MacroParser] Filename placeholder detected: {raw_source_location}")
|
||||
raw_source_location = raw_source_location.replace(FILENAME_PLACEHOLDER, str(filepath.stem))
|
||||
|
||||
if EXT_PLACEHOLDER in raw_source_location:
|
||||
# logger.info(f"[MacroParser] File extension placeholder detected: {raw_source_location}")
|
||||
# TODO: Make work with files that have multiple suffixes, like .tar.gz
|
||||
raw_source_location = raw_source_location.replace(
|
||||
EXT_PLACEHOLDER,
|
||||
str(filepath.suffix)[1:], # Remove leading "."
|
||||
)
|
||||
|
||||
if not raw_source_location.startswith(("/", "~")):
|
||||
# The source location must be relative to the given filepath
|
||||
source_location = filepath.parent / Path(raw_source_location)
|
||||
else:
|
||||
source_location = Path(raw_source_location)
|
||||
|
||||
logger.info(f'[MacroParser] [{table_key}] "{SOURCE_LOCATION}": {source_location}')
|
||||
|
||||
if not source_location.exists():
|
||||
logger.error(
|
||||
"[MacroParser] Sidecar filepath does not exist", source_location=source_location
|
||||
)
|
||||
return results
|
||||
|
||||
if source_format.lower() in JSON:
|
||||
logger.info("[MacroParser] Parsing JSON sidecar file", sidecar_path=source_location)
|
||||
with open(source_location, encoding="utf8") as f:
|
||||
json_dump = json.load(f)
|
||||
if not json_dump:
|
||||
logger.warning("[MacroParser] Empty JSON sidecar file")
|
||||
return results
|
||||
logger.info(json_dump.items())
|
||||
|
||||
for table_key, table_value in table.items():
|
||||
objects: list[dict[str, Any] | str] = []
|
||||
content_value = ""
|
||||
if isinstance(table_value, list):
|
||||
objects = table_value
|
||||
else:
|
||||
objects.append(table_value)
|
||||
for obj in objects:
|
||||
if not isinstance(obj, dict):
|
||||
continue
|
||||
ts_type: str = str(obj.get(TS_TYPE, ""))
|
||||
if not ts_type:
|
||||
logger.warning(
|
||||
f'[MacroParser] [{table_key}] No "{TS_TYPE}" key provided, skipping'
|
||||
)
|
||||
continue
|
||||
|
||||
json_key: str = str(obj.get(KEY, ""))
|
||||
if json_key and json_key in json_dump:
|
||||
json_value = json_dump.get(table_key)
|
||||
logger.info(
|
||||
f"[MacroParser] [{table_key}] Parsing JSON sidecar key",
|
||||
key=table_key,
|
||||
table_value=obj,
|
||||
json_value=json_value,
|
||||
)
|
||||
content_value = json_value
|
||||
|
||||
if not json_value or isinstance(json_value, str) and not json_value.strip():
|
||||
logger.warning(
|
||||
f"[MacroParser] [{table_key}] Value for key was empty, skipping"
|
||||
)
|
||||
continue
|
||||
|
||||
elif table_key == TEMPLATE:
|
||||
template: str = str(obj.get(TEMPLATE, ""))
|
||||
logger.info(f"[MacroParser] [{table_key}] Filling template", template=template)
|
||||
if not template:
|
||||
logger.warning(f"[MacroParser] [{table_key}] Empty template, skipping")
|
||||
continue
|
||||
for k in json_dump:
|
||||
template = _fill_template(template, json_dump, k)
|
||||
logger.info(f"[MacroParser] [{table_key}] Template filled!", template=template)
|
||||
content_value = template
|
||||
|
||||
else:
|
||||
continue
|
||||
|
||||
# TODO: Determine if the source_type is even really ever needed
|
||||
# source_type: str = str(tab_value.get(SOURCE_TYPE, ""))
|
||||
|
||||
str_name: str = str(obj.get(NAME, FieldID.NOTES.name))
|
||||
name: FieldID = FieldID.NOTES
|
||||
for fid in FieldID:
|
||||
field_id = str_name.upper().replace(" ", "_")
|
||||
if field_id == fid.name:
|
||||
name = fid
|
||||
continue
|
||||
|
||||
if ts_type == TAGS:
|
||||
use_context: bool = bool(obj.get(USE_CONTEXT, False))
|
||||
on_missing: str = str(obj.get(ON_MISSING, OnMissing.SKIP))
|
||||
strict: bool = bool(obj.get(STRICT, False))
|
||||
delimiter: str = ""
|
||||
|
||||
tag_strings: list[str] = []
|
||||
# Tags are part of a single string
|
||||
if isinstance(content_value, str):
|
||||
delimiter = str(obj.get(DELIMITER, ""))
|
||||
if delimiter:
|
||||
# Split string based on given delimiter
|
||||
tag_strings = content_value.split(delimiter)
|
||||
else:
|
||||
# If no delimiter is provided, assume the string is a single tag
|
||||
tag_strings.append(content_value)
|
||||
elif isinstance(content_value, bool):
|
||||
tag_strings = [str(content_value)]
|
||||
elif isinstance(content_value, list):
|
||||
tag_strings = [str(v) for v in content_value] # pyright: ignore[reportUnknownVariableType]
|
||||
else:
|
||||
tag_strings = deepcopy([content_value])
|
||||
|
||||
# Remove a prefix (if given) from all tags strings (if any)
|
||||
prefix = str(obj.get(PREFIX, ""))
|
||||
if prefix:
|
||||
tag_strings = [t.lstrip(prefix) for t in tag_strings]
|
||||
|
||||
# Swap any mapped tags for their new tag values
|
||||
tag_map: dict[str, str] = obj.get(MAP, {})
|
||||
mapped: list[str] = []
|
||||
if tag_map:
|
||||
for map_key, map_value in tag_map.items():
|
||||
if map_key in tag_strings:
|
||||
logger.info("[MacroParser] Mapping tag", old=map_key, new=map_value)
|
||||
if isinstance(map_value, list):
|
||||
mapped.extend(map_value)
|
||||
else:
|
||||
mapped.append(map_value)
|
||||
tag_strings.remove(map_key)
|
||||
tag_strings.extend(mapped)
|
||||
|
||||
tag_strings = [t.strip() for t in tag_strings if t.strip()]
|
||||
|
||||
logger.info("[MacroParser] Found tags", tag_strings=tag_strings)
|
||||
results.append(
|
||||
AddTagInstruction(
|
||||
tag_strings=tag_strings,
|
||||
use_context=use_context,
|
||||
strict=strict,
|
||||
on_missing=on_missing,
|
||||
prefix="",
|
||||
)
|
||||
)
|
||||
|
||||
elif ts_type in (TEXT_LINE, TEXT_BOX, DATETIME):
|
||||
results.append(
|
||||
AddFieldInstruction(content=content_value, name=name, field_type=ts_type)
|
||||
)
|
||||
else:
|
||||
logger.error('[MacroParser] [{table_key}] Unknown "{TS_TYPE}"', type=ts_type)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def _add_data(table: dict[str, Any]) -> list[Instruction]:
|
||||
"""Process an add_data instruction and return a list of DataResults.
|
||||
|
||||
Adding data refers to adding data defined inside a TagStudio macro, not from an external source.
|
||||
"""
|
||||
results: list[Instruction] = []
|
||||
logger.error(table)
|
||||
for table_value in table.values():
|
||||
objects: list[dict[str, Any] | str] = []
|
||||
if isinstance(table_value, list):
|
||||
objects = table_value
|
||||
else:
|
||||
objects.append(table_value)
|
||||
for obj in objects:
|
||||
if not isinstance(obj, dict):
|
||||
continue
|
||||
ts_type = obj.get(TS_TYPE, "")
|
||||
if ts_type == TAGS:
|
||||
tag_strings: list[str] = obj.get(VALUE, [])
|
||||
logger.error(tag_strings)
|
||||
results.append(
|
||||
AddTagInstruction(
|
||||
tag_strings=tag_strings,
|
||||
use_context=False,
|
||||
)
|
||||
)
|
||||
elif ts_type in (TEXT_LINE, TEXT_BOX, DATETIME):
|
||||
str_name: str = str(obj.get(NAME, FieldID.NOTES.name))
|
||||
name: FieldID = FieldID.NOTES
|
||||
for fid in FieldID:
|
||||
field_id = str_name.upper().replace(" ", "_")
|
||||
if field_id == fid.name:
|
||||
name = fid
|
||||
continue
|
||||
|
||||
content_value: str = str(obj.get(VALUE, ""))
|
||||
results.append(
|
||||
AddFieldInstruction(content=content_value, name=name, field_type=ts_type)
|
||||
)
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def _fill_template(
|
||||
template: str, table: dict[str, Any], table_key: str, template_key: str = ""
|
||||
) -> str:
|
||||
"""Replaces placeholder keys in a string with the value from that table.
|
||||
|
||||
Args:
|
||||
template (str): The string containing placeholder keys.
|
||||
Key names should be surrounded in curly braces. (e.g. "{key}").
|
||||
Nested keys are accessed by separating the keys with a dot (e.g. "{key.nested_key}").
|
||||
table (dict[str, Any]): The table to lookup values from.
|
||||
table_key (str): The key to search for in the template and access the table with.
|
||||
template_key (str): Similar to table_key, but is not used for accessing the table and
|
||||
is instead used for representing the template key syntax for nested keys.
|
||||
Used in recursive calls.
|
||||
"""
|
||||
key = template_key or table_key
|
||||
value = table.get(table_key, "")
|
||||
|
||||
if isinstance(value, dict):
|
||||
for v in value:
|
||||
# NOTE: This f-string is the only thing defining how the nested key syntax works.
|
||||
# If instead you wanted to use key[nested] syntax for example, use: f"{key}[{str(v)}]"
|
||||
normalized_key: str = f"{key}.{str(v)}"
|
||||
template = _fill_template(template, value, str(v), normalized_key)
|
||||
|
||||
value = str(value)
|
||||
return template.replace(f"{{{key}}}", f"{value}")
|
||||
|
||||
|
||||
def exec_instructions(library: "Library", entry_id: int, results: list[Instruction]) -> None:
|
||||
for result in results:
|
||||
if isinstance(result, AddTagInstruction):
|
||||
_exec_add_tag(library, entry_id, result)
|
||||
elif isinstance(result, AddFieldInstruction):
|
||||
_exec_add_field(library, entry_id, result)
|
||||
|
||||
|
||||
def _exec_add_tag(library: "Library", entry_id: int, result: AddTagInstruction):
|
||||
tag_ids: set[int] = set()
|
||||
for string in result.tag_strings:
|
||||
if not string.strip():
|
||||
continue
|
||||
string = string.replace("_", " ")
|
||||
base_and_parent = string.split("(")
|
||||
parent = ""
|
||||
base = base_and_parent[0].strip(" ")
|
||||
parent_results: list[int] = []
|
||||
if len(base_and_parent) > 1:
|
||||
parent = base_and_parent[1].split(")")[0]
|
||||
r: list[set[Tag]] = library.search_tags(name=parent, limit=-1)
|
||||
if len(r) > 0:
|
||||
parent_results = [t.id for t in r[0]]
|
||||
# NOTE: The following code overlaps with update_tags() in tag_search.py
|
||||
# Sort and prioritize the results
|
||||
tag_results: list[set[Tag]] = library.search_tags(name=base, limit=-1)
|
||||
results_0 = list(tag_results[0])
|
||||
results_0.sort(key=lambda tag: tag.name.lower())
|
||||
results_1 = list(tag_results[1])
|
||||
results_1.sort(key=lambda tag: tag.name.lower())
|
||||
raw_results = list(results_0 + results_1)
|
||||
priority_results: set[Tag] = set()
|
||||
|
||||
for tag in raw_results:
|
||||
if tag.name.lower().startswith(base.strip().lower()):
|
||||
priority_results.add(tag)
|
||||
all_results = sorted(list(priority_results), key=lambda tag: len(tag.name)) + [
|
||||
r for r in raw_results if r not in priority_results
|
||||
]
|
||||
|
||||
if parent and parent_results:
|
||||
filtered_parents: list[Tag] = []
|
||||
for tag in all_results:
|
||||
for p_id in tag.parent_ids:
|
||||
if p_id in parent_results:
|
||||
filtered_parents.append(tag)
|
||||
break
|
||||
all_results = [t for t in all_results if t in filtered_parents]
|
||||
|
||||
final_tag: Tag | None = None
|
||||
if len(all_results) > 0:
|
||||
final_tag = all_results[0]
|
||||
if final_tag:
|
||||
tag_ids.add(final_tag.id)
|
||||
|
||||
if not tag_ids:
|
||||
return
|
||||
|
||||
library.add_tags_to_entries(entry_id, tag_ids)
|
||||
|
||||
|
||||
def _exec_add_field(library: "Library", entry_id: int, result: AddFieldInstruction):
|
||||
library.add_field_to_entry(
|
||||
entry_id, field_id=result.name, value=result.content, skip_on_exists=True
|
||||
)
|
||||
@@ -1,183 +0,0 @@
|
||||
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
|
||||
# Licensed under the GPL-3.0 License.
|
||||
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
|
||||
|
||||
"""The core classes and methods of TagStudio."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import structlog
|
||||
|
||||
from tagstudio.core.constants import TS_FOLDER_NAME
|
||||
from tagstudio.core.library.alchemy.fields import FieldID
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
|
||||
logger = structlog.get_logger(__name__)
|
||||
|
||||
|
||||
class TagStudioCore:
|
||||
def __init__(self):
|
||||
self.lib: Library = Library()
|
||||
|
||||
@classmethod
|
||||
def get_gdl_sidecar(cls, filepath: Path, source: str = "") -> dict:
|
||||
"""Attempt to open and dump a Gallery-DL Sidecar file for the filepath.
|
||||
|
||||
Return a formatted object with notable values or an empty object if none is found.
|
||||
"""
|
||||
info = {}
|
||||
_filepath = filepath.parent / (filepath.name + ".json")
|
||||
|
||||
# NOTE: This fixes an unknown (recent?) bug in Gallery-DL where Instagram sidecar
|
||||
# files may be downloaded with indices starting at 1 rather than 0, unlike the posts.
|
||||
# This may only occur with sidecar files that are downloaded separate from posts.
|
||||
if source == "instagram" and not _filepath.is_file():
|
||||
newstem = _filepath.stem[:-16] + "1" + _filepath.stem[-15:]
|
||||
_filepath = _filepath.parent / (newstem + ".json")
|
||||
|
||||
logger.info("get_gdl_sidecar", filepath=filepath, source=source, sidecar=_filepath)
|
||||
|
||||
try:
|
||||
with open(_filepath, encoding="utf8") as f:
|
||||
json_dump = json.load(f)
|
||||
if not json_dump:
|
||||
return {}
|
||||
|
||||
if source == "twitter":
|
||||
info[FieldID.DESCRIPTION] = json_dump["content"].strip()
|
||||
info[FieldID.DATE_PUBLISHED] = json_dump["date"]
|
||||
elif source == "instagram":
|
||||
info[FieldID.DESCRIPTION] = json_dump["description"].strip()
|
||||
info[FieldID.DATE_PUBLISHED] = json_dump["date"]
|
||||
elif source == "artstation":
|
||||
info[FieldID.TITLE] = json_dump["title"].strip()
|
||||
info[FieldID.ARTIST] = json_dump["user"]["full_name"].strip()
|
||||
info[FieldID.DESCRIPTION] = json_dump["description"].strip()
|
||||
info[FieldID.TAGS] = json_dump["tags"]
|
||||
# info["tags"] = [x for x in json_dump["mediums"]["name"]]
|
||||
info[FieldID.DATE_PUBLISHED] = json_dump["date"]
|
||||
elif source == "newgrounds":
|
||||
# info["title"] = json_dump["title"]
|
||||
# info["artist"] = json_dump["artist"]
|
||||
# info["description"] = json_dump["description"]
|
||||
info[FieldID.TAGS] = json_dump["tags"]
|
||||
info[FieldID.DATE_PUBLISHED] = json_dump["date"]
|
||||
info[FieldID.ARTIST] = json_dump["user"].strip()
|
||||
info[FieldID.DESCRIPTION] = json_dump["description"].strip()
|
||||
info[FieldID.SOURCE] = json_dump["post_url"].strip()
|
||||
|
||||
except Exception:
|
||||
logger.exception("Error handling sidecar file.", path=_filepath)
|
||||
|
||||
return info
|
||||
|
||||
# def scrape(self, entry_id):
|
||||
# entry = self.lib.get_entry(entry_id)
|
||||
# if entry.fields:
|
||||
# urls: list[str] = []
|
||||
# if self.lib.get_field_index_in_entry(entry, 21):
|
||||
# urls.extend([self.lib.get_field_attr(entry.fields[x], 'content')
|
||||
# for x in self.lib.get_field_index_in_entry(entry, 21)])
|
||||
# if self.lib.get_field_index_in_entry(entry, 3):
|
||||
# urls.extend([self.lib.get_field_attr(entry.fields[x], 'content')
|
||||
# for x in self.lib.get_field_index_in_entry(entry, 3)])
|
||||
# # try:
|
||||
# if urls:
|
||||
# for url in urls:
|
||||
# url = "https://" + url if 'https://' not in url else url
|
||||
# html_doc = requests.get(url).text
|
||||
# soup = bs(html_doc, "html.parser")
|
||||
# print(soup)
|
||||
# input()
|
||||
|
||||
# # except:
|
||||
# # # print("Could not resolve URL.")
|
||||
# # pass
|
||||
|
||||
@classmethod
|
||||
def match_conditions(cls, lib: Library, entry_id: int) -> bool:
|
||||
"""Match defined conditions against a file to add Entry data."""
|
||||
# TODO - what even is this file format?
|
||||
# TODO: Make this stored somewhere better instead of temporarily in this JSON file.
|
||||
cond_file = lib.library_dir / TS_FOLDER_NAME / "conditions.json"
|
||||
if not cond_file.is_file():
|
||||
return False
|
||||
|
||||
entry: Entry = lib.get_entry(entry_id)
|
||||
|
||||
try:
|
||||
with open(cond_file, encoding="utf8") as f:
|
||||
json_dump = json.load(f)
|
||||
for c in json_dump["conditions"]:
|
||||
match: bool = False
|
||||
for path_c in c["path_conditions"]:
|
||||
if Path(path_c).is_relative_to(entry.path):
|
||||
match = True
|
||||
break
|
||||
|
||||
if not match:
|
||||
return False
|
||||
|
||||
if not c.get("fields"):
|
||||
return False
|
||||
|
||||
fields = c["fields"]
|
||||
entry_field_types = {field.type_key: field for field in entry.fields}
|
||||
|
||||
for field in fields:
|
||||
is_new = field["id"] not in entry_field_types
|
||||
field_key = field["id"]
|
||||
if is_new:
|
||||
lib.add_field_to_entry(entry.id, field_key, field["value"])
|
||||
else:
|
||||
lib.update_entry_field(entry.id, field_key, field["value"])
|
||||
|
||||
except Exception:
|
||||
logger.exception("Error matching conditions.", entry=entry)
|
||||
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def build_url(cls, entry: Entry, source: str):
|
||||
"""Try to rebuild a source URL given a specific filename structure."""
|
||||
source = source.lower().replace("-", " ").replace("_", " ")
|
||||
if "twitter" in source:
|
||||
return cls._build_twitter_url(entry)
|
||||
elif "instagram" in source:
|
||||
return cls._build_instagram_url(entry)
|
||||
|
||||
@classmethod
|
||||
def _build_twitter_url(cls, entry: Entry):
|
||||
"""Build a Twitter URL given a specific filename structure.
|
||||
|
||||
Method expects filename to be formatted as 'USERNAME_TWEET-ID_INDEX_YEAR-MM-DD'
|
||||
"""
|
||||
try:
|
||||
stubs = str(entry.path.name).rsplit("_", 3)
|
||||
url = f"www.twitter.com/{stubs[0]}/status/{stubs[-3]}/photo/{stubs[-2]}"
|
||||
return url
|
||||
except Exception:
|
||||
logger.exception("Error building Twitter URL.", entry=entry)
|
||||
return ""
|
||||
|
||||
@classmethod
|
||||
def _build_instagram_url(cls, entry: Entry):
|
||||
"""Build an Instagram URL given a specific filename structure.
|
||||
|
||||
Method expects filename to be formatted as 'USERNAME_POST-ID_INDEX_YEAR-MM-DD'
|
||||
"""
|
||||
try:
|
||||
stubs = str(entry.path.name).rsplit("_", 2)
|
||||
# stubs[0] = stubs[0].replace(f"{author}_", '', 1)
|
||||
# print(stubs)
|
||||
# NOTE: Both Instagram usernames AND their ID can have underscores in them,
|
||||
# so unless you have the exact username (which can change) on hand to remove,
|
||||
# your other best bet is to hope that the ID is only 11 characters long, which
|
||||
# seems to more or less be the case... for now...
|
||||
url = f"www.instagram.com/p/{stubs[-3][-11:]}"
|
||||
return url
|
||||
except Exception:
|
||||
logger.exception("Error building Instagram URL.", entry=entry)
|
||||
return ""
|
||||
@@ -66,6 +66,7 @@ class GlobalSettings(BaseModel):
|
||||
loop: bool = Field(default=True)
|
||||
show_filenames_in_grid: bool = Field(default=True)
|
||||
page_size: int = Field(default=100)
|
||||
infinite_scroll: bool = Field(default=True)
|
||||
show_filepath: ShowFilepathOption = Field(default=ShowFilepathOption.DEFAULT)
|
||||
tag_click_action: TagClickActionOption = Field(default=TagClickActionOption.DEFAULT)
|
||||
theme: Theme = Field(default=Theme.SYSTEM)
|
||||
|
||||
@@ -5,16 +5,18 @@
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
|
||||
|
||||
def four_corner_gradient(
|
||||
image: Image.Image, size: tuple[int, int], mask: Image.Image | None = None
|
||||
) -> Image.Image:
|
||||
if image.size != size:
|
||||
# Four-Corner Gradient Background.
|
||||
tl = image.getpixel((0, 0))
|
||||
tr = image.getpixel(((image.size[0] - 1), 0))
|
||||
bl = image.getpixel((0, (image.size[1] - 1)))
|
||||
br = image.getpixel(((image.size[0] - 1), (image.size[1] - 1)))
|
||||
tl = unwrap(image.getpixel((0, 0)))
|
||||
tr = unwrap(image.getpixel(((image.size[0] - 1), 0)))
|
||||
bl = unwrap(image.getpixel((0, (image.size[1] - 1))))
|
||||
br = unwrap(image.getpixel(((image.size[0] - 1), (image.size[1] - 1))))
|
||||
bg = Image.new(mode="RGB", size=(2, 2))
|
||||
bg.paste(tl, (0, 0, 2, 2))
|
||||
bg.paste(tr, (1, 0, 2, 2))
|
||||
|
||||
@@ -23,6 +23,7 @@ from PySide6.QtWidgets import (
|
||||
from tagstudio.core.library.alchemy.enums import TagColorEnum
|
||||
from tagstudio.core.library.alchemy.library import Library, slugify
|
||||
from tagstudio.core.library.alchemy.models import TagColorGroup
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.tag_color_preview import TagColorPreview
|
||||
from tagstudio.qt.mixed.tag_widget import (
|
||||
get_border_color,
|
||||
@@ -126,8 +127,8 @@ class BuildColorPanel(PanelWidget):
|
||||
self.border_checkbox.setFixedSize(22, 22)
|
||||
self.border_checkbox.clicked.connect(
|
||||
lambda checked: self.update_secondary(
|
||||
color=QColor(self.preview_button.tag_color_group.secondary)
|
||||
if self.preview_button.tag_color_group.secondary
|
||||
color=QColor(unwrap(self.preview_button.tag_color_group).secondary)
|
||||
if unwrap(self.preview_button.tag_color_group).secondary
|
||||
else None,
|
||||
color_border=checked,
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ from PySide6.QtWidgets import (
|
||||
from tagstudio.core.library.alchemy.enums import TagColorEnum
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Tag, TagColorGroup
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.tag_color_preview import TagColorPreview
|
||||
from tagstudio.qt.mixed.tag_color_selection import TagColorSelection
|
||||
from tagstudio.qt.mixed.tag_search import TagSearchModal, TagSearchPanel
|
||||
@@ -181,6 +182,7 @@ class BuildTagPanel(PanelWidget):
|
||||
self.color_layout.addWidget(self.color_title)
|
||||
self.color_button: TagColorPreview
|
||||
try:
|
||||
assert tag is not None
|
||||
self.color_button = TagColorPreview(self.lib, tag.color)
|
||||
except Exception as e:
|
||||
# TODO: Investigate why this happens during tests
|
||||
@@ -316,7 +318,7 @@ class BuildTagPanel(PanelWidget):
|
||||
item = self.aliases_table.cellWidget(row, 1)
|
||||
item.setFocus()
|
||||
|
||||
def remove_alias_callback(self, alias_name: str, alias_id: int | None = None):
|
||||
def remove_alias_callback(self, alias_name: str, alias_id: int):
|
||||
logger.info("remove_alias_callback")
|
||||
|
||||
self.alias_ids.remove(alias_id)
|
||||
@@ -468,7 +470,7 @@ class BuildTagPanel(PanelWidget):
|
||||
|
||||
def _update_new_alias_name_dict(self):
|
||||
for i in range(0, self.aliases_table.rowCount()):
|
||||
widget = self.aliases_table.cellWidget(i, 1)
|
||||
widget = cast(CustomTableItem, self.aliases_table.cellWidget(i, 1))
|
||||
self.new_alias_names[widget.id] = widget.text()
|
||||
|
||||
def _set_aliases(self):
|
||||
@@ -574,8 +576,8 @@ class BuildTagPanel(PanelWidget):
|
||||
self.setTabOrder(self.shorthand_field, self.aliases_add_button)
|
||||
self.setTabOrder(self.aliases_add_button, self.parent_tags_add_button)
|
||||
self.setTabOrder(self.parent_tags_add_button, self.color_button)
|
||||
self.setTabOrder(self.color_button, self.panel_cancel_button)
|
||||
self.setTabOrder(self.panel_cancel_button, self.panel_save_button)
|
||||
self.setTabOrder(self.panel_save_button, self.aliases_table.cellWidget(0, 1))
|
||||
self.setTabOrder(self.color_button, unwrap(self.panel_cancel_button))
|
||||
self.setTabOrder(unwrap(self.panel_cancel_button), unwrap(self.panel_save_button))
|
||||
self.setTabOrder(unwrap(self.panel_save_button), self.aliases_table.cellWidget(0, 1))
|
||||
self.name_field.selectAll()
|
||||
self.name_field.setFocus()
|
||||
|
||||
@@ -13,6 +13,7 @@ from PySide6.QtWidgets import QMessageBox, QPushButton
|
||||
from tagstudio.core.constants import RESERVED_NAMESPACE_PREFIX
|
||||
from tagstudio.core.library.alchemy.enums import TagColorEnum
|
||||
from tagstudio.core.library.alchemy.models import TagColorGroup
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.build_color import BuildColorPanel
|
||||
from tagstudio.qt.mixed.field_widget import FieldWidget
|
||||
from tagstudio.qt.mixed.tag_color_label import TagColorLabel
|
||||
@@ -88,7 +89,7 @@ class ColorBoxWidget(FieldWidget):
|
||||
color_widgets: list[TagColorLabel] = []
|
||||
|
||||
while self.base_layout.itemAt(0):
|
||||
self.base_layout.takeAt(0).widget().deleteLater()
|
||||
unwrap(self.base_layout.takeAt(0)).widget().deleteLater()
|
||||
|
||||
for color in colors_:
|
||||
color_widget = TagColorLabel(
|
||||
|
||||
@@ -21,6 +21,7 @@ from PySide6.QtWidgets import (
|
||||
QWidget,
|
||||
)
|
||||
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.progress_bar import ProgressWidget
|
||||
from tagstudio.qt.translations import Translations
|
||||
|
||||
@@ -120,7 +121,9 @@ class DropImportModal(QWidget):
|
||||
continue
|
||||
|
||||
self.files.append(f)
|
||||
if (self.driver.lib.library_dir / self._get_relative_path(file)).exists():
|
||||
if (
|
||||
unwrap(self.driver.lib.library_dir) / self._get_relative_path(file)
|
||||
).exists():
|
||||
self.duplicate_files.append(f)
|
||||
|
||||
self.dirs_in_root.append(file.parent)
|
||||
@@ -132,7 +135,7 @@ class DropImportModal(QWidget):
|
||||
file.parent
|
||||
) # to create relative path of files not in folder
|
||||
|
||||
if (Path(self.driver.lib.library_dir) / file.name).exists():
|
||||
if (Path(unwrap(self.driver.lib.library_dir)) / file.name).exists():
|
||||
self.duplicate_files.append(file)
|
||||
|
||||
def ask_duplicates_choice(self):
|
||||
@@ -205,8 +208,10 @@ class DropImportModal(QWidget):
|
||||
new_name = self._get_renamed_duplicate_filename(dest_file)
|
||||
dest_file = dest_file.with_name(new_name)
|
||||
|
||||
(self.driver.lib.library_dir / dest_file).parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copyfile(file, self.driver.lib.library_dir / dest_file)
|
||||
(unwrap(self.driver.lib.library_dir) / dest_file).parent.mkdir(
|
||||
parents=True, exist_ok=True
|
||||
)
|
||||
shutil.copyfile(file, unwrap(self.driver.lib.library_dir) / dest_file)
|
||||
|
||||
file_count += 1
|
||||
yield [file_count, duplicated_files_progress]
|
||||
@@ -226,7 +231,7 @@ class DropImportModal(QWidget):
|
||||
except ValueError:
|
||||
dot_idx = len(o_filename)
|
||||
|
||||
while (self.driver.lib.library_dir / filepath).exists():
|
||||
while (unwrap(self.driver.lib.library_dir) / filepath).exists():
|
||||
filepath = filepath.with_name(
|
||||
o_filename[:dot_idx] + f" ({index})" + o_filename[dot_idx:]
|
||||
)
|
||||
|
||||
@@ -149,10 +149,12 @@ class FieldContainers(QWidget):
|
||||
tag = self.lib.get_tag(tag_id)
|
||||
if not tag:
|
||||
return
|
||||
new_tags = (
|
||||
entry.tags.union({tag}) if toggle_value else {t for t in entry.tags if t.id != tag_id}
|
||||
)
|
||||
self.update_granular(entry_tags=new_tags, entry_fields=entry.fields, update_badges=False)
|
||||
if toggle_value:
|
||||
entry.tags.add(tag)
|
||||
else:
|
||||
entry.tags.discard(tag)
|
||||
|
||||
self.update_granular(entry_tags=entry.tags, entry_fields=entry.fields, update_badges=False)
|
||||
|
||||
def hide_containers(self):
|
||||
"""Hide all field and tag containers."""
|
||||
|
||||
@@ -151,7 +151,7 @@ class FileAttributes(QWidget):
|
||||
self.layout().setSpacing(0)
|
||||
self.file_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
self.file_label.setText(f"<i>{Translations['preview.no_selection']}</i>")
|
||||
self.file_label.set_file_path("")
|
||||
self.file_label.set_file_path(Path())
|
||||
self.file_label.setCursor(Qt.CursorShape.ArrowCursor)
|
||||
self.dimensions_label.setText("")
|
||||
self.dimensions_label.setHidden(True)
|
||||
@@ -264,6 +264,6 @@ class FileAttributes(QWidget):
|
||||
self.file_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
self.file_label.setText(Translations.format("preview.multiple_selection", count=count))
|
||||
self.file_label.setCursor(Qt.CursorShape.ArrowCursor)
|
||||
self.file_label.set_file_path("")
|
||||
self.file_label.set_file_path(Path())
|
||||
self.dimensions_label.setText("")
|
||||
self.dimensions_label.setHidden(True)
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
|
||||
|
||||
|
||||
import time
|
||||
from enum import Enum
|
||||
from functools import wraps
|
||||
from pathlib import Path
|
||||
@@ -21,13 +20,13 @@ from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.media_types import MediaCategories, MediaType
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.platform_strings import open_file_str, trash_term
|
||||
from tagstudio.qt.previews.renderer import ThumbRenderer
|
||||
from tagstudio.qt.translations import Translations
|
||||
from tagstudio.qt.utils.file_opener import FileOpenerHelper
|
||||
from tagstudio.qt.views.layouts.flow_layout import FlowWidget
|
||||
from tagstudio.qt.views.thumb_button import ThumbButton
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
logger = structlog.get_logger(__name__)
|
||||
@@ -66,8 +65,6 @@ def badge_update_lock(func):
|
||||
class ItemThumb(FlowWidget):
|
||||
"""The thumbnail widget for a library item (Entry, Collation, Tag Group, etc.)."""
|
||||
|
||||
update_cutoff: float = time.time()
|
||||
|
||||
collation_icon_128: Image.Image = Image.open(
|
||||
str(Path(__file__).parents[2] / "resources/qt/images/collation_icon_128.png")
|
||||
)
|
||||
@@ -119,6 +116,8 @@ class ItemThumb(FlowWidget):
|
||||
self.mode: ItemType | None = mode
|
||||
self.driver = driver
|
||||
self.item_id: int = -1
|
||||
self.item_path: Path | None = None
|
||||
self.rendered_path: Path | None = None
|
||||
self.thumb_size: tuple[int, int] = thumb_size
|
||||
self.show_filename_label: bool = show_filename_label
|
||||
self.label_height = 12
|
||||
@@ -195,20 +194,11 @@ class ItemThumb(FlowWidget):
|
||||
self.thumb_layout.addWidget(self.bottom_container)
|
||||
|
||||
self.thumb_button = ThumbButton(self.thumb_container, thumb_size)
|
||||
self.renderer = ThumbRenderer(driver, self.lib)
|
||||
self.renderer.updated.connect(
|
||||
lambda timestamp, image, size, filename: (
|
||||
self.update_thumb(image, timestamp),
|
||||
self.update_size(size, timestamp),
|
||||
self.set_filename_text(filename, timestamp),
|
||||
self.set_extension(filename, timestamp),
|
||||
)
|
||||
)
|
||||
self.thumb_button.setFlat(True)
|
||||
self.thumb_button.setLayout(self.thumb_layout)
|
||||
self.thumb_button.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu)
|
||||
|
||||
self.opener = FileOpenerHelper("")
|
||||
self.opener = FileOpenerHelper(Path())
|
||||
open_file_action = QAction(Translations["file.open_file"], self)
|
||||
open_file_action.triggered.connect(self.opener.open_file)
|
||||
open_explorer_action = QAction(open_file_str(), self)
|
||||
@@ -219,6 +209,12 @@ class ItemThumb(FlowWidget):
|
||||
self,
|
||||
)
|
||||
|
||||
def _on_delete():
|
||||
if self.item_id != -1 and self.item_path is not None:
|
||||
self.driver.delete_files_callback(self.item_path, self.item_id)
|
||||
|
||||
self.delete_action.triggered.connect(lambda checked=False: _on_delete())
|
||||
|
||||
self.thumb_button.addAction(open_file_action)
|
||||
self.thumb_button.addAction(open_explorer_action)
|
||||
self.thumb_button.addAction(self.delete_action)
|
||||
@@ -338,7 +334,7 @@ class ItemThumb(FlowWidget):
|
||||
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, on=True)
|
||||
self.thumb_button.unsetCursor()
|
||||
self.thumb_button.setHidden(True)
|
||||
elif mode == ItemType.ENTRY and self.mode != ItemType.ENTRY:
|
||||
elif mode == ItemType.ENTRY:
|
||||
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, on=False)
|
||||
self.thumb_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
self.thumb_button.setHidden(False)
|
||||
@@ -348,7 +344,7 @@ class ItemThumb(FlowWidget):
|
||||
self.count_badge.setStyleSheet(ItemThumb.small_text_style)
|
||||
self.count_badge.setHidden(True)
|
||||
self.ext_badge.setHidden(True)
|
||||
elif mode == ItemType.COLLATION and self.mode != ItemType.COLLATION:
|
||||
elif mode == ItemType.COLLATION:
|
||||
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, on=False)
|
||||
self.thumb_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
self.thumb_button.setHidden(False)
|
||||
@@ -357,7 +353,7 @@ class ItemThumb(FlowWidget):
|
||||
self.count_badge.setStyleSheet(ItemThumb.med_text_style)
|
||||
self.count_badge.setHidden(False)
|
||||
self.item_type_badge.setHidden(False)
|
||||
elif mode == ItemType.TAG_GROUP and self.mode != ItemType.TAG_GROUP:
|
||||
elif mode == ItemType.TAG_GROUP:
|
||||
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents, on=False)
|
||||
self.thumb_button.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
self.thumb_button.setHidden(False)
|
||||
@@ -366,9 +362,9 @@ class ItemThumb(FlowWidget):
|
||||
self.item_type_badge.setHidden(False)
|
||||
self.mode = mode
|
||||
|
||||
def set_extension(self, filename: Path, timestamp: float | None = None) -> None:
|
||||
if timestamp and timestamp < ItemThumb.update_cutoff:
|
||||
return
|
||||
def set_extension(self, filename: Path) -> None:
|
||||
show_ext_badge = False
|
||||
show_count_badge = False
|
||||
|
||||
ext = filename.suffix.lower()
|
||||
if ext and ext.startswith(".") is False:
|
||||
@@ -389,15 +385,14 @@ class ItemThumb(FlowWidget):
|
||||
".webp",
|
||||
]
|
||||
):
|
||||
self.ext_badge.setText(ext.upper()[1:] or filename.stem.upper())
|
||||
if ext or filename.stem:
|
||||
self.ext_badge.setHidden(False)
|
||||
self.ext_badge.setText(ext.upper()[1:] or filename.stem.upper())
|
||||
show_ext_badge = True
|
||||
if MediaType.VIDEO in media_types or MediaType.AUDIO in media_types:
|
||||
self.count_badge.setHidden(False)
|
||||
else:
|
||||
if self.mode == ItemType.ENTRY or self.mode is None:
|
||||
self.ext_badge.setHidden(True)
|
||||
self.count_badge.setHidden(True)
|
||||
show_count_badge = True
|
||||
|
||||
self.ext_badge.setHidden(not show_ext_badge)
|
||||
self.count_badge.setHidden(not show_count_badge)
|
||||
|
||||
def set_count(self, count: str) -> None:
|
||||
if count:
|
||||
@@ -408,11 +403,7 @@ class ItemThumb(FlowWidget):
|
||||
self.ext_badge.setHidden(True)
|
||||
self.count_badge.setHidden(True)
|
||||
|
||||
def set_filename_text(self, filename: Path, timestamp: float | None = None):
|
||||
if timestamp and timestamp < ItemThumb.update_cutoff:
|
||||
return
|
||||
|
||||
self.set_item_path(filename)
|
||||
def set_filename_text(self, filename: Path):
|
||||
self.file_label.setText(str(filename.name))
|
||||
|
||||
def set_filename_visibility(self, set_visible: bool):
|
||||
@@ -430,48 +421,45 @@ class ItemThumb(FlowWidget):
|
||||
self.setFixedHeight(self.thumb_size[1])
|
||||
self.show_filename_label = set_visible
|
||||
|
||||
def update_thumb(self, image: QPixmap | None = None, timestamp: float | None = None):
|
||||
def update_thumb(self, image: QPixmap | None = None, file_path: Path | None = None):
|
||||
"""Update attributes of a thumbnail element."""
|
||||
if timestamp and timestamp < ItemThumb.update_cutoff:
|
||||
return
|
||||
|
||||
self.thumb_button.setIcon(image if image else QPixmap())
|
||||
self.rendered_path = file_path
|
||||
|
||||
def update_size(self, size: QSize, timestamp: float | None = None):
|
||||
def update_size(self, size: QSize):
|
||||
"""Updates attributes of a thumbnail element.
|
||||
|
||||
Args:
|
||||
timestamp (float | None): The UTC timestamp for when this call was
|
||||
originally dispatched. Used to skip outdated jobs.
|
||||
|
||||
size (QSize): The new thumbnail size to set.
|
||||
"""
|
||||
if timestamp and timestamp < ItemThumb.update_cutoff:
|
||||
return
|
||||
|
||||
self.thumb_size = size.width(), size.height()
|
||||
self.thumb_button.setIconSize(size)
|
||||
self.thumb_button.setMinimumSize(size)
|
||||
self.thumb_button.setMaximumSize(size)
|
||||
|
||||
def set_item(self, entry: "Entry"):
|
||||
self.set_item_id(entry.id)
|
||||
path = unwrap(self.lib.library_dir) / entry.path
|
||||
self.set_item_path(path)
|
||||
|
||||
def set_item_id(self, item_id: int):
|
||||
self.item_id = item_id
|
||||
|
||||
def set_item_path(self, path: Path | str):
|
||||
def set_item_path(self, path: Path):
|
||||
"""Set the absolute filepath for the item. Used for locating on disk."""
|
||||
self.item_path = path
|
||||
self.opener.set_filepath(path)
|
||||
|
||||
def assign_badge(self, badge_type: BadgeType, value: bool) -> None:
|
||||
mode = self.mode
|
||||
# blank mode to avoid recursive badge updates
|
||||
self.mode = None
|
||||
badge = self.badges[badge_type]
|
||||
self.badge_active[badge_type] = value
|
||||
if badge.isChecked() != value:
|
||||
self.mode = None
|
||||
badge.setChecked(value)
|
||||
badge.setHidden(not value)
|
||||
|
||||
self.mode = mode
|
||||
self.mode = mode
|
||||
|
||||
def show_check_badges(self, show: bool):
|
||||
if self.mode != ItemType.TAG_GROUP:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import typing
|
||||
from pathlib import Path
|
||||
from time import gmtime
|
||||
from typing import override
|
||||
from typing import cast, override
|
||||
|
||||
import structlog
|
||||
from PIL import Image, ImageDraw
|
||||
@@ -312,7 +312,10 @@ class MediaPlayer(QGraphicsView):
|
||||
def mousePressEvent(self, event: QMouseEvent) -> None:
|
||||
# Pause media if background is clicked, with buffer around controls
|
||||
buffer: int = 6
|
||||
if event.y() < (self.height() - self.controls.height() - buffer):
|
||||
if (
|
||||
event.y() < (self.height() - self.controls.height() - buffer)
|
||||
and event.button() == Qt.MouseButton.LeftButton
|
||||
):
|
||||
self.toggle_play()
|
||||
return super().mousePressEvent(event)
|
||||
|
||||
@@ -411,11 +414,11 @@ class MediaPlayer(QGraphicsView):
|
||||
self.player.play()
|
||||
|
||||
def load_toggle_play_icon(self, playing: bool) -> None:
|
||||
icon = self.driver.rm.pause_icon if playing else self.driver.rm.play_icon
|
||||
icon = cast(bytes, self.driver.rm.pause_icon if playing else self.driver.rm.play_icon)
|
||||
self.play_pause.load(icon)
|
||||
|
||||
def load_mute_unmute_icon(self, muted: bool) -> None:
|
||||
icon = self.driver.rm.volume_mute_icon if muted else self.driver.rm.volume_icon
|
||||
icon = cast(bytes, self.driver.rm.volume_mute_icon if muted else self.driver.rm.volume_icon)
|
||||
self.mute_unmute.load(icon)
|
||||
|
||||
def slider_value_changed(self, value: int) -> None:
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
from typing import cast
|
||||
|
||||
import structlog
|
||||
from PySide6.QtCore import QObject, Qt, QThreadPool, Signal
|
||||
@@ -37,6 +38,7 @@ from tagstudio.core.library.alchemy.library import Library as SqliteLibrary
|
||||
from tagstudio.core.library.alchemy.models import Entry, TagAlias
|
||||
from tagstudio.core.library.json.library import Library as JsonLibrary
|
||||
from tagstudio.core.library.json.library import Tag as JsonTag
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.controllers.paged_panel_controller import PagedPanel
|
||||
from tagstudio.qt.controllers.paged_panel_state import PagedPanelState
|
||||
from tagstudio.qt.translations import Translations
|
||||
@@ -60,8 +62,8 @@ class JsonMigrationModal(QObject):
|
||||
self.path: Path = path
|
||||
|
||||
self.stack: list[PagedPanelState] = []
|
||||
self.json_lib: JsonLibrary = None
|
||||
self.sql_lib: SqliteLibrary = None
|
||||
self.json_lib: JsonLibrary = None # pyright: ignore[reportAttributeAccessIssue]
|
||||
self.sql_lib: SqliteLibrary = None # pyright: ignore[reportAttributeAccessIssue]
|
||||
self.is_migration_initialized: bool = False
|
||||
self.discrepancies: list[str] = []
|
||||
|
||||
@@ -71,7 +73,7 @@ class JsonMigrationModal(QObject):
|
||||
self.old_entry_count: int = 0
|
||||
self.old_tag_count: int = 0
|
||||
self.old_ext_count: int = 0
|
||||
self.old_ext_type: bool = None
|
||||
self.old_ext_type: bool = None # pyright: ignore[reportAttributeAccessIssue]
|
||||
|
||||
self.field_parity: bool = False
|
||||
self.path_parity: bool = False
|
||||
@@ -366,7 +368,7 @@ class JsonMigrationModal(QObject):
|
||||
minimum=0,
|
||||
maximum=0,
|
||||
)
|
||||
pb.setCancelButton(None)
|
||||
pb.setCancelButton(None) # pyright: ignore[reportArgumentType]
|
||||
self.body_wrapper_01.layout().addWidget(pb)
|
||||
|
||||
try:
|
||||
@@ -389,7 +391,7 @@ class JsonMigrationModal(QObject):
|
||||
pb.setMinimum(1), # type: ignore
|
||||
pb.setValue(1), # type: ignore
|
||||
# Enable the finish button
|
||||
self.stack[1].buttons[4].setDisabled(False),
|
||||
cast(QPushButtonWrapper, self.stack[1].buttons[4]).setDisabled(False),
|
||||
)
|
||||
)
|
||||
QThreadPool.globalInstance().start(r)
|
||||
@@ -473,7 +475,7 @@ class JsonMigrationModal(QObject):
|
||||
)
|
||||
self.update_sql_value(
|
||||
self.ext_type_row,
|
||||
self.sql_lib.prefs(LibraryPrefs.IS_EXCLUDE_LIST),
|
||||
self.sql_lib.prefs(LibraryPrefs.IS_EXCLUDE_LIST), # pyright: ignore[reportArgumentType]
|
||||
self.old_ext_type,
|
||||
)
|
||||
logger.info("Parity check complete!")
|
||||
@@ -561,7 +563,7 @@ class JsonMigrationModal(QObject):
|
||||
sql_fields: list[tuple] = []
|
||||
json_fields: list[tuple] = []
|
||||
|
||||
sql_entry: Entry = self.sql_lib.get_entry_full(json_entry.id + 1)
|
||||
sql_entry: Entry = unwrap(self.sql_lib.get_entry_full(json_entry.id + 1))
|
||||
if not sql_entry:
|
||||
logger.info(
|
||||
"[Field Comparison]",
|
||||
@@ -595,7 +597,7 @@ class JsonMigrationModal(QObject):
|
||||
tags_count += 1
|
||||
json_tags = json_tags.union(value or [])
|
||||
else:
|
||||
key: str = self.sql_lib.get_field_name_from_id(int_key).name
|
||||
key: str = unwrap(self.sql_lib.get_field_name_from_id(int_key)).name
|
||||
json_fields.append((json_entry.id + 1, key, value))
|
||||
json_fields.sort()
|
||||
|
||||
@@ -635,18 +637,15 @@ class JsonMigrationModal(QObject):
|
||||
|
||||
def check_subtag_parity(self) -> bool:
|
||||
"""Check if all JSON parent tags match the new SQL parent tags."""
|
||||
sql_parent_tags: set[int] = None
|
||||
json_parent_tags: set[int] = None
|
||||
|
||||
with Session(self.sql_lib.engine) as session:
|
||||
for tag in self.sql_lib.tags:
|
||||
tag_id = tag.id # Tag IDs start at 0
|
||||
sql_parent_tags = set(
|
||||
sql_parent_tags: set[int] = set(
|
||||
session.scalars(select(TagParent.parent_id).where(TagParent.child_id == tag.id))
|
||||
)
|
||||
|
||||
# JSON tags allowed self-parenting; SQL tags no longer allow this.
|
||||
json_parent_tags = set(self.json_lib.get_tag(tag_id).subtag_ids)
|
||||
json_parent_tags: set[int] = set(self.json_lib.get_tag(tag_id).subtag_ids)
|
||||
json_parent_tags.discard(tag_id)
|
||||
|
||||
logger.info(
|
||||
@@ -676,16 +675,15 @@ class JsonMigrationModal(QObject):
|
||||
|
||||
def check_alias_parity(self) -> bool:
|
||||
"""Check if all JSON aliases match the new SQL aliases."""
|
||||
sql_aliases: set[str] = None
|
||||
json_aliases: set[str] = None
|
||||
|
||||
with Session(self.sql_lib.engine) as session:
|
||||
for tag in self.sql_lib.tags:
|
||||
tag_id = tag.id # Tag IDs start at 0
|
||||
sql_aliases = set(
|
||||
sql_aliases: set[str] = set(
|
||||
session.scalars(select(TagAlias.name).where(TagAlias.tag_id == tag.id))
|
||||
)
|
||||
json_aliases = set([x for x in self.json_lib.get_tag(tag_id).aliases if x])
|
||||
json_aliases: set[str] = set(
|
||||
[x for x in self.json_lib.get_tag(tag_id).aliases if x]
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"[Alias Parity]",
|
||||
@@ -710,8 +708,6 @@ class JsonMigrationModal(QObject):
|
||||
|
||||
def check_name_parity(self) -> bool:
|
||||
"""Check if all JSON tag names match the new SQL tag names."""
|
||||
sql_name: str = None
|
||||
json_name: str = None
|
||||
|
||||
def sanitize(value):
|
||||
"""Return value or convert a "not" value into None."""
|
||||
@@ -719,8 +715,8 @@ class JsonMigrationModal(QObject):
|
||||
|
||||
for tag in self.sql_lib.tags:
|
||||
tag_id = tag.id # Tag IDs start at 0
|
||||
sql_name = sanitize(tag.name)
|
||||
json_name = sanitize(self.json_lib.get_tag(tag_id).name)
|
||||
sql_name: str = unwrap(sanitize(tag.name))
|
||||
json_name: str = unwrap(sanitize(self.json_lib.get_tag(tag_id).name))
|
||||
|
||||
logger.info(
|
||||
"[Name Parity]",
|
||||
@@ -742,8 +738,6 @@ class JsonMigrationModal(QObject):
|
||||
|
||||
def check_shorthand_parity(self) -> bool:
|
||||
"""Check if all JSON shorthands match the new SQL shorthands."""
|
||||
sql_shorthand: str = None
|
||||
json_shorthand: str = None
|
||||
|
||||
def sanitize(value):
|
||||
"""Return value or convert a "not" value into None."""
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
"""A pagination widget created for TagStudio."""
|
||||
|
||||
from typing import override
|
||||
from typing import cast, override
|
||||
|
||||
from PIL import Image, ImageQt
|
||||
from PySide6.QtCore import QObject, QSize, Signal
|
||||
from PySide6.QtCore import QSize, Signal
|
||||
from PySide6.QtGui import QIntValidator, QPixmap
|
||||
from PySide6.QtWidgets import QHBoxLayout, QLabel, QLineEdit, QSizePolicy, QWidget
|
||||
|
||||
@@ -17,7 +17,7 @@ from tagstudio.qt.resource_manager import ResourceManager
|
||||
from tagstudio.qt.views.qbutton_wrapper import QPushButtonWrapper
|
||||
|
||||
|
||||
class Pagination(QWidget, QObject):
|
||||
class Pagination(QWidget):
|
||||
"""Widget containing controls for navigating between pages of items."""
|
||||
|
||||
index = Signal(int)
|
||||
@@ -160,8 +160,8 @@ class Pagination(QWidget, QObject):
|
||||
srt_scale = max(1, (7 - (end_page - index)))
|
||||
|
||||
if page_count >= 8:
|
||||
end_size = self.button_size.width() * end_scale + (3 * (end_scale - 1))
|
||||
srt_size = self.button_size.width() * srt_scale + (3 * (srt_scale - 1))
|
||||
end_size = self.button_size.width() * end_scale + (3 * (end_scale - 1)) # pyright: ignore[reportPossiblyUnboundVariable]
|
||||
srt_size = self.button_size.width() * srt_scale + (3 * (srt_scale - 1)) # pyright: ignore[reportPossiblyUnboundVariable]
|
||||
self.end_ellipses.setMinimumWidth(end_size)
|
||||
self.end_ellipses.setMaximumWidth(end_size)
|
||||
self.start_ellipses.setMinimumWidth(srt_size)
|
||||
@@ -223,7 +223,10 @@ class Pagination(QWidget, QObject):
|
||||
str(i + 1)
|
||||
)
|
||||
self._assign_click(
|
||||
self.start_buffer_layout.itemAt(i - start_offset).widget(),
|
||||
cast(
|
||||
QPushButtonWrapper,
|
||||
self.start_buffer_layout.itemAt(i - start_offset).widget(),
|
||||
),
|
||||
i,
|
||||
)
|
||||
sbc += 1
|
||||
@@ -239,7 +242,10 @@ class Pagination(QWidget, QObject):
|
||||
str(i + 1)
|
||||
)
|
||||
self._assign_click(
|
||||
self.end_buffer_layout.itemAt(i - end_offset).widget(),
|
||||
cast(
|
||||
QPushButtonWrapper,
|
||||
self.end_buffer_layout.itemAt(i - end_offset).widget(),
|
||||
),
|
||||
i,
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -89,7 +89,7 @@ class SettingsPanel(PanelWidget):
|
||||
# and we want to use the current language for the dropdowns
|
||||
|
||||
self.driver = driver
|
||||
self.setMinimumSize(400, 300)
|
||||
self.setMinimumSize(400, 500)
|
||||
|
||||
self.root_layout = QVBoxLayout(self)
|
||||
self.root_layout.setContentsMargins(0, 6, 0, 0)
|
||||
@@ -183,13 +183,22 @@ class SettingsPanel(PanelWidget):
|
||||
Translations["settings.show_filenames_in_grid"], self.show_filenames_checkbox
|
||||
)
|
||||
|
||||
# Infinite Scrolling
|
||||
self.infinite_scroll = QCheckBox()
|
||||
self.infinite_scroll.setChecked(self.driver.settings.infinite_scroll)
|
||||
self.infinite_scroll.checkStateChanged.connect(
|
||||
lambda checked: self.page_size_line_edit.setEnabled(not checked.value)
|
||||
)
|
||||
form_layout.addRow(Translations["settings.infinite_scroll"], self.infinite_scroll)
|
||||
|
||||
# Page Size
|
||||
self.page_size_line_edit = QLineEdit()
|
||||
self.page_size_line_edit.setText(str(self.driver.settings.page_size))
|
||||
self.page_size_line_edit.setEnabled(not self.infinite_scroll.checkState().value)
|
||||
|
||||
def on_page_size_changed():
|
||||
text = self.page_size_line_edit.text()
|
||||
if not text.isdigit() or int(text) < 1:
|
||||
if not text.isdigit():
|
||||
self.page_size_line_edit.setText(str(self.driver.settings.page_size))
|
||||
|
||||
self.page_size_line_edit.editingFinished.connect(on_page_size_changed)
|
||||
@@ -288,6 +297,7 @@ class SettingsPanel(PanelWidget):
|
||||
"autoplay": self.autoplay_checkbox.isChecked(),
|
||||
"show_filenames_in_grid": self.show_filenames_checkbox.isChecked(),
|
||||
"page_size": int(self.page_size_line_edit.text()),
|
||||
"infinite_scroll": self.infinite_scroll.isChecked(),
|
||||
"show_filepath": self.filepath_combobox.currentData(),
|
||||
"theme": self.theme_combobox.currentData(),
|
||||
"tag_click_action": self.tag_click_action_combobox.currentData(),
|
||||
@@ -307,6 +317,7 @@ class SettingsPanel(PanelWidget):
|
||||
driver.settings.thumb_cache_size = settings["thumb_cache_size"]
|
||||
driver.settings.show_filenames_in_grid = settings["show_filenames_in_grid"]
|
||||
driver.settings.page_size = settings["page_size"]
|
||||
driver.settings.infinite_scroll = settings["infinite_scroll"]
|
||||
driver.settings.show_filepath = settings["show_filepath"]
|
||||
driver.settings.theme = settings["theme"]
|
||||
driver.settings.tag_click_action = settings["tag_click_action"]
|
||||
|
||||
@@ -20,12 +20,15 @@ from xml.etree.ElementTree import Element
|
||||
import cv2
|
||||
import numpy as np
|
||||
import pillow_avif # noqa: F401 # pyright: ignore[reportUnusedImport]
|
||||
import py7zr
|
||||
import py7zr.io
|
||||
import rarfile
|
||||
import rawpy
|
||||
import srctools
|
||||
import structlog
|
||||
from cv2.typing import MatLike
|
||||
from mutagen import MutagenError, flac, id3, mp4
|
||||
from mutagen import flac, id3, mp4
|
||||
from mutagen._util import MutagenError
|
||||
from PIL import (
|
||||
Image,
|
||||
ImageChops,
|
||||
@@ -77,7 +80,6 @@ from tagstudio.qt.previews.vendored.pydub.audio_segment import (
|
||||
from tagstudio.qt.resource_manager import ResourceManager
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
ImageFile.LOAD_TRUNCATED_IMAGES = True
|
||||
@@ -93,6 +95,21 @@ except ImportError:
|
||||
logger.exception('[ThumbRenderer] Could not import the "pillow_jxl" module')
|
||||
|
||||
|
||||
class _SevenZipFile(py7zr.SevenZipFile):
|
||||
"""Wrapper around py7zr.SevenZipFile to mimic zipfile.ZipFile's API."""
|
||||
|
||||
def __init__(self, filepath: Path, mode: Literal["r"]) -> None:
|
||||
super().__init__(filepath, mode)
|
||||
|
||||
def read(self, name: str) -> bytes:
|
||||
# SevenZipFile must be reset after every extraction
|
||||
# See https://py7zr.readthedocs.io/en/stable/api.html#py7zr.SevenZipFile.extract
|
||||
self.reset()
|
||||
factory = py7zr.io.BytesIOFactory(limit=10485760) # 10 MiB
|
||||
self.extract(targets=[name], factory=factory)
|
||||
return factory.get(name).read()
|
||||
|
||||
|
||||
class _TarFile(tarfile.TarFile):
|
||||
"""Wrapper around tarfile.TarFile to mimic zipfile.ZipFile's API."""
|
||||
|
||||
@@ -103,11 +120,13 @@ class _TarFile(tarfile.TarFile):
|
||||
return self.getnames()
|
||||
|
||||
def read(self, name: str) -> bytes:
|
||||
return self.extractfile(name).read()
|
||||
return unwrap(self.extractfile(name)).read()
|
||||
|
||||
|
||||
type _Archive_T = type[zipfile.ZipFile] | type[rarfile.RarFile] | type[_TarFile]
|
||||
type _Archive = zipfile.ZipFile | rarfile.RarFile | _TarFile
|
||||
type _Archive_T = (
|
||||
type[zipfile.ZipFile] | type[rarfile.RarFile] | type[_SevenZipFile] | type[_TarFile]
|
||||
)
|
||||
type _Archive = zipfile.ZipFile | rarfile.RarFile | _SevenZipFile | _TarFile
|
||||
|
||||
|
||||
class ThumbRenderer(QObject):
|
||||
@@ -118,11 +137,10 @@ class ThumbRenderer(QObject):
|
||||
updated_ratio = Signal(float)
|
||||
cached_img_ext: str = ".webp"
|
||||
|
||||
def __init__(self, driver: "QtDriver", library: "Library") -> None:
|
||||
def __init__(self, driver: "QtDriver") -> None:
|
||||
"""Initialize the class."""
|
||||
super().__init__()
|
||||
self.driver = driver
|
||||
self.lib = library
|
||||
|
||||
settings_res = self.driver.settings.cached_thumb_resolution
|
||||
self.cached_img_res = (
|
||||
@@ -417,9 +435,9 @@ class ThumbRenderer(QObject):
|
||||
)
|
||||
|
||||
# Get icon by name
|
||||
icon: Image.Image | None = self.rm.get(name)
|
||||
icon: Image.Image | None = self.rm.get(name) # pyright: ignore[reportAssignmentType]
|
||||
if not icon:
|
||||
icon = self.rm.get("file_generic")
|
||||
icon = self.rm.get("file_generic") # pyright: ignore[reportAssignmentType]
|
||||
if not icon:
|
||||
icon = Image.new(mode="RGBA", size=(32, 32), color="magenta")
|
||||
|
||||
@@ -515,9 +533,9 @@ class ThumbRenderer(QObject):
|
||||
)
|
||||
|
||||
# Get icon by name
|
||||
icon: Image.Image | None = self.rm.get(name)
|
||||
icon: Image.Image | None = self.rm.get(name) # pyright: ignore[reportAssignmentType]
|
||||
if not icon:
|
||||
icon = self.rm.get("file_generic")
|
||||
icon = self.rm.get("file_generic") # pyright: ignore[reportAssignmentType]
|
||||
if not icon:
|
||||
icon = Image.new(mode="RGBA", size=(32, 32), color="magenta")
|
||||
|
||||
@@ -646,14 +664,14 @@ class ThumbRenderer(QObject):
|
||||
artwork = Image.open(BytesIO(flac_covers[0].data))
|
||||
elif ext in [".mp4", ".m4a", ".aac"]:
|
||||
mp4_tags: mp4.MP4 = mp4.MP4(filepath)
|
||||
mp4_covers: list = mp4_tags.get("covr")
|
||||
mp4_covers: list | None = mp4_tags.get("covr") # pyright: ignore[reportAssignmentType]
|
||||
if mp4_covers:
|
||||
artwork = Image.open(BytesIO(mp4_covers[0]))
|
||||
if artwork:
|
||||
image = artwork
|
||||
except (
|
||||
FileNotFoundError,
|
||||
id3.ID3NoHeaderError,
|
||||
id3.ID3NoHeaderError, # pyright: ignore[reportPrivateImportUsage]
|
||||
mp4.MP4MetadataError,
|
||||
mp4.MP4StreamInfoError,
|
||||
MutagenError,
|
||||
@@ -750,7 +768,7 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _blender(filepath: Path) -> Image.Image:
|
||||
def _blender(filepath: Path) -> Image.Image | None:
|
||||
"""Get an emended thumbnail from a Blender file, if a thumbnail is present.
|
||||
|
||||
Args:
|
||||
@@ -890,7 +908,9 @@ class ThumbRenderer(QObject):
|
||||
im: Image.Image | None = None
|
||||
try:
|
||||
archiver: _Archive_T = zipfile.ZipFile
|
||||
if ext == ".cbr":
|
||||
if ext == ".cb7":
|
||||
archiver = _SevenZipFile
|
||||
elif ext == ".cbr":
|
||||
archiver = rarfile.RarFile
|
||||
elif ext == ".cbt":
|
||||
archiver = _TarFile
|
||||
@@ -936,21 +956,21 @@ class ThumbRenderer(QObject):
|
||||
cover = comic_info.find(f"./*Page[@Type='{cover_type}']")
|
||||
if cover is not None:
|
||||
pages = [f for f in archive.namelist() if f != "ComicInfo.xml"]
|
||||
page_name = pages[int(cover.get("Image"))]
|
||||
page_name = pages[int(unwrap(cover.get("Image")))]
|
||||
if page_name.endswith((".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg")):
|
||||
image_data = archive.read(page_name)
|
||||
im = Image.open(BytesIO(image_data))
|
||||
|
||||
return im
|
||||
|
||||
def _font_short_thumb(self, filepath: Path, size: int) -> Image.Image:
|
||||
def _font_short_thumb(self, filepath: Path, size: int) -> Image.Image | None:
|
||||
"""Render a small font preview ("Aa") thumbnail from a font file.
|
||||
|
||||
Args:
|
||||
filepath (Path): The path of the file.
|
||||
size (tuple[int,int]): The size of the thumbnail.
|
||||
"""
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
try:
|
||||
bg = Image.new("RGB", (size, size), color="#000000")
|
||||
raw = Image.new("RGB", (size * 3, size * 3), color="#000000")
|
||||
@@ -1004,7 +1024,7 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _font_long_thumb(filepath: Path, size: int) -> Image.Image:
|
||||
def _font_long_thumb(filepath: Path, size: int) -> Image.Image | None:
|
||||
"""Render a large font preview ("Alphabet") thumbnail from a font file.
|
||||
|
||||
Args:
|
||||
@@ -1013,7 +1033,7 @@ class ThumbRenderer(QObject):
|
||||
"""
|
||||
# Scale the sample font sizes to the preview image
|
||||
# resolution,assuming the sizes are tuned for 256px.
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
try:
|
||||
scaled_sizes: list[int] = [math.floor(x * (size / 256)) for x in FONT_SAMPLE_SIZES]
|
||||
bg = Image.new("RGBA", (size, size), color="#00000000")
|
||||
@@ -1024,7 +1044,10 @@ class ThumbRenderer(QObject):
|
||||
for font_size in scaled_sizes:
|
||||
font = ImageFont.truetype(filepath, size=font_size)
|
||||
text_wrapped: str = wrap_full_text(
|
||||
FONT_SAMPLE_TEXT, font=font, width=size, draw=draw
|
||||
FONT_SAMPLE_TEXT,
|
||||
font=font, # pyright: ignore[reportArgumentType]
|
||||
width=size,
|
||||
draw=draw,
|
||||
)
|
||||
draw.multiline_text((0, y_offset), text_wrapped, font=font)
|
||||
y_offset += (len(text_wrapped.split("\n")) + lines_of_padding) * draw.textbbox(
|
||||
@@ -1036,13 +1059,13 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _image_raw_thumb(filepath: Path) -> Image.Image:
|
||||
def _image_raw_thumb(filepath: Path) -> Image.Image | None:
|
||||
"""Render a thumbnail for a RAW image type.
|
||||
|
||||
Args:
|
||||
filepath (Path): The path of the file.
|
||||
"""
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
try:
|
||||
with rawpy.imread(str(filepath)) as raw:
|
||||
rgb = raw.postprocess(use_camera_wb=True)
|
||||
@@ -1054,8 +1077,8 @@ class ThumbRenderer(QObject):
|
||||
)
|
||||
except (
|
||||
DecompressionBombError,
|
||||
rawpy._rawpy.LibRawIOError,
|
||||
rawpy._rawpy.LibRawFileUnsupportedError,
|
||||
rawpy._rawpy.LibRawIOError, # pyright: ignore[reportAttributeAccessIssue]
|
||||
rawpy._rawpy.LibRawFileUnsupportedError, # pyright: ignore[reportAttributeAccessIssue]
|
||||
) as e:
|
||||
logger.error("Couldn't render thumbnail", filepath=filepath, error=type(e).__name__)
|
||||
return im
|
||||
@@ -1091,13 +1114,13 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _image_thumb(filepath: Path) -> Image.Image:
|
||||
def _image_thumb(filepath: Path) -> Image.Image | None:
|
||||
"""Render a thumbnail for a standard image type.
|
||||
|
||||
Args:
|
||||
filepath (Path): The path of the file.
|
||||
"""
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
try:
|
||||
im = Image.open(filepath)
|
||||
if im.mode != "RGB" and im.mode != "RGBA":
|
||||
@@ -1106,7 +1129,7 @@ class ThumbRenderer(QObject):
|
||||
new_bg = Image.new("RGB", im.size, color="#1e1e1e")
|
||||
new_bg.paste(im, mask=im.getchannel(3))
|
||||
im = new_bg
|
||||
im = ImageOps.exif_transpose(im)
|
||||
im = unwrap(ImageOps.exif_transpose(im))
|
||||
except (
|
||||
FileNotFoundError,
|
||||
UnidentifiedImageError,
|
||||
@@ -1124,7 +1147,7 @@ class ThumbRenderer(QObject):
|
||||
filepath (Path): The path of the file.
|
||||
size (tuple[int,int]): The size of the thumbnail.
|
||||
"""
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
# Create an image to draw the svg to and a painter to do the drawing
|
||||
q_image: QImage = QImage(size, size, QImage.Format.Format_ARGB32)
|
||||
q_image.fill("#1e1e1e")
|
||||
@@ -1154,7 +1177,7 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _iwork_thumb(filepath: Path) -> Image.Image:
|
||||
def _iwork_thumb(filepath: Path) -> Image.Image | None:
|
||||
"""Extract and render a thumbnail for an Apple iWork (Pages, Numbers, Keynote) file.
|
||||
|
||||
Args:
|
||||
@@ -1192,7 +1215,7 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _model_stl_thumb(filepath: Path, size: int) -> Image.Image:
|
||||
def _model_stl_thumb(filepath: Path, size: int) -> Image.Image | None:
|
||||
"""Render a thumbnail for an STL file.
|
||||
|
||||
Args:
|
||||
@@ -1203,7 +1226,7 @@ class ThumbRenderer(QObject):
|
||||
# The following commented code describes a method for rendering via
|
||||
# matplotlib.
|
||||
# This implementation did not play nice with multithreading.
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
# # Create a new plot
|
||||
# matplotlib.use('agg')
|
||||
# figure = plt.figure()
|
||||
@@ -1225,13 +1248,13 @@ class ThumbRenderer(QObject):
|
||||
return im
|
||||
|
||||
@staticmethod
|
||||
def _pdf_thumb(filepath: Path, size: int) -> Image.Image:
|
||||
def _pdf_thumb(filepath: Path, size: int) -> Image.Image | None:
|
||||
"""Render a thumbnail for a PDF file.
|
||||
|
||||
filepath (Path): The path of the file.
|
||||
size (int): The size of the icon.
|
||||
"""
|
||||
im: Image.Image = None
|
||||
im: Image.Image | None = None
|
||||
|
||||
file: QFile = QFile(filepath)
|
||||
success: bool = file.open(
|
||||
@@ -1509,7 +1532,7 @@ class ThumbRenderer(QObject):
|
||||
image
|
||||
and Ignore.compiled_patterns
|
||||
and Ignore.compiled_patterns.match(
|
||||
filepath.relative_to(unwrap(self.lib.library_dir))
|
||||
filepath.relative_to(unwrap(self.driver.lib.library_dir))
|
||||
)
|
||||
):
|
||||
image = render_ignored((adj_size, adj_size), pixel_ratio, image)
|
||||
|
||||
392
src/tagstudio/qt/thumb_grid_layout.py
Normal file
392
src/tagstudio/qt/thumb_grid_layout.py
Normal file
@@ -0,0 +1,392 @@
|
||||
import math
|
||||
import time
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, override
|
||||
|
||||
from PySide6.QtCore import QPoint, QRect, QSize
|
||||
from PySide6.QtGui import QPixmap
|
||||
from PySide6.QtWidgets import QLayout, QLayoutItem, QScrollArea
|
||||
|
||||
from tagstudio.core.constants import TAG_ARCHIVED, TAG_FAVORITE
|
||||
from tagstudio.core.library.alchemy.enums import ItemType
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.item_thumb import BadgeType, ItemThumb
|
||||
from tagstudio.qt.previews.renderer import ThumbRenderer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
class ThumbGridLayout(QLayout):
|
||||
def __init__(self, driver: "QtDriver", scroll_area: QScrollArea) -> None:
|
||||
super().__init__(None)
|
||||
self.driver: QtDriver = driver
|
||||
self.scroll_area: QScrollArea = scroll_area
|
||||
|
||||
self._item_thumbs: list[ItemThumb] = []
|
||||
self._items: list[QLayoutItem] = []
|
||||
# Entry.id -> _entry_ids[index]
|
||||
self._selected: dict[int, int] = {}
|
||||
# _entry_ids[index]
|
||||
self._last_selected: int | None = None
|
||||
|
||||
self._entry_ids: list[int] = []
|
||||
self._entries: dict[int, Entry] = {}
|
||||
# Tag.id -> {Entry.id}
|
||||
self._tag_entries: dict[int, set[int]] = {}
|
||||
self._entry_paths: dict[Path, int] = {}
|
||||
# Entry.id -> _items[index]
|
||||
self._entry_items: dict[int, int] = {}
|
||||
|
||||
self._render_results: dict[Path, Any] = {}
|
||||
self._renderer: ThumbRenderer = ThumbRenderer(self.driver)
|
||||
self._renderer.updated.connect(self._on_rendered)
|
||||
self._render_cutoff: float = 0.0
|
||||
|
||||
# _entry_ids[StartIndex:EndIndex]
|
||||
self._last_page_update: tuple[int, int] | None = None
|
||||
|
||||
def set_entries(self, entry_ids: list[int]):
|
||||
self.scroll_area.verticalScrollBar().setValue(0)
|
||||
|
||||
self._selected.clear()
|
||||
self._last_selected = None
|
||||
|
||||
self._entry_ids = entry_ids
|
||||
self._entries.clear()
|
||||
self._tag_entries.clear()
|
||||
self._entry_paths.clear()
|
||||
|
||||
self._entry_items.clear()
|
||||
self._render_results.clear()
|
||||
self.driver.thumb_job_queue.queue.clear()
|
||||
self._render_cutoff = time.time()
|
||||
|
||||
base_size: tuple[int, int] = (
|
||||
self.driver.main_window.thumb_size,
|
||||
self.driver.main_window.thumb_size,
|
||||
)
|
||||
self.driver.thumb_job_queue.put(
|
||||
(
|
||||
self._renderer.render,
|
||||
(
|
||||
self._render_cutoff,
|
||||
Path(),
|
||||
base_size,
|
||||
self.driver.main_window.devicePixelRatio(),
|
||||
True,
|
||||
True,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
self._last_page_update = None
|
||||
|
||||
def select_all(self):
|
||||
self._selected.clear()
|
||||
for index, id in enumerate(self._entry_ids):
|
||||
self._selected[id] = index
|
||||
self._last_selected = index
|
||||
|
||||
for entry_id in self._entry_items:
|
||||
self._set_selected(entry_id)
|
||||
|
||||
def select_inverse(self):
|
||||
selected = {}
|
||||
for index, id in enumerate(self._entry_ids):
|
||||
if id not in self._selected:
|
||||
selected[id] = index
|
||||
self._last_selected = index
|
||||
|
||||
for id in self._selected:
|
||||
if id not in selected:
|
||||
self._set_selected(id, value=False)
|
||||
for id in selected:
|
||||
self._set_selected(id)
|
||||
|
||||
self._selected = selected
|
||||
|
||||
def select_entry(self, entry_id: int):
|
||||
if entry_id in self._selected:
|
||||
index = self._selected.pop(entry_id)
|
||||
if index == self._last_selected:
|
||||
self._last_selected = None
|
||||
self._set_selected(entry_id, value=False)
|
||||
else:
|
||||
try:
|
||||
index = self._entry_ids.index(entry_id)
|
||||
except ValueError:
|
||||
index = -1
|
||||
|
||||
self._selected[entry_id] = index
|
||||
self._last_selected = index
|
||||
self._set_selected(entry_id)
|
||||
|
||||
def select_to_entry(self, entry_id: int):
|
||||
index = self._entry_ids.index(entry_id)
|
||||
if len(self._selected) == 0:
|
||||
self.select_entry(entry_id)
|
||||
return
|
||||
if self._last_selected is None:
|
||||
self._last_selected = min(self._selected.values(), key=lambda i: abs(index - i))
|
||||
|
||||
start = self._last_selected
|
||||
self._last_selected = index
|
||||
|
||||
if start > index:
|
||||
index, start = start, index
|
||||
else:
|
||||
index += 1
|
||||
|
||||
for i in range(start, index):
|
||||
entry_id = self._entry_ids[i]
|
||||
self._selected[entry_id] = i
|
||||
self._set_selected(entry_id)
|
||||
|
||||
def clear_selected(self):
|
||||
for entry_id in self._entry_items:
|
||||
self._set_selected(entry_id, value=False)
|
||||
|
||||
self._selected.clear()
|
||||
self._last_selected = None
|
||||
|
||||
def _set_selected(self, entry_id: int, value: bool = True):
|
||||
if entry_id not in self._entry_items:
|
||||
return
|
||||
index = self._entry_items[entry_id]
|
||||
if index < len(self._item_thumbs):
|
||||
self._item_thumbs[index].thumb_button.set_selected(value)
|
||||
|
||||
def add_tags(self, entry_ids: list[int], tag_ids: list[int]):
|
||||
for tag_id in tag_ids:
|
||||
self._tag_entries.setdefault(tag_id, set()).update(entry_ids)
|
||||
|
||||
def remove_tags(self, entry_ids: list[int], tag_ids: list[int]):
|
||||
for tag_id in tag_ids:
|
||||
self._tag_entries.setdefault(tag_id, set()).difference_update(entry_ids)
|
||||
|
||||
def _fetch_entries(self, ids: list[int]):
|
||||
ids = [id for id in ids if id not in self._entries]
|
||||
entries = self.driver.lib.get_entries(ids)
|
||||
for entry in entries:
|
||||
self._entry_paths[unwrap(self.driver.lib.library_dir) / entry.path] = entry.id
|
||||
self._entries[entry.id] = entry
|
||||
|
||||
tag_ids = [TAG_ARCHIVED, TAG_FAVORITE]
|
||||
tag_entries = self.driver.lib.get_tag_entries(tag_ids, ids)
|
||||
for tag_id, entries in tag_entries.items():
|
||||
self._tag_entries.setdefault(tag_id, set()).update(entries)
|
||||
|
||||
def _on_rendered(self, timestamp: float, image: QPixmap, size: QSize, file_path: Path):
|
||||
if timestamp < self._render_cutoff:
|
||||
return
|
||||
self._render_results[file_path] = (timestamp, image, size, file_path)
|
||||
|
||||
# If this is the loading image update all item_thumbs with pending thumbnails
|
||||
if file_path == Path():
|
||||
for path, entry_id in self._entry_paths.items():
|
||||
if self._render_results.get(path, None) is None:
|
||||
self._update_thumb(entry_id, image, size, file_path)
|
||||
return
|
||||
|
||||
if file_path not in self._entry_paths:
|
||||
return
|
||||
entry_id = self._entry_paths[file_path]
|
||||
self._update_thumb(entry_id, image, size, file_path)
|
||||
|
||||
def _update_thumb(self, entry_id: int, image: QPixmap, size: QSize, file_path: Path):
|
||||
index = self._entry_items.get(entry_id)
|
||||
if index is None:
|
||||
return
|
||||
item_thumb = self._item_thumbs[index]
|
||||
item_thumb.update_thumb(image, file_path)
|
||||
item_thumb.update_size(size)
|
||||
item_thumb.set_filename_text(file_path)
|
||||
item_thumb.set_extension(file_path)
|
||||
|
||||
def _item_thumb(self, index: int) -> ItemThumb:
|
||||
if w := getattr(self.driver, "main_window", None):
|
||||
base_size = (w.thumb_size, w.thumb_size)
|
||||
else:
|
||||
base_size = (128, 128)
|
||||
while index >= len(self._item_thumbs):
|
||||
show_filename = self.driver.settings.show_filenames_in_grid
|
||||
item = ItemThumb(
|
||||
ItemType.ENTRY,
|
||||
self.driver.lib,
|
||||
self.driver,
|
||||
base_size,
|
||||
show_filename_label=show_filename,
|
||||
)
|
||||
self._item_thumbs.append(item)
|
||||
self.addWidget(item)
|
||||
return self._item_thumbs[index]
|
||||
|
||||
def _size(self, width: int) -> tuple[int, int, int]:
|
||||
if len(self._entry_ids) == 0:
|
||||
return 0, 0, 0
|
||||
spacing = self.spacing()
|
||||
|
||||
_item_thumb = self._item_thumb(0)
|
||||
item = self._items[0]
|
||||
item_size = item.sizeHint()
|
||||
item_width = item_size.width()
|
||||
item_height = item_size.height()
|
||||
|
||||
width_offset = item_width + spacing
|
||||
height_offset = item_height + spacing
|
||||
|
||||
if width_offset == 0:
|
||||
return 0, 0, height_offset
|
||||
per_row = int(width / width_offset)
|
||||
|
||||
return per_row, width_offset, height_offset
|
||||
|
||||
@override
|
||||
def heightForWidth(self, arg__1: int) -> int:
|
||||
width = arg__1
|
||||
per_row, _, height_offset = self._size(width)
|
||||
if per_row == 0:
|
||||
return height_offset
|
||||
return math.ceil(len(self._entry_ids) / per_row) * height_offset
|
||||
|
||||
@override
|
||||
def setGeometry(self, arg__1: QRect) -> None:
|
||||
super().setGeometry(arg__1)
|
||||
rect = arg__1
|
||||
if len(self._entry_ids) == 0:
|
||||
for item in self._item_thumbs:
|
||||
item.setGeometry(32_000, 32_000, 0, 0)
|
||||
return
|
||||
|
||||
per_row, width_offset, height_offset = self._size(rect.right())
|
||||
view_height = self.parentWidget().parentWidget().height()
|
||||
offset = self.scroll_area.verticalScrollBar().value()
|
||||
|
||||
visible_rows = math.ceil((view_height + (offset % height_offset)) / height_offset)
|
||||
offset = int(offset / height_offset)
|
||||
start = offset * per_row
|
||||
end = start + (visible_rows * per_row)
|
||||
|
||||
# Load closest off screen rows
|
||||
start -= per_row * 3
|
||||
end += per_row * 3
|
||||
|
||||
start = max(0, start)
|
||||
end = min(len(self._entry_ids), end)
|
||||
if (start, end) == self._last_page_update:
|
||||
return
|
||||
self._last_page_update = (start, end)
|
||||
|
||||
# Clear render queue if len > 2 pages
|
||||
if len(self.driver.thumb_job_queue.queue) > (per_row * visible_rows * 2):
|
||||
self.driver.thumb_job_queue.queue.clear()
|
||||
pending = []
|
||||
for k, v in self._render_results.items():
|
||||
if v is None and k != Path():
|
||||
pending.append(k)
|
||||
for k in pending:
|
||||
self._render_results.pop(k)
|
||||
|
||||
# Reorder items so previously rendered rows will reuse same item_thumbs
|
||||
# When scrolling down top row gets moved to end of list
|
||||
_ = self._item_thumb(end - start - 1)
|
||||
for item_index, i in enumerate(range(start, end)):
|
||||
if i >= len(self._entry_ids):
|
||||
continue
|
||||
entry_id = self._entry_ids[i]
|
||||
if entry_id not in self._entry_items:
|
||||
continue
|
||||
prev_item_index = self._entry_items[entry_id]
|
||||
if item_index == prev_item_index:
|
||||
break
|
||||
diff = prev_item_index - item_index
|
||||
self._items = self._items[diff:] + self._items[:diff]
|
||||
self._item_thumbs = self._item_thumbs[diff:] + self._item_thumbs[:diff]
|
||||
break
|
||||
self._entry_items.clear()
|
||||
|
||||
# Move unused item_thumbs off screen
|
||||
count = end - start
|
||||
for item in self._item_thumbs[count:]:
|
||||
item.setGeometry(32_000, 32_000, 0, 0)
|
||||
|
||||
ratio = self.driver.main_window.devicePixelRatio()
|
||||
base_size: tuple[int, int] = (
|
||||
self.driver.main_window.thumb_size,
|
||||
self.driver.main_window.thumb_size,
|
||||
)
|
||||
timestamp = time.time()
|
||||
for item_index, i in enumerate(range(start, end)):
|
||||
entry_id = self._entry_ids[i]
|
||||
if entry_id not in self._entries:
|
||||
ids = self._entry_ids[start:end]
|
||||
self._fetch_entries(ids)
|
||||
|
||||
entry = self._entries[entry_id]
|
||||
row = int(i / per_row)
|
||||
self._entry_items[entry_id] = item_index
|
||||
item_thumb = self._item_thumb(item_index)
|
||||
item = self._items[item_index]
|
||||
col = i % per_row
|
||||
item_x = width_offset * col
|
||||
item_y = height_offset * row
|
||||
item_thumb.setGeometry(QRect(QPoint(item_x, item_y), item.sizeHint()))
|
||||
file_path = unwrap(self.driver.lib.library_dir) / entry.path
|
||||
item_thumb.set_item(entry)
|
||||
|
||||
if result := self._render_results.get(file_path):
|
||||
_t, im, s, p = result
|
||||
if item_thumb.rendered_path == p:
|
||||
continue
|
||||
self._update_thumb(entry_id, im, s, p)
|
||||
else:
|
||||
if Path() in self._render_results:
|
||||
_t, im, s, p = self._render_results[Path()]
|
||||
self._update_thumb(entry_id, im, s, p)
|
||||
|
||||
if file_path not in self._render_results:
|
||||
self._render_results[file_path] = None
|
||||
self.driver.thumb_job_queue.put(
|
||||
(
|
||||
self._renderer.render,
|
||||
(timestamp, file_path, base_size, ratio, False, True),
|
||||
)
|
||||
)
|
||||
|
||||
# set_selected causes stutters making thumbs after selected not show for a frame
|
||||
# setting it after positioning thumbs fixes this
|
||||
for i in range(start, end):
|
||||
if i >= len(self._entry_ids):
|
||||
continue
|
||||
entry_id = self._entry_ids[i]
|
||||
item_index = self._entry_items[entry_id]
|
||||
item_thumb = self._item_thumbs[item_index]
|
||||
item_thumb.thumb_button.set_selected(entry_id in self._selected)
|
||||
|
||||
item_thumb.assign_badge(BadgeType.ARCHIVED, entry_id in self._tag_entries[TAG_ARCHIVED])
|
||||
item_thumb.assign_badge(BadgeType.FAVORITE, entry_id in self._tag_entries[TAG_FAVORITE])
|
||||
|
||||
@override
|
||||
def addItem(self, arg__1: QLayoutItem) -> None:
|
||||
self._items.append(arg__1)
|
||||
|
||||
@override
|
||||
def count(self) -> int:
|
||||
return len(self._entries)
|
||||
|
||||
@override
|
||||
def hasHeightForWidth(self) -> bool:
|
||||
return True
|
||||
|
||||
@override
|
||||
def itemAt(self, index: int) -> QLayoutItem:
|
||||
if index >= len(self._items):
|
||||
return None
|
||||
return self._items[index]
|
||||
|
||||
@override
|
||||
def sizeHint(self) -> QSize:
|
||||
self._item_thumb(0)
|
||||
return self._items[0].minimumSize()
|
||||
@@ -21,12 +21,14 @@ from pathlib import Path
|
||||
from queue import Queue
|
||||
from shutil import which
|
||||
from typing import Generic, TypeVar
|
||||
from unittest.mock import Mock
|
||||
from warnings import catch_warnings
|
||||
|
||||
import structlog
|
||||
from humanfriendly import format_size, format_timespan
|
||||
from PySide6.QtCore import QObject, QSettings, Qt, QThread, QThreadPool, QTimer, Signal
|
||||
from PySide6.QtGui import (
|
||||
QAction,
|
||||
QColor,
|
||||
QDragEnterEvent,
|
||||
QDragMoveEvent,
|
||||
@@ -45,30 +47,37 @@ from PySide6.QtWidgets import (
|
||||
QScrollArea,
|
||||
)
|
||||
|
||||
import tagstudio.qt.resources_rc # noqa: F401
|
||||
from tagstudio.core.constants import TAG_ARCHIVED, TAG_FAVORITE, VERSION, VERSION_BRANCH
|
||||
# This import has side-effect of import PySide resources
|
||||
import tagstudio.qt.resources_rc # noqa: F401 # pyright: ignore [reportUnusedImport]
|
||||
from tagstudio.core.constants import (
|
||||
MACROS_FOLDER_NAME,
|
||||
TAG_ARCHIVED,
|
||||
TAG_FAVORITE,
|
||||
TS_FOLDER_NAME,
|
||||
VERSION,
|
||||
VERSION_BRANCH,
|
||||
)
|
||||
from tagstudio.core.driver import DriverMixin
|
||||
from tagstudio.core.enums import MacroID, SettingItems, ShowFilepathOption
|
||||
from tagstudio.core.enums import SettingItems, ShowFilepathOption
|
||||
from tagstudio.core.library.alchemy.enums import (
|
||||
BrowsingState,
|
||||
FieldTypeEnum,
|
||||
ItemType,
|
||||
SortingModeEnum,
|
||||
)
|
||||
from tagstudio.core.library.alchemy.fields import FieldID
|
||||
from tagstudio.core.library.alchemy.library import Library, LibraryStatus
|
||||
from tagstudio.core.library.alchemy.models import Entry
|
||||
from tagstudio.core.library.ignore import Ignore
|
||||
from tagstudio.core.library.refresh import RefreshTracker
|
||||
from tagstudio.core.macro_parser import (
|
||||
Instruction,
|
||||
exec_instructions,
|
||||
get_macro_name,
|
||||
parse_macro_file,
|
||||
)
|
||||
from tagstudio.core.media_types import MediaCategories
|
||||
from tagstudio.core.query_lang.util import ParsingError
|
||||
from tagstudio.core.ts_core import TagStudioCore
|
||||
from tagstudio.core.utils.str_formatting import strip_web_protocol
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.cache_manager import CacheManager
|
||||
from tagstudio.qt.controllers.ffmpeg_missing_message_box import FfmpegMissingMessageBox
|
||||
|
||||
# this import has side-effect of import PySide resources
|
||||
from tagstudio.qt.controllers.fix_ignored_modal_controller import FixIgnoredEntriesModal
|
||||
from tagstudio.qt.controllers.ignore_modal_controller import IgnoreModal
|
||||
from tagstudio.qt.controllers.library_info_window_controller import LibraryInfoWindow
|
||||
@@ -83,7 +92,7 @@ from tagstudio.qt.mixed.drop_import_modal import DropImportModal
|
||||
from tagstudio.qt.mixed.fix_dupe_files import FixDupeFilesModal
|
||||
from tagstudio.qt.mixed.fix_unlinked import FixUnlinkedEntriesModal
|
||||
from tagstudio.qt.mixed.folders_to_tags import FoldersToTagsModal
|
||||
from tagstudio.qt.mixed.item_thumb import BadgeType, ItemThumb
|
||||
from tagstudio.qt.mixed.item_thumb import BadgeType
|
||||
from tagstudio.qt.mixed.migration_modal import JsonMigrationModal
|
||||
from tagstudio.qt.mixed.progress_bar import ProgressWidget
|
||||
from tagstudio.qt.mixed.settings_panel import SettingsPanel
|
||||
@@ -92,12 +101,12 @@ from tagstudio.qt.mixed.tag_database import TagDatabasePanel
|
||||
from tagstudio.qt.mixed.tag_search import TagSearchModal
|
||||
from tagstudio.qt.models.palette import ColorType, UiColor, get_ui_color
|
||||
from tagstudio.qt.platform_strings import trash_term
|
||||
from tagstudio.qt.previews.renderer import ThumbRenderer
|
||||
from tagstudio.qt.previews.vendored.ffmpeg import FFMPEG_CMD, FFPROBE_CMD
|
||||
from tagstudio.qt.resource_manager import ResourceManager
|
||||
from tagstudio.qt.translations import Translations
|
||||
from tagstudio.qt.utils.custom_runnable import CustomRunnable
|
||||
from tagstudio.qt.utils.file_deleter import delete_file
|
||||
from tagstudio.qt.utils.file_opener import open_file
|
||||
from tagstudio.qt.utils.function_iterator import FunctionIterator
|
||||
from tagstudio.qt.views.main_window import MainWindow
|
||||
from tagstudio.qt.views.panel_modal import PanelModal
|
||||
@@ -216,8 +225,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
# self.buffer = {}
|
||||
self.thumb_job_queue: Queue = Queue()
|
||||
self.thumb_threads: list[Consumer] = []
|
||||
self.thumb_cutoff: float = time.time()
|
||||
self.selected: list[int] = [] # Selected Entry IDs
|
||||
|
||||
self.SIGTERM.connect(self.handle_sigterm)
|
||||
|
||||
@@ -256,6 +263,10 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
Translations.change_language(self.settings.language)
|
||||
|
||||
@property
|
||||
def selected(self) -> list[int]:
|
||||
return list(self.main_window.thumb_layout._selected.keys())
|
||||
|
||||
def __reset_navigation(self) -> None:
|
||||
self.browsing_history = History(BrowsingState.show_all())
|
||||
|
||||
@@ -308,10 +319,20 @@ class QtDriver(DriverMixin, QObject):
|
||||
pal: QPalette = self.app.palette()
|
||||
pal.setColor(QPalette.ColorGroup.Normal, QPalette.ColorRole.Window, QColor("#1e1e1e"))
|
||||
pal.setColor(QPalette.ColorGroup.Normal, QPalette.ColorRole.Button, QColor("#1e1e1e"))
|
||||
pal.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Window, QColor("#232323"))
|
||||
pal.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Button, QColor("#232323"))
|
||||
pal.setColor(
|
||||
QPalette.ColorGroup.Inactive, QPalette.ColorRole.ButtonText, QColor("#666666")
|
||||
QPalette.ColorGroup.Inactive,
|
||||
QPalette.ColorRole.Window,
|
||||
QColor("#232323"),
|
||||
)
|
||||
pal.setColor(
|
||||
QPalette.ColorGroup.Inactive,
|
||||
QPalette.ColorRole.Button,
|
||||
QColor("#232323"),
|
||||
)
|
||||
pal.setColor(
|
||||
QPalette.ColorGroup.Inactive,
|
||||
QPalette.ColorRole.ButtonText,
|
||||
QColor("#666666"),
|
||||
)
|
||||
|
||||
self.app.setPalette(pal)
|
||||
@@ -534,6 +555,8 @@ class QtDriver(DriverMixin, QObject):
|
||||
# endregion
|
||||
|
||||
# region Macros Menu ==========================================================
|
||||
self.main_window.menu_bar.macros_menu.aboutToShow.connect(self.update_macros_menu)
|
||||
|
||||
def create_folders_tags_modal():
|
||||
if not hasattr(self, "folders_modal"):
|
||||
self.folders_modal = FoldersToTagsModal(self.lib, self)
|
||||
@@ -555,8 +578,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
# endregion
|
||||
|
||||
# endregion
|
||||
|
||||
self.main_window.search_field.textChanged.connect(self.update_completions_list)
|
||||
|
||||
self.main_window.preview_panel.field_containers_widget.archived_updated.connect(
|
||||
@@ -574,8 +595,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
str(Path(__file__).parents[1] / "resources/qt/fonts/Oxanium-Bold.ttf")
|
||||
)
|
||||
|
||||
self.item_thumbs: list[ItemThumb] = []
|
||||
self.thumb_renderers: list[ThumbRenderer] = []
|
||||
self.init_library_window()
|
||||
self.migration_modal: JsonMigrationModal = None
|
||||
|
||||
@@ -656,7 +675,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.main_window.thumb_size_combobox.currentIndexChanged.connect(
|
||||
lambda: self.thumb_size_callback(self.main_window.thumb_size_combobox.currentIndex())
|
||||
)
|
||||
self._update_thumb_count()
|
||||
|
||||
self.main_window.back_button.clicked.connect(lambda: self.navigation_callback(-1))
|
||||
self.main_window.forward_button.clicked.connect(lambda: self.navigation_callback(1))
|
||||
@@ -691,7 +709,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.main_window.menu_bar.ignore_modal_action.triggered.connect(self.ignore_modal.show)
|
||||
|
||||
def show_grid_filenames(self, value: bool):
|
||||
for thumb in self.item_thumbs:
|
||||
for thumb in self.main_window.thumb_layout._item_thumbs:
|
||||
thumb.set_filename_visibility(value)
|
||||
|
||||
def call_if_library_open(self, func):
|
||||
@@ -745,18 +763,18 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
self.main_window.setWindowTitle(self.base_title)
|
||||
|
||||
self.selected.clear()
|
||||
self.frame_content.clear()
|
||||
[x.set_mode(None) for x in self.item_thumbs]
|
||||
if self.color_manager_panel:
|
||||
self.color_manager_panel.reset()
|
||||
|
||||
self.set_clipboard_menu_viability()
|
||||
self.set_select_actions_visibility()
|
||||
self.update_macros_menu(clear=True)
|
||||
|
||||
if hasattr(self, "library_info_window"):
|
||||
self.library_info_window.close()
|
||||
|
||||
self.main_window.thumb_layout.set_entries([])
|
||||
self.main_window.preview_panel.set_selection(self.selected)
|
||||
self.main_window.toggle_landing_page(enabled=True)
|
||||
self.main_window.pagination.setHidden(True)
|
||||
@@ -786,7 +804,8 @@ class QtDriver(DriverMixin, QObject):
|
||||
end_time = time.time()
|
||||
self.main_window.status_bar.showMessage(
|
||||
Translations.format(
|
||||
"status.library_closed", time_span=format_timespan(end_time - start_time)
|
||||
"status.library_closed",
|
||||
time_span=format_timespan(end_time - start_time),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -828,11 +847,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
def select_all_action_callback(self):
|
||||
"""Set the selection to all visible items."""
|
||||
self.selected.clear()
|
||||
for item in self.item_thumbs:
|
||||
if item.mode and item.item_id not in self.selected and not item.isHidden():
|
||||
self.selected.append(item.item_id)
|
||||
item.thumb_button.set_selected(True)
|
||||
self.main_window.thumb_layout.select_all()
|
||||
|
||||
self.set_clipboard_menu_viability()
|
||||
self.set_select_actions_visibility()
|
||||
@@ -841,17 +856,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
def select_inverse_action_callback(self):
|
||||
"""Invert the selection of all visible items."""
|
||||
new_selected = []
|
||||
|
||||
for item in self.item_thumbs:
|
||||
if item.mode and not item.isHidden():
|
||||
if item.item_id in self.selected:
|
||||
item.thumb_button.set_selected(False)
|
||||
else:
|
||||
item.thumb_button.set_selected(True)
|
||||
new_selected.append(item.item_id)
|
||||
|
||||
self.selected = new_selected
|
||||
self.main_window.thumb_layout.select_inverse()
|
||||
|
||||
self.set_clipboard_menu_viability()
|
||||
self.set_select_actions_visibility()
|
||||
@@ -859,16 +864,16 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.main_window.preview_panel.set_selection(self.selected, update_preview=False)
|
||||
|
||||
def clear_select_action_callback(self):
|
||||
self.selected.clear()
|
||||
self.set_select_actions_visibility()
|
||||
for item in self.item_thumbs:
|
||||
item.thumb_button.set_selected(False)
|
||||
self.main_window.thumb_layout.clear_selected()
|
||||
|
||||
self.set_select_actions_visibility()
|
||||
self.set_clipboard_menu_viability()
|
||||
self.main_window.preview_panel.set_selection(self.selected)
|
||||
|
||||
def add_tags_to_selected_callback(self, tag_ids: list[int]):
|
||||
self.lib.add_tags_to_entries(self.selected, tag_ids)
|
||||
selected = self.selected
|
||||
self.main_window.thumb_layout.add_tags(selected, tag_ids)
|
||||
self.lib.add_tags_to_entries(selected, tag_ids)
|
||||
|
||||
def delete_files_callback(self, origin_path: str | Path, origin_id: int | None = None):
|
||||
"""Callback to send on or more files to the system trash.
|
||||
@@ -887,15 +892,17 @@ class QtDriver(DriverMixin, QObject):
|
||||
pending: list[tuple[int, Path]] = []
|
||||
deleted_count: int = 0
|
||||
|
||||
if len(self.selected) <= 1 and origin_path:
|
||||
selected = self.selected
|
||||
|
||||
if len(selected) <= 1 and origin_path:
|
||||
origin_id_ = origin_id
|
||||
if not origin_id_:
|
||||
with contextlib.suppress(IndexError):
|
||||
origin_id_ = self.selected[0]
|
||||
origin_id_ = selected[0]
|
||||
|
||||
pending.append((origin_id_, Path(origin_path)))
|
||||
elif (len(self.selected) > 1) or (len(self.selected) <= 1):
|
||||
for item in self.selected:
|
||||
elif (len(selected) > 1) or (len(selected) <= 1):
|
||||
for item in selected:
|
||||
entry = self.lib.get_entry(item)
|
||||
filepath: Path = entry.path
|
||||
pending.append((item, filepath))
|
||||
@@ -921,25 +928,26 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.lib.remove_entries([e_id])
|
||||
|
||||
deleted_count += 1
|
||||
self.selected.clear()
|
||||
selected.clear()
|
||||
self.clear_select_action_callback()
|
||||
|
||||
if deleted_count > 0:
|
||||
self.update_browsing_state()
|
||||
self.main_window.preview_panel.set_selection(self.selected)
|
||||
self.main_window.preview_panel.set_selection(selected)
|
||||
|
||||
if len(self.selected) <= 1 and deleted_count == 0:
|
||||
if len(selected) <= 1 and deleted_count == 0:
|
||||
self.main_window.status_bar.showMessage(Translations["status.deleted_none"])
|
||||
elif len(self.selected) <= 1 and deleted_count == 1:
|
||||
elif len(selected) <= 1 and deleted_count == 1:
|
||||
self.main_window.status_bar.showMessage(
|
||||
Translations.format("status.deleted_file_plural", count=deleted_count)
|
||||
)
|
||||
elif len(self.selected) > 1 and deleted_count == 0:
|
||||
elif len(selected) > 1 and deleted_count == 0:
|
||||
self.main_window.status_bar.showMessage(Translations["status.deleted_none"])
|
||||
elif len(self.selected) > 1 and deleted_count < len(self.selected):
|
||||
elif len(selected) > 1 and deleted_count < len(selected):
|
||||
self.main_window.status_bar.showMessage(
|
||||
Translations.format("status.deleted_partial_warning", count=deleted_count)
|
||||
)
|
||||
elif len(self.selected) > 1 and deleted_count == len(self.selected):
|
||||
elif len(selected) > 1 and deleted_count == len(selected):
|
||||
self.main_window.status_bar.showMessage(
|
||||
Translations.format("status.deleted_file_plural", count=deleted_count)
|
||||
)
|
||||
@@ -1090,56 +1098,42 @@ class QtDriver(DriverMixin, QObject):
|
||||
# # self.run_macro('autofill', id)
|
||||
yield 0
|
||||
|
||||
def run_macros(self, name: MacroID, entry_ids: list[int]):
|
||||
"""Run a specific Macro on a group of given entry_ids."""
|
||||
def run_macros(self, macro_name: str, entry_ids: list[int]):
|
||||
"""Run a Macro on a list of entires."""
|
||||
for entry_id in entry_ids:
|
||||
self.run_macro(name, entry_id)
|
||||
self.run_macro(macro_name, entry_id)
|
||||
self.main_window.preview_panel.refresh_selection(update_preview=False)
|
||||
|
||||
def run_macro(self, macro_name: str, entry_id: int):
|
||||
"""Run a Macro on a single entry."""
|
||||
if not self.lib.library_dir:
|
||||
logger.error("[QtDriver] Can't run macro when no library is open!")
|
||||
return
|
||||
|
||||
entry: Entry | None = self.lib.get_entry(entry_id)
|
||||
if not entry:
|
||||
logger.error(f"[QtDriver] No Entry given ID {entry_id}!")
|
||||
return
|
||||
|
||||
def run_macro(self, name: MacroID, entry_id: int):
|
||||
"""Run a specific Macro on an Entry given a Macro name."""
|
||||
entry: Entry = self.lib.get_entry(entry_id)
|
||||
full_path = self.lib.library_dir / entry.path
|
||||
source = "" if entry.path.parent == Path(".") else entry.path.parts[0].lower()
|
||||
# macro_path = Path(
|
||||
# self.lib.library_dir / TS_FOLDER_NAME / MACROS_FOLDER_NAME / f"{macro_name}.toml"
|
||||
# )
|
||||
macro_path = Path(self.lib.library_dir / TS_FOLDER_NAME / MACROS_FOLDER_NAME / macro_name)
|
||||
|
||||
logger.info(
|
||||
"running macro",
|
||||
source=source,
|
||||
macro=name,
|
||||
"[QtDriver] Running Macro",
|
||||
macro_path=macro_name,
|
||||
entry_id=entry.id,
|
||||
grid_idx=entry_id,
|
||||
)
|
||||
|
||||
if name == MacroID.AUTOFILL:
|
||||
for macro_id in MacroID:
|
||||
if macro_id == MacroID.AUTOFILL:
|
||||
continue
|
||||
self.run_macro(macro_id, entry_id)
|
||||
results: list[Instruction] = parse_macro_file(macro_path, full_path)
|
||||
exec_instructions(self.lib, entry_id, results)
|
||||
|
||||
elif name == MacroID.SIDECAR:
|
||||
parsed_items = TagStudioCore.get_gdl_sidecar(full_path, source)
|
||||
for field_id, value in parsed_items.items():
|
||||
if isinstance(value, list) and len(value) > 0 and isinstance(value[0], str):
|
||||
value = self.lib.tag_from_strings(value)
|
||||
self.lib.add_field_to_entry(
|
||||
entry.id,
|
||||
field_id=field_id,
|
||||
value=value,
|
||||
)
|
||||
|
||||
elif name == MacroID.BUILD_URL:
|
||||
url = TagStudioCore.build_url(entry, source)
|
||||
if url is not None:
|
||||
self.lib.add_field_to_entry(entry.id, field_id=FieldID.SOURCE, value=url)
|
||||
elif name == MacroID.MATCH:
|
||||
TagStudioCore.match_conditions(self.lib, entry.id)
|
||||
elif name == MacroID.CLEAN_URL:
|
||||
for field in entry.text_fields:
|
||||
if field.type.type == FieldTypeEnum.TEXT_LINE and field.value:
|
||||
self.lib.update_entry_field(
|
||||
entry_ids=entry.id,
|
||||
field=field,
|
||||
content=strip_web_protocol(field.value),
|
||||
)
|
||||
@property
|
||||
def sorting_direction(self) -> bool:
|
||||
"""Whether to Sort the results in ascending order."""
|
||||
return self.main_window.sorting_direction_combobox.currentData()
|
||||
|
||||
def sorting_direction_callback(self):
|
||||
logger.info("Sorting Direction Changed", ascending=self.main_window.sorting_direction)
|
||||
@@ -1160,7 +1154,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
self.update_thumbs()
|
||||
blank_icon: QIcon = QIcon()
|
||||
for it in self.item_thumbs:
|
||||
for it in self.main_window.thumb_layout._item_thumbs:
|
||||
it.thumb_button.setIcon(blank_icon)
|
||||
it.resize(self.main_window.thumb_size, self.main_window.thumb_size)
|
||||
it.thumb_size = (self.main_window.thumb_size, self.main_window.thumb_size)
|
||||
@@ -1204,25 +1198,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
self.update_browsing_state()
|
||||
|
||||
def remove_grid_item(self, grid_idx: int):
|
||||
self.frame_content[grid_idx] = None
|
||||
self.item_thumbs[grid_idx].hide()
|
||||
|
||||
def _update_thumb_count(self):
|
||||
missing_count = max(0, self.settings.page_size - len(self.item_thumbs))
|
||||
layout = self.main_window.thumb_layout
|
||||
for _ in range(missing_count):
|
||||
item_thumb = ItemThumb(
|
||||
None,
|
||||
self.lib,
|
||||
self,
|
||||
(self.main_window.thumb_size, self.main_window.thumb_size),
|
||||
self.settings.show_filenames_in_grid,
|
||||
)
|
||||
|
||||
layout.addWidget(item_thumb)
|
||||
self.item_thumbs.append(item_thumb)
|
||||
|
||||
def copy_fields_action_callback(self):
|
||||
if len(self.selected) > 0:
|
||||
entry = self.lib.get_entry_full(self.selected[0])
|
||||
@@ -1269,64 +1244,25 @@ class QtDriver(DriverMixin, QObject):
|
||||
Setting to True acts like "Shift + Click" selecting.
|
||||
"""
|
||||
logger.info("[QtDriver] Selecting Items:", item_id=item_id, append=append, bridge=bridge)
|
||||
|
||||
if append:
|
||||
if item_id not in self.selected:
|
||||
self.selected.append(item_id)
|
||||
for it in self.item_thumbs:
|
||||
if it.item_id == item_id:
|
||||
it.thumb_button.set_selected(True)
|
||||
else:
|
||||
self.selected.remove(item_id)
|
||||
for it in self.item_thumbs:
|
||||
if it.item_id == item_id:
|
||||
it.thumb_button.set_selected(False)
|
||||
|
||||
# TODO: Allow bridge selecting across pages.
|
||||
elif bridge and self.selected:
|
||||
last_index = -1
|
||||
current_index = -1
|
||||
try:
|
||||
contents = self.frame_content
|
||||
last_index = self.frame_content.index(self.selected[-1])
|
||||
current_index = self.frame_content.index(item_id)
|
||||
index_range: list = contents[
|
||||
min(last_index, current_index) : max(last_index, current_index) + 1
|
||||
]
|
||||
|
||||
# Preserve bridge direction for correct appending order.
|
||||
if last_index < current_index:
|
||||
index_range.reverse()
|
||||
for entry_id in index_range:
|
||||
for it in self.item_thumbs:
|
||||
if it.item_id == entry_id:
|
||||
it.thumb_button.set_selected(True)
|
||||
if entry_id not in self.selected:
|
||||
self.selected.append(entry_id)
|
||||
except Exception as e:
|
||||
# TODO: Allow bridge selecting across pages.
|
||||
logger.error(
|
||||
"[QtDriver] Previous selected item not on current page!",
|
||||
error=e,
|
||||
item_id=item_id,
|
||||
current_index=current_index,
|
||||
last_index=last_index,
|
||||
)
|
||||
|
||||
self.main_window.thumb_layout.select_entry(item_id)
|
||||
elif bridge:
|
||||
self.main_window.thumb_layout.select_to_entry(item_id)
|
||||
else:
|
||||
self.selected.clear()
|
||||
self.selected.append(item_id)
|
||||
for it in self.item_thumbs:
|
||||
if it.item_id in self.selected:
|
||||
it.thumb_button.set_selected(True)
|
||||
else:
|
||||
it.thumb_button.set_selected(False)
|
||||
self.main_window.thumb_layout.clear_selected()
|
||||
self.main_window.thumb_layout.select_entry(item_id)
|
||||
|
||||
self.set_clipboard_menu_viability()
|
||||
self.set_select_actions_visibility()
|
||||
|
||||
self.main_window.preview_panel.set_selection(self.selected)
|
||||
|
||||
# TODO: Remove?
|
||||
def set_macro_menu_viability(self):
|
||||
# for action in self.macros_menu.actions():
|
||||
# action.setDisabled(not self.selected)
|
||||
pass
|
||||
|
||||
def set_clipboard_menu_viability(self):
|
||||
if len(self.selected) == 1:
|
||||
self.main_window.menu_bar.copy_fields_action.setEnabled(True)
|
||||
@@ -1359,7 +1295,8 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
def update_completions_list(self, text: str) -> None:
|
||||
matches = re.search(
|
||||
r"((?:.* )?)(mediatype|filetype|path|tag|tag_id):(\"?[A-Za-z0-9\ \t]+\"?)?", text
|
||||
r"((?:.* )?)(mediatype|filetype|path|tag|tag_id):(\"?[A-Za-z0-9\ \t]+\"?)?",
|
||||
text,
|
||||
)
|
||||
|
||||
completion_list: list[str] = []
|
||||
@@ -1429,86 +1366,16 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
def update_thumbs(self):
|
||||
"""Update search thumbnails."""
|
||||
self._update_thumb_count()
|
||||
with self.thumb_job_queue.mutex:
|
||||
# Cancels all thumb jobs waiting to be started
|
||||
self.thumb_job_queue.queue.clear()
|
||||
self.thumb_job_queue.all_tasks_done.notify_all()
|
||||
self.thumb_job_queue.not_full.notify_all()
|
||||
# Stops in-progress jobs from finishing
|
||||
ItemThumb.update_cutoff = time.time()
|
||||
|
||||
ratio: float = self.main_window.devicePixelRatio()
|
||||
base_size: tuple[int, int] = (self.main_window.thumb_size, self.main_window.thumb_size)
|
||||
|
||||
self.main_window.thumb_layout.set_entries(self.frame_content)
|
||||
self.main_window.thumb_layout.update()
|
||||
self.main_window.update()
|
||||
|
||||
is_grid_thumb = True
|
||||
logger.info("[QtDriver] Loading Entries...")
|
||||
# TODO: The full entries with joins don't need to be grabbed here.
|
||||
# Use a method that only selects the frame content but doesn't include the joins.
|
||||
entries = self.lib.get_entries(self.frame_content)
|
||||
tag_entries = self.lib.get_tag_entries([TAG_ARCHIVED, TAG_FAVORITE], self.frame_content)
|
||||
logger.info("[QtDriver] Building Filenames...")
|
||||
filenames: list[Path] = [self.lib.library_dir / e.path for e in entries]
|
||||
logger.info("[QtDriver] Done! Processing ItemThumbs...")
|
||||
for index, item_thumb in enumerate(self.item_thumbs, start=0):
|
||||
entry = None
|
||||
item_thumb.set_mode(None)
|
||||
|
||||
try:
|
||||
entry = entries[index]
|
||||
except IndexError:
|
||||
item_thumb.hide()
|
||||
continue
|
||||
if not entry:
|
||||
continue
|
||||
|
||||
with catch_warnings(record=True):
|
||||
item_thumb.delete_action.triggered.disconnect()
|
||||
|
||||
item_thumb.set_mode(ItemType.ENTRY)
|
||||
item_thumb.set_item_id(entry.id)
|
||||
item_thumb.show()
|
||||
is_loading = True
|
||||
self.thumb_job_queue.put(
|
||||
(
|
||||
item_thumb.renderer.render,
|
||||
(sys.float_info.max, "", base_size, ratio, is_loading, is_grid_thumb),
|
||||
)
|
||||
)
|
||||
|
||||
# Show rendered thumbnails
|
||||
for index, item_thumb in enumerate(self.item_thumbs, start=0):
|
||||
entry = None
|
||||
try:
|
||||
entry = entries[index]
|
||||
except IndexError:
|
||||
item_thumb.hide()
|
||||
continue
|
||||
if not entry:
|
||||
continue
|
||||
|
||||
is_loading = False
|
||||
self.thumb_job_queue.put(
|
||||
(
|
||||
item_thumb.renderer.render,
|
||||
(time.time(), filenames[index], base_size, ratio, is_loading, is_grid_thumb),
|
||||
)
|
||||
)
|
||||
item_thumb.assign_badge(BadgeType.ARCHIVED, entry.id in tag_entries[TAG_ARCHIVED])
|
||||
item_thumb.assign_badge(BadgeType.FAVORITE, entry.id in tag_entries[TAG_FAVORITE])
|
||||
item_thumb.delete_action.triggered.connect(
|
||||
lambda checked=False, f=filenames[index], e_id=entry.id: self.delete_files_callback(
|
||||
f, e_id
|
||||
)
|
||||
)
|
||||
|
||||
# Restore Selected Borders
|
||||
is_selected = item_thumb.item_id in self.selected
|
||||
item_thumb.thumb_button.set_selected(is_selected)
|
||||
|
||||
def update_badges(self, badge_values: dict[BadgeType, bool], origin_id: int, add_tags=True):
|
||||
"""Update the tag badges for item_thumbs.
|
||||
|
||||
@@ -1529,7 +1396,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
origin_id=origin_id,
|
||||
add_tags=add_tags,
|
||||
)
|
||||
for it in self.item_thumbs:
|
||||
for it in self.main_window.thumb_layout._item_thumbs:
|
||||
if it.item_id in item_ids:
|
||||
for badge_type, value in badge_values.items():
|
||||
if add_tags:
|
||||
@@ -1547,14 +1414,15 @@ class QtDriver(DriverMixin, QObject):
|
||||
pending_entries=pending_entries,
|
||||
)
|
||||
for badge_type, value in badge_values.items():
|
||||
entry_ids = pending_entries.get(badge_type, [])
|
||||
tag_ids = [BADGE_TAGS[badge_type]]
|
||||
|
||||
if value:
|
||||
self.lib.add_tags_to_entries(
|
||||
pending_entries.get(badge_type, []), BADGE_TAGS[badge_type]
|
||||
)
|
||||
self.main_window.thumb_layout.add_tags(entry_ids, tag_ids)
|
||||
self.lib.add_tags_to_entries(entry_ids, tag_ids)
|
||||
else:
|
||||
self.lib.remove_tags_from_entries(
|
||||
pending_entries.get(badge_type, []), BADGE_TAGS[badge_type]
|
||||
)
|
||||
self.main_window.thumb_layout.remove_tags(entry_ids, tag_ids)
|
||||
self.lib.remove_tags_from_entries(entry_ids, tag_ids)
|
||||
|
||||
def update_browsing_state(self, state: BrowsingState | None = None) -> None:
|
||||
"""Navigates to a new BrowsingState when state is given, otherwise updates the results."""
|
||||
@@ -1574,7 +1442,8 @@ class QtDriver(DriverMixin, QObject):
|
||||
# search the library
|
||||
start_time = time.time()
|
||||
Ignore.get_patterns(self.lib.library_dir, include_global=True)
|
||||
results = self.lib.search_library(self.browsing_history.current, self.settings.page_size)
|
||||
page_size = 0 if self.settings.infinite_scroll else self.settings.page_size
|
||||
results = self.lib.search_library(self.browsing_history.current, page_size)
|
||||
logger.info("items to render", count=len(results))
|
||||
end_time = time.time()
|
||||
|
||||
@@ -1592,7 +1461,10 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.update_thumbs()
|
||||
|
||||
# update pagination
|
||||
self.pages_count = math.ceil(results.total_count / self.settings.page_size)
|
||||
if page_size > 0:
|
||||
self.pages_count = math.ceil(results.total_count / page_size)
|
||||
else:
|
||||
self.pages_count = 1
|
||||
self.main_window.pagination.update_buttons(
|
||||
self.pages_count, self.browsing_history.current.page_index, emit=False
|
||||
)
|
||||
@@ -1663,6 +1535,53 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.cached_values.sync()
|
||||
self.update_recent_lib_menu()
|
||||
|
||||
def update_macros_menu(self, clear: bool = False):
|
||||
if not self.main_window.menu_bar.macros_menu or isinstance(
|
||||
self.main_window.menu_bar.macros_menu, Mock
|
||||
): # NOTE: Needed for tests?
|
||||
return
|
||||
|
||||
# Create actions for each macro
|
||||
actions: list[QAction] = []
|
||||
if self.lib.library_dir and not clear:
|
||||
macros_path = self.lib.library_dir / TS_FOLDER_NAME / MACROS_FOLDER_NAME
|
||||
for f in macros_path.glob("*"):
|
||||
logger.info(f)
|
||||
if f.suffix != ".toml" or f.is_dir() or f.name.startswith("._"):
|
||||
continue
|
||||
action = QAction(
|
||||
get_macro_name(f), self.main_window.menu_bar.macros_menu.parentWidget()
|
||||
)
|
||||
action.triggered.connect(
|
||||
lambda checked=False, name=f.name: (self.run_macros(name, self.selected)),
|
||||
)
|
||||
actions.append(action)
|
||||
|
||||
open_folder = QAction("Open Macros Folder...", self.main_window.menu_bar.macros_menu)
|
||||
open_folder.triggered.connect(self.open_macros_folder)
|
||||
actions.append(open_folder)
|
||||
|
||||
if clear:
|
||||
open_folder.setEnabled(False)
|
||||
|
||||
# Clear previous actions
|
||||
for action in self.main_window.menu_bar.macros_menu.actions():
|
||||
self.main_window.menu_bar.macros_menu.removeAction(action)
|
||||
|
||||
# Add new actions
|
||||
for action in actions:
|
||||
self.main_window.menu_bar.macros_menu.addAction(action)
|
||||
|
||||
self.main_window.menu_bar.macros_menu.addSeparator()
|
||||
self.main_window.menu_bar.macros_menu.addAction(open_folder)
|
||||
|
||||
def open_macros_folder(self):
|
||||
if not self.lib.library_dir:
|
||||
return
|
||||
path = self.lib.library_dir / TS_FOLDER_NAME / MACROS_FOLDER_NAME
|
||||
path.mkdir(exist_ok=True)
|
||||
open_file(path, file_manager=True, is_dir=True)
|
||||
|
||||
def open_settings_modal(self):
|
||||
SettingsPanel.build_modal(self).show()
|
||||
|
||||
@@ -1695,7 +1614,10 @@ class QtDriver(DriverMixin, QObject):
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
open_status = LibraryStatus(
|
||||
success=False, library_path=path, message=type(e).__name__, msg_description=str(e)
|
||||
success=False,
|
||||
library_path=path,
|
||||
message=type(e).__name__,
|
||||
msg_description=str(e),
|
||||
)
|
||||
self.cache_manager = CacheManager(
|
||||
path,
|
||||
@@ -1742,6 +1664,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
library_dir_display = self.lib.library_dir.name
|
||||
|
||||
self.update_libs_list(path)
|
||||
self.update_macros_menu()
|
||||
self.main_window.setWindowTitle(
|
||||
Translations.format(
|
||||
"app.title",
|
||||
@@ -1753,7 +1676,6 @@ class QtDriver(DriverMixin, QObject):
|
||||
|
||||
self.init_ignore_modal()
|
||||
|
||||
self.selected.clear()
|
||||
self.set_select_actions_visibility()
|
||||
self.main_window.menu_bar.save_library_backup_action.setEnabled(True)
|
||||
self.main_window.menu_bar.close_library_action.setEnabled(True)
|
||||
@@ -1769,7 +1691,7 @@ class QtDriver(DriverMixin, QObject):
|
||||
self.main_window.menu_bar.folders_to_tags_action.setEnabled(True)
|
||||
self.main_window.menu_bar.library_info_action.setEnabled(True)
|
||||
|
||||
self.main_window.preview_panel.set_selection(self.selected)
|
||||
self.main_window.preview_panel.set_selection()
|
||||
|
||||
# page (re)rendering, extract eventually
|
||||
initial_state = BrowsingState(
|
||||
|
||||
@@ -20,13 +20,19 @@ from tagstudio.core.utils.types import unwrap
|
||||
logger = structlog.get_logger(__name__)
|
||||
|
||||
|
||||
def open_file(path: str | Path, file_manager: bool = False, windows_start_command: bool = False):
|
||||
def open_file(
|
||||
path: str | Path,
|
||||
file_manager: bool = False,
|
||||
is_dir: bool = False,
|
||||
windows_start_command: bool = False,
|
||||
):
|
||||
"""Open a file in the default application or file explorer.
|
||||
|
||||
Args:
|
||||
path (str): The path to the file to open.
|
||||
file_manager (bool, optional): Whether to open the file in the file manager
|
||||
(e.g. Finder on macOS). Defaults to False.
|
||||
is_dir (bool): True if the path points towards a directory, false if a file.
|
||||
windows_start_command (bool): Flag to determine if the older 'start' command should be used
|
||||
on Windows for opening files. This fixes issues on some systems in niche cases.
|
||||
"""
|
||||
@@ -77,7 +83,7 @@ def open_file(path: str | Path, file_manager: bool = False, windows_start_comman
|
||||
if sys.platform == "darwin":
|
||||
command_name = "open"
|
||||
command_args = [str(path)]
|
||||
if file_manager:
|
||||
if file_manager and not is_dir:
|
||||
# will reveal in Finder
|
||||
command_args.append("-R")
|
||||
else:
|
||||
@@ -106,21 +112,21 @@ def open_file(path: str | Path, file_manager: bool = False, windows_start_comman
|
||||
|
||||
|
||||
class FileOpenerHelper:
|
||||
def __init__(self, filepath: str | Path):
|
||||
def __init__(self, filepath: Path):
|
||||
"""Initialize the FileOpenerHelper.
|
||||
|
||||
Args:
|
||||
filepath (str): The path to the file to open.
|
||||
filepath (Path): The path to the file to open.
|
||||
"""
|
||||
self.filepath = str(filepath)
|
||||
self.filepath = filepath
|
||||
|
||||
def set_filepath(self, filepath: str | Path):
|
||||
def set_filepath(self, filepath: Path):
|
||||
"""Set the filepath to open.
|
||||
|
||||
Args:
|
||||
filepath (str): The path to the file to open.
|
||||
filepath (Path): The path to the file to open.
|
||||
"""
|
||||
self.filepath = str(filepath)
|
||||
self.filepath = filepath
|
||||
|
||||
def open_file(self):
|
||||
"""Open the file in the default application."""
|
||||
@@ -140,15 +146,15 @@ class FileOpenerLabel(QLabel):
|
||||
Args:
|
||||
parent (QWidget, optional): The parent widget. Defaults to None.
|
||||
"""
|
||||
self.filepath: str | Path | None = None
|
||||
self.filepath: Path | None = None
|
||||
|
||||
super().__init__(parent)
|
||||
|
||||
def set_file_path(self, filepath: str | Path) -> None:
|
||||
def set_file_path(self, filepath: Path) -> None:
|
||||
"""Set the filepath to open.
|
||||
|
||||
Args:
|
||||
filepath (str): The path to the file to open.
|
||||
filepath (Path): The path to the file to open.
|
||||
"""
|
||||
self.filepath = filepath
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ from tagstudio.qt.mixed.pagination import Pagination
|
||||
from tagstudio.qt.mnemonics import assign_mnemonics
|
||||
from tagstudio.qt.platform_strings import trash_term
|
||||
from tagstudio.qt.resource_manager import ResourceManager
|
||||
from tagstudio.qt.thumb_grid_layout import ThumbGridLayout
|
||||
from tagstudio.qt.translations import Translations
|
||||
from tagstudio.qt.views.layouts.flow_layout import FlowLayout
|
||||
|
||||
# Only import for type checking/autocompletion, will not be imported at runtime.
|
||||
if typing.TYPE_CHECKING:
|
||||
@@ -476,7 +476,7 @@ class MainWindow(QMainWindow):
|
||||
self.entry_list_layout: QVBoxLayout
|
||||
self.entry_scroll_area: QScrollArea
|
||||
self.thumb_grid: QWidget
|
||||
self.thumb_layout: FlowLayout
|
||||
self.thumb_layout: ThumbGridLayout
|
||||
self.landing_widget: LandingWidget
|
||||
self.pagination: Pagination
|
||||
|
||||
@@ -486,7 +486,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
if not self.objectName():
|
||||
self.setObjectName("MainWindow")
|
||||
self.resize(1300, 720)
|
||||
self.resize(1316, 740)
|
||||
|
||||
self.setup_menu_bar()
|
||||
|
||||
@@ -649,11 +649,13 @@ class MainWindow(QMainWindow):
|
||||
self.entry_scroll_area.setFrameShadow(QFrame.Shadow.Plain)
|
||||
self.entry_scroll_area.setWidgetResizable(True)
|
||||
self.entry_scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
||||
self.entry_scroll_area.verticalScrollBar().valueChanged.connect(
|
||||
lambda value: self.thumb_layout.update()
|
||||
)
|
||||
|
||||
self.thumb_grid = QWidget()
|
||||
self.thumb_grid.setObjectName("thumb_grid")
|
||||
self.thumb_layout = FlowLayout()
|
||||
self.thumb_layout.enable_grid_optimizations(value=True)
|
||||
self.thumb_layout = ThumbGridLayout(driver, self.entry_scroll_area)
|
||||
self.thumb_layout.setSpacing(min(self.thumb_size // 10, 12))
|
||||
self.thumb_layout.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
self.thumb_grid.setLayout(self.thumb_layout)
|
||||
|
||||
@@ -64,6 +64,7 @@ class PreviewPanelView(QWidget):
|
||||
super().__init__()
|
||||
self.lib = library
|
||||
|
||||
self._selected = []
|
||||
self.__thumb = PreviewThumb(self.lib, driver)
|
||||
self.__file_attrs = FileAttributes(self.lib, driver)
|
||||
self._fields = FieldContainers(
|
||||
@@ -132,7 +133,11 @@ class PreviewPanelView(QWidget):
|
||||
def _set_selection_callback(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
def set_selection(self, selected: list[int], update_preview: bool = True):
|
||||
def refresh_selection(self, update_preview: bool = True):
|
||||
"""Refresh the panel's widgets to use current library data."""
|
||||
self.set_selection(self._selected, update_preview)
|
||||
|
||||
def set_selection(self, selected: list[int] | None = None, update_preview: bool = True):
|
||||
"""Render the panel widgets with the newest data from the Library.
|
||||
|
||||
Args:
|
||||
@@ -140,10 +145,10 @@ class PreviewPanelView(QWidget):
|
||||
update_preview (bool): Should the file preview be updated?
|
||||
(Only works with one or more items selected)
|
||||
"""
|
||||
self._selected = selected
|
||||
self._selected = selected or []
|
||||
try:
|
||||
# No Items Selected
|
||||
if len(selected) == 0:
|
||||
if len(self._selected) == 0:
|
||||
self.__thumb.hide_preview()
|
||||
self.__file_attrs.update_stats()
|
||||
self.__file_attrs.update_date_label()
|
||||
@@ -152,8 +157,8 @@ class PreviewPanelView(QWidget):
|
||||
self.add_buttons_enabled = False
|
||||
|
||||
# One Item Selected
|
||||
elif len(selected) == 1:
|
||||
entry_id = selected[0]
|
||||
elif len(self._selected) == 1:
|
||||
entry_id = self._selected[0]
|
||||
entry: Entry = unwrap(self.lib.get_entry(entry_id))
|
||||
|
||||
filepath: Path = unwrap(self.lib.library_dir) / entry.path
|
||||
@@ -169,10 +174,10 @@ class PreviewPanelView(QWidget):
|
||||
self.add_buttons_enabled = True
|
||||
|
||||
# Multiple Selected Items
|
||||
elif len(selected) > 1:
|
||||
elif len(self._selected) > 1:
|
||||
# items: list[Entry] = [self.lib.get_entry_full(x) for x in self.driver.selected]
|
||||
self.__thumb.hide_preview() # TODO: Render mixed selection
|
||||
self.__file_attrs.update_multi_selection(len(selected))
|
||||
self.__file_attrs.update_multi_selection(len(self._selected))
|
||||
self.__file_attrs.update_date_label()
|
||||
self._fields.hide_containers() # TODO: Allow for mixed editing
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class PreviewThumbView(QWidget):
|
||||
self.__media_player_page = QWidget()
|
||||
self.__stacked_page_setup(self.__media_player_page, self.__media_player)
|
||||
|
||||
self.__thumb_renderer = ThumbRenderer(driver, library)
|
||||
self.__thumb_renderer = ThumbRenderer(driver)
|
||||
self.__thumb_renderer.updated.connect(self.__thumb_renderer_updated_callback)
|
||||
self.__thumb_renderer.updated_ratio.connect(self.__thumb_renderer_updated_ratio_callback)
|
||||
|
||||
|
||||
@@ -266,6 +266,7 @@
|
||||
"settings.generate_thumbs": "Thumbnail Generation",
|
||||
"settings.global": "Global Settings",
|
||||
"settings.hourformat.label": "24-Hour Time",
|
||||
"settings.infinite_scroll": "Infinite Scrolling",
|
||||
"settings.language": "Language",
|
||||
"settings.library": "Library Settings",
|
||||
"settings.open_library_on_start": "Open Library on Start",
|
||||
|
||||
@@ -40,11 +40,13 @@
|
||||
"entries.duplicate.merge.label": "Fusionando entradas duplicadas...",
|
||||
"entries.duplicate.refresh": "Recargar entradas duplicadas",
|
||||
"entries.duplicates.description": "Las entradas duplicadas se definen como múltiples entradas que apuntan al mismo archivo en el disco. Al fusionarlas, se combinarán las etiquetas y los metadatos de todos los duplicados en una única entrada consolidada. No deben confundirse con los \"archivos duplicados\", que son duplicados de sus archivos fuera de TagStudio.",
|
||||
"entries.generic.refresh_alt": "&Actualizar",
|
||||
"entries.generic.remove.removing": "Eliminando entradas",
|
||||
"entries.generic.remove.removing_count": "Eliminando {count} Entradas...",
|
||||
"entries.ignored.description": "Las entradas de archivos son consideradas \"ignoradas\" si fueron añadidas a la librería antes de las reglas para ignorar archivos fuesen actualizadas para excluirlo. Los archivos ignorados se conservan en la librería por defecto para prevenir la pérdida de datos cuando se actualizan las reglas para ignorar archivos.",
|
||||
"entries.ignored.ignored_count": "Entradas Ignoradas: {count}",
|
||||
"entries.ignored.remove": "Eliminar Entradas Ignoradas",
|
||||
"entries.ignored.remove_alt": "Quit&ar entradas ignoradas",
|
||||
"entries.ignored.scanning": "Buscando en la Librería Entidades Ignoradas...",
|
||||
"entries.ignored.title": "Corregir Entradas Ignoradas",
|
||||
"entries.mirror": "&Reflejar",
|
||||
@@ -62,6 +64,7 @@
|
||||
"entries.unlinked.relink.manual": "&Reenlace manual",
|
||||
"entries.unlinked.relink.title": "Volver a vincular las entradas",
|
||||
"entries.unlinked.remove": "Eliminar Entradas No Vinculadas",
|
||||
"entries.unlinked.remove_alt": "Quit&ar entradas desvinculadas",
|
||||
"entries.unlinked.scanning": "Buscando entradas no enlazadas en la biblioteca...",
|
||||
"entries.unlinked.search_and_relink": "&Buscar && volver a vincular",
|
||||
"entries.unlinked.title": "Corregir entradas no vinculadas",
|
||||
@@ -124,6 +127,8 @@
|
||||
"generic.overwrite_alt": "&Sobrescribir",
|
||||
"generic.paste": "Pegar",
|
||||
"generic.recent_libraries": "Bibliotecas recientes",
|
||||
"generic.remove": "Quitar",
|
||||
"generic.remove_alt": "&Quitar",
|
||||
"generic.rename": "Renombrar",
|
||||
"generic.rename_alt": "&Renombrar",
|
||||
"generic.reset": "Reiniciar",
|
||||
@@ -182,6 +187,7 @@
|
||||
"library_info.cleanup.backups": "Reespaldos de la Librería:",
|
||||
"library_info.cleanup.dupe_files": "Archivos Duplicados:",
|
||||
"library_info.cleanup.ignored": "Entradas Ignoradas:",
|
||||
"library_info.cleanup.legacy_json": "Restos de biblioteca antigua:",
|
||||
"library_info.cleanup.unlinked": "Entradas No Enlazadas:",
|
||||
"library_info.stats": "Estadísticas",
|
||||
"library_info.stats.colors": "Colores de Etiquetas:",
|
||||
@@ -228,10 +234,12 @@
|
||||
"menu.settings": "Ajustes...",
|
||||
"menu.tools": "&Herramientas",
|
||||
"menu.tools.fix_duplicate_files": "Reparar &archivos duplicados",
|
||||
"menu.tools.fix_ignored_entries": "Reparar entradas &ignoradas",
|
||||
"menu.tools.fix_unlinked_entries": "Reparar entradas &desvinculadas",
|
||||
"menu.view": "&Ver",
|
||||
"menu.view.decrease_thumbnail_size": "Reducir tamaño miniatura",
|
||||
"menu.view.increase_thumbnail_size": "Aumentar tamaño miniatura",
|
||||
"menu.view.library_info": "&Información biblioteca",
|
||||
"menu.window": "Ventana",
|
||||
"namespace.create.description": "Los espacios de nombre se utilizan en TagStudio para separar grupos de elementos, como pueden ser etiquetas y colores, de manera que facilita exportarlos y compartirlos. Los espacios de nombre que empiezan por \"tagstudio\" se reservan para uso interno de TagStudio.",
|
||||
"namespace.create.description_color": "Los colores de las etiquetas utilizan espacios de nombre como grupos de paletas de colores. Todos los colores personalizados deben estar primero bajo un espacio de nombre.",
|
||||
@@ -268,6 +276,8 @@
|
||||
"settings.splash.label": "Pantalla de Bienvenida",
|
||||
"settings.splash.option.classic": "Clásico (9.0)",
|
||||
"settings.splash.option.default": "Por Defecto",
|
||||
"settings.splash.option.goo_gears": "Código abierto (9.4)",
|
||||
"settings.splash.option.ninety_five": "'95 (9.5)",
|
||||
"settings.splash.option.random": "Aleatorio",
|
||||
"settings.tag_click_action.add_to_search": "Añadir Etiqueta a la Búsqueda",
|
||||
"settings.tag_click_action.label": "Acción al hacer Clic a la Etiqueta",
|
||||
@@ -277,6 +287,7 @@
|
||||
"settings.theme.label": "Tema:",
|
||||
"settings.theme.light": "Claro",
|
||||
"settings.theme.system": "Sistema",
|
||||
"settings.thumb_cache_size.label": "Tamaño cache de miniaturas",
|
||||
"settings.title": "Ajustes",
|
||||
"settings.zeropadding.label": "Rellenar ceros en fechas",
|
||||
"sorting.direction.ascending": "Ascendiente",
|
||||
|
||||
@@ -266,6 +266,7 @@
|
||||
"settings.generate_thumbs": "Génération de vignettes",
|
||||
"settings.global": "Paramètres Globaux",
|
||||
"settings.hourformat.label": "Temps sur 24-Heure",
|
||||
"settings.infinite_scroll": "Défilement continu",
|
||||
"settings.language": "Langage",
|
||||
"settings.library": "Paramètres de la Bibliothèque",
|
||||
"settings.open_library_on_start": "Ouvrir la Bibliothèque au Démarrage",
|
||||
|
||||
@@ -266,6 +266,7 @@
|
||||
"settings.generate_thumbs": "Indexkép-előállítás",
|
||||
"settings.global": "Globális beállítások",
|
||||
"settings.hourformat.label": "24-órás idő",
|
||||
"settings.infinite_scroll": "Végtelen görgetés",
|
||||
"settings.language": "&Nyelv",
|
||||
"settings.library": "Könyvtárbeállítások",
|
||||
"settings.open_library_on_start": "&Könyvtár megnyitása a program indulásakor",
|
||||
|
||||
@@ -40,24 +40,35 @@
|
||||
"entries.duplicate.merge.label": "重複エントリを統合しています...",
|
||||
"entries.duplicate.refresh": "重複エントリを最新の状態にする",
|
||||
"entries.duplicates.description": "重複エントリとは、ディスク上の同じファイルを指す複数のエントリを指します。これらをマージすると、すべての重複エントリのタグとメタデータが1つのまとまったエントリに統合されます。TagStudio の外部にあるファイル自体の複製である「重複ファイル」と混同しないようにご注意ください。",
|
||||
"entries.generic.refresh_alt": "最新の情報に更新(&R)",
|
||||
"entries.generic.remove.removing": "エントリの削除",
|
||||
"entries.generic.remove.removing_count": "{count} 個のエントリを削除しています...",
|
||||
"entries.ignored.description": "「無視」されたエントリとは、ユーザーの無視ルール(“.ts_ignore” ファイル)を更新して対象外にした後も、更新前にライブラリへ追加されていたため残っている項目を指します。無視ルールを更新した際の誤削除によるデータ損失を防ぐため、既定ではこれらのファイルはライブラリに保持されます。",
|
||||
"entries.ignored.ignored_count": "無視されたエントリ: {count}",
|
||||
"entries.ignored.remove": "無視されたエントリを削除",
|
||||
"entries.ignored.remove_alt": "無視されたエントリを削除(&V)",
|
||||
"entries.ignored.scanning": "無視されたエントリをライブラリ内でスキャンしています...",
|
||||
"entries.ignored.title": "無視されたエントリの修正",
|
||||
"entries.mirror": "ミラー(&M)",
|
||||
"entries.mirror.confirmation": "以下の {count} 件のエントリをミラーリングしてもよろしいですか?",
|
||||
"entries.mirror.label": "{total} 件中 {idx} 件のエントリをミラーリングしています...",
|
||||
"entries.mirror.title": "エントリをミラー",
|
||||
"entries.mirror.window_title": "エントリをミラー",
|
||||
"entries.remove.plural.confirm": "以下の {count} 件のエントリを削除してもよろしいですか?",
|
||||
"entries.remove.plural.confirm": "これら <b>{count}</b> 件のエントリをライブラリから削除しますか? ディスク上のファイルは削除されません。",
|
||||
"entries.remove.singular.confirm": "このエントリをライブラリから削除しますか? ディスク上のファイルは削除されません。",
|
||||
"entries.running.dialog.new_entries": "{total} 件の新しいファイル エントリを追加しています...",
|
||||
"entries.running.dialog.title": "新しいファイルエントリを追加",
|
||||
"entries.tags": "タグ",
|
||||
"entries.unlinked.description": "ライブラリの各エントリは、ディレクトリ内のファイルにリンクされています。エントリにリンクされたファイルがTagStudio以外で移動または削除された場合、そのエントリは未リンクとして扱われます。<br><br>未リンクのエントリは、ディレクトリを検索して自動的に再リンクすることも、必要に応じて削除することもできます。",
|
||||
"entries.unlinked.relink.attempting": "{unlinked_count} 件中 {index} 件の項目を再リンク中、{fixed_count} 件を正常に再リンクしました",
|
||||
"entries.unlinked.description": "ライブラリの各エントリは、ディレクトリ内のファイルにリンクされています。エントリにリンクされたファイルがTagStudio以外で移動または削除された場合、そのエントリはリンク切れとして扱われます。<br><br>リンク切れのエントリは、ディレクトリを検索して自動的に再リンクすることも、必要に応じて削除することもできます。",
|
||||
"entries.unlinked.relink.attempting": "{unlinked_count} 件中 {index} 件のエントリを再リンク中、{fixed_count} 件を正常に再リンクしました",
|
||||
"entries.unlinked.relink.manual": "手動で再リンク(&M)",
|
||||
"entries.unlinked.relink.title": "エントリの再リンク",
|
||||
"entries.unlinked.scanning": "未リンクのエントリをライブラリ内でスキャンしています...",
|
||||
"entries.unlinked.remove": "リンク切れのエントリを削除",
|
||||
"entries.unlinked.remove_alt": "リンク切れのエントリを削除(&V)",
|
||||
"entries.unlinked.scanning": "リンク切れのエントリをライブラリ内でスキャンしています...",
|
||||
"entries.unlinked.search_and_relink": "検索して再リンク(&S)",
|
||||
"entries.unlinked.title": "未リンクのエントリを修正",
|
||||
"entries.unlinked.unlinked_count": "未リンクのエントリ数: {count}",
|
||||
"entries.unlinked.title": "リンク切れのエントリを修正",
|
||||
"entries.unlinked.unlinked_count": "リンク切れのエントリ数: {count}",
|
||||
"ffmpeg.missing.description": "FFmpeg または FFprobe が見つかりません。マルチメディアの再生とサムネイルの表示には FFmpeg のインストールが必要です。",
|
||||
"ffmpeg.missing.status": "{ffmpeg}: {ffmpeg_status}<br>{ffprobe}: {ffprobe_status}",
|
||||
"field.copy": "フィールドをコピー",
|
||||
@@ -68,7 +79,7 @@
|
||||
"file.date_modified": "更新日時",
|
||||
"file.dimensions": "ディメンション",
|
||||
"file.duplicates.description": "TagStudio では、重複ファイルを管理するために DupeGuru の結果をインポートできます。",
|
||||
"file.duplicates.dupeguru.advice": "ミラーリングの後は、DupeGuru を使って不要なファイルを削除できます。次に、ツール メニューの「未リンクのエントリを修正」機能を使って、リンクされていないエントリを削除します。",
|
||||
"file.duplicates.dupeguru.advice": "ミラーリングの後は、DupeGuru を使って不要なファイルを削除できます。次に、ツール メニューの「リンク切れのエントリを修正」機能を使って、リンクされていないエントリを削除します。",
|
||||
"file.duplicates.dupeguru.file_extension": "DupeGuru ファイル (*.dupeguru)",
|
||||
"file.duplicates.dupeguru.load_file": "DupeGuru ファイルの読み込み(&L)",
|
||||
"file.duplicates.dupeguru.no_file": "DupeGuru ファイルが選択されていません",
|
||||
@@ -107,20 +118,24 @@
|
||||
"generic.edit": "編集",
|
||||
"generic.edit_alt": "編集(&E)",
|
||||
"generic.filename": "ファイル名",
|
||||
"generic.missing": "紛失",
|
||||
"generic.missing": "欠落",
|
||||
"generic.navigation.back": "戻る",
|
||||
"generic.navigation.next": "次へ",
|
||||
"generic.no": "いいえ",
|
||||
"generic.none": "なし",
|
||||
"generic.overwrite": "上書き",
|
||||
"generic.overwrite_alt": "上書き(&O)",
|
||||
"generic.paste": "貼り付け",
|
||||
"generic.recent_libraries": "最近使用したライブラリ",
|
||||
"generic.remove": "削除",
|
||||
"generic.remove_alt": "削除(&R)",
|
||||
"generic.rename": "名前の変更",
|
||||
"generic.rename_alt": "名前の変更(&R)",
|
||||
"generic.reset": "リセット",
|
||||
"generic.save": "保存",
|
||||
"generic.skip": "スキップ",
|
||||
"generic.skip_alt": "スキップ(&S)",
|
||||
"generic.yes": "はい",
|
||||
"home.search": "検索",
|
||||
"home.search_entries": "エントリを検索",
|
||||
"home.search_library": "ライブラリを検索",
|
||||
@@ -131,6 +146,7 @@
|
||||
"home.thumbnail_size.medium": "中サムネイル",
|
||||
"home.thumbnail_size.mini": "極小サムネイル",
|
||||
"home.thumbnail_size.small": "小サムネイル",
|
||||
"ignore.open_file": "ディスク上の \"{ts_ignore}\" ファイルを表示",
|
||||
"json_migration.checking_for_parity": "パリティチェック中...",
|
||||
"json_migration.creating_database_tables": "SQLデータベース テーブルを作成しています...",
|
||||
"json_migration.description": "<br>ライブラリの移行処理を開始し、結果をプレビューします。変換されたライブラリは、 「移行完了」をクリックしない限り<i>使用されません</i>。<br><br>ライブラリ データは、値が一致しているか、「一致」ラベルが表示されている必要があります。 値が一致しない場合は赤色で表示され、その横に「<b>(!)</b>」マークが表示されます。<br><center><i>大規模なライブラリの場合、この処理に数分かかることがあります。</i></center>",
|
||||
@@ -167,9 +183,21 @@
|
||||
"library.refresh.scanning_preparing": "新しいファイルを検索中...\n準備中...",
|
||||
"library.refresh.title": "ディレクトリを更新しています",
|
||||
"library.scan_library.title": "ライブラリをスキャンしています",
|
||||
"library_info.cleanup": "クリーンアップ",
|
||||
"library_info.cleanup.backups": "ライブラリのバックアップ:",
|
||||
"library_info.cleanup.dupe_files": "重複ファイル:",
|
||||
"library_info.cleanup.ignored": "無視されたエントリ:",
|
||||
"library_info.cleanup.legacy_json": "旧ライブラリの残存データ:",
|
||||
"library_info.cleanup.unlinked": "リンク切れのエントリ:",
|
||||
"library_info.stats": "統計",
|
||||
"library_info.stats.colors": "タグの色:",
|
||||
"library_info.stats.entries": "エントリ:",
|
||||
"library_info.stats.fields": "フィールド:",
|
||||
"library_info.stats.macros": "マクロ:",
|
||||
"library_info.stats.namespaces": "名前空間:",
|
||||
"library_info.stats.tags": "タグ:",
|
||||
"library_info.title": "ライブラリ '{library_dir}'",
|
||||
"library_info.version": "ライブラリ形式のバージョン: {version}",
|
||||
"library_object.name": "名前",
|
||||
"library_object.name_required": "名前 (必須)",
|
||||
"library_object.slug": "ID スラッグ",
|
||||
@@ -191,6 +219,7 @@
|
||||
"menu.file.missing_library.message": "ライブラリ \"{library}\" の場所が見つかりません。",
|
||||
"menu.file.missing_library.title": "ライブラリが見つかりません",
|
||||
"menu.file.new_library": "新しいライブラリ",
|
||||
"menu.file.open_backups_folder": "バックアップ フォルダーを開く",
|
||||
"menu.file.open_create_library": "ライブラリを開く/作成する(&O)",
|
||||
"menu.file.open_library": "ライブラリを開く",
|
||||
"menu.file.open_recent_library": "最近使用したライブラリを開く",
|
||||
@@ -204,19 +233,23 @@
|
||||
"menu.select": "選択",
|
||||
"menu.settings": "設定...",
|
||||
"menu.tools": "ツール(&T)",
|
||||
"menu.tools.fix_duplicate_files": "重複ファイルの修正(&F)",
|
||||
"menu.tools.fix_unlinked_entries": "未リンク項目の修正(&U)",
|
||||
"menu.tools.fix_duplicate_files": "重複ファイルの修正(&D)",
|
||||
"menu.tools.fix_ignored_entries": "無視されたエントリの修正(&I)",
|
||||
"menu.tools.fix_unlinked_entries": "リンク切れのエントリの修正(&U)",
|
||||
"menu.view": "表示(&V)",
|
||||
"menu.view.decrease_thumbnail_size": "サムネイル サイズの縮小",
|
||||
"menu.view.increase_thumbnail_size": "サムネイル サイズの拡大",
|
||||
"menu.view.library_info": "ライブラリ情報(&I)",
|
||||
"menu.window": "ウィンドウ",
|
||||
"namespace.create.description": "タグや色などの項目グループを分離し、エクスポートや共有をしやすくするために、TagStudio では名前空間を使用します。「tagstudio」で始まる名前空間は、TagStudio の内部用途として予約されています。",
|
||||
"namespace.create.description_color": "タグの色は、名前空間をカラーパレットのグループとして使用します。すべてのカスタムカラーは、最初に名前空間グループに属している必要があります。",
|
||||
"namespace.create.title": "名前空間の作成",
|
||||
"namespace.new.button": "新しい名前空間",
|
||||
"namespace.new.prompt": "カスタムカラーを追加するには、新しい名前空間を作成してください!",
|
||||
"preview.ignored": "無視",
|
||||
"preview.multiple_selection": "<b>{count}</b> 件選択済み",
|
||||
"preview.no_selection": "選択されていません",
|
||||
"preview.unlinked": "リンク切れ",
|
||||
"select.add_tag_to_selected": "選択項目にタグを追加",
|
||||
"select.all": "すべて選択",
|
||||
"select.clear": "選択を解除",
|
||||
@@ -230,8 +263,10 @@
|
||||
"settings.filepath.option.full": "フルパスを表示",
|
||||
"settings.filepath.option.name": "ファイル名のみ表示",
|
||||
"settings.filepath.option.relative": "相対パスを表示",
|
||||
"settings.generate_thumbs": "サムネイルの生成",
|
||||
"settings.global": "グローバル設定",
|
||||
"settings.hourformat.label": "24時間表示",
|
||||
"settings.infinite_scroll": "無限スクロール",
|
||||
"settings.language": "言語",
|
||||
"settings.library": "ライブラリ設定",
|
||||
"settings.open_library_on_start": "起動時にライブラリを開く",
|
||||
@@ -239,6 +274,12 @@
|
||||
"settings.restart_required": "変更を反映するには、TagStudio を再起動してください。",
|
||||
"settings.show_filenames_in_grid": "グリッドにファイル名を表示",
|
||||
"settings.show_recent_libraries": "最近使用したライブラリを表示",
|
||||
"settings.splash.label": "スプラッシュ スクリーン",
|
||||
"settings.splash.option.classic": "クラシック (9.0)",
|
||||
"settings.splash.option.default": "既定",
|
||||
"settings.splash.option.goo_gears": "オープン ソース (9.4)",
|
||||
"settings.splash.option.ninety_five": "'95 (9.5)",
|
||||
"settings.splash.option.random": "ランダム",
|
||||
"settings.tag_click_action.add_to_search": "検索にタグを追加",
|
||||
"settings.tag_click_action.label": "タグクリック操作",
|
||||
"settings.tag_click_action.open_edit": "タグを編集",
|
||||
@@ -247,10 +288,12 @@
|
||||
"settings.theme.label": "テーマ:",
|
||||
"settings.theme.light": "ライト",
|
||||
"settings.theme.system": "システム",
|
||||
"settings.thumb_cache_size.label": "サムネイル キャッシュ サイズ",
|
||||
"settings.title": "設定",
|
||||
"settings.zeropadding.label": "日付ゼロ埋め",
|
||||
"sorting.direction.ascending": "昇順",
|
||||
"sorting.direction.descending": "降順",
|
||||
"sorting.mode.random": "ランダム",
|
||||
"splash.opening_library": "ライブラリ \"{library_path}\" を開いています...",
|
||||
"status.deleted_file_plural": "{count} 件のファイルを削除しました!",
|
||||
"status.deleted_file_singular": "1 件のファイルを削除しました!",
|
||||
|
||||
@@ -40,13 +40,21 @@
|
||||
"entries.duplicate.merge.label": "Fletter duplikatoppføringer…",
|
||||
"entries.duplicate.refresh": "Oppdater Duplikate Oppføringer",
|
||||
"entries.duplicates.description": "Duplikate oppføringer er definert som flere oppføringer som peker til samme fil på disken. Å slå disse sammen vil kombinere etikettene og metadataen fra alle duplikater til én enkel oppføring. Disse må ikke forveksles med \"duplikate filer\", som er duplikater av selve filene utenfor TagStudio.",
|
||||
"entries.generic.refresh_alt": "&Oppdater",
|
||||
"entries.generic.remove.removing": "Sletter Oppføringer",
|
||||
"entries.generic.remove.removing_count": "Fjerner {count} Oppføringer…",
|
||||
"entries.ignored.ignored_count": "Ignorerte Oppføringer: {count}",
|
||||
"entries.ignored.remove": "Fjern Ignorerte Oppføringer",
|
||||
"entries.ignored.remove_alt": "Fjer&n Ignorerte Oppføringer",
|
||||
"entries.ignored.scanning": "Skanner Biblioteket etter Duplikate Oppføringer…",
|
||||
"entries.ignored.title": "Fiks Ignorerte Oppføringer",
|
||||
"entries.mirror": "Speil",
|
||||
"entries.mirror.confirmation": "Er du sikker på at du vil speile følgende {count} Oppføringer?",
|
||||
"entries.mirror.label": "Speiler {idx}/{total} Oppføringer...",
|
||||
"entries.mirror.title": "Speiler Oppføringer",
|
||||
"entries.mirror.window_title": "Speil Oppføringer",
|
||||
"entries.remove.plural.confirm": "Er du sikker på at di voø slette følgende {count} oppføringer?",
|
||||
"entries.remove.plural.confirm": "Er du sikker på at du vil slette følgende {count} oppføringer fra biblioteket ditt? Ingen filer på disken vil slettes.",
|
||||
"entries.remove.singular.confirm": "Er du sikker på at du vil fjerne denne oppføringen fra bibliotek ditt? Ingen filer på disken vil slettes.",
|
||||
"entries.running.dialog.new_entries": "Legger til {total} Nye Filoppføringer...",
|
||||
"entries.running.dialog.title": "Legger til Nye Filoppføringer",
|
||||
"entries.tags": "Etiketter",
|
||||
@@ -230,6 +238,7 @@
|
||||
"settings.filepath.option.relative": "Vis Relative Filbaner",
|
||||
"settings.global": "Globale Innstillinger",
|
||||
"settings.hourformat.label": "24-timersklokke",
|
||||
"settings.infinite_scroll": "Uendelig Skrolling",
|
||||
"settings.language": "Språk",
|
||||
"settings.library": "Biblioteksinnstilllinger",
|
||||
"settings.open_library_on_start": "Åpne Bibliotek ved Start",
|
||||
|
||||
@@ -83,11 +83,12 @@
|
||||
"json_migration.heading.shorthands": "Afkortingen:",
|
||||
"json_migration.migration_complete": "Migratie Afgerond!",
|
||||
"json_migration.title": "Migratie Formaat Opslaan: \"{path}\"",
|
||||
"library_info.stats.fields": "Velden:",
|
||||
"library_info.stats.tags": "Labels:",
|
||||
"library.field.add": "Veld Toevoegen",
|
||||
"library.field.mixed_data": "Gemixte Data",
|
||||
"library.field.remove": "Veld Weghalen",
|
||||
"library.refresh.scanning_preparing": "Mappen scannen voor nieuwe bestanden...\nVoorbereiden...",
|
||||
"library_info.stats.fields": "Velden:",
|
||||
"library_info.stats.tags": "Labels:",
|
||||
"menu.delete_selected_files_ambiguous": "Bestand(en) verplaatsen naar {trash_term}",
|
||||
"menu.delete_selected_files_plural": "Bestanden verplaatsen naar {trash_term}",
|
||||
"menu.delete_selected_files_singular": "Bestand verplaatsen naar {trash_term}",
|
||||
@@ -101,6 +102,7 @@
|
||||
"menu.select": "Selecteren",
|
||||
"menu.window": "Venster",
|
||||
"select.all": "Alles Selecteren",
|
||||
"select.inverse": "Selectie omkeren",
|
||||
"sorting.direction.ascending": "Oplopend",
|
||||
"sorting.direction.descending": "Aflopend",
|
||||
"status.deleted_file_plural": "{count} Bestanden Verwijderd!",
|
||||
@@ -120,5 +122,6 @@
|
||||
"tag.new": "Nieuw Label",
|
||||
"tag.remove": "Label Weghalen",
|
||||
"trash.dialog.title.plural": "Bestanden Verwijderen",
|
||||
"trash.dialog.title.singular": "Bestand Verwijden"
|
||||
"trash.dialog.title.singular": "Bestand Verwijden",
|
||||
"trash.name.generic": "Prullenbak"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ from tempfile import TemporaryDirectory
|
||||
from unittest.mock import Mock, patch
|
||||
|
||||
import pytest
|
||||
from PySide6.QtWidgets import QScrollArea
|
||||
|
||||
CWD = Path(__file__).parent
|
||||
# this needs to be above `src` imports
|
||||
@@ -19,6 +20,7 @@ from tagstudio.core.constants import THUMB_CACHE_NAME, TS_FOLDER_NAME
|
||||
from tagstudio.core.library.alchemy.library import Library
|
||||
from tagstudio.core.library.alchemy.models import Entry, Tag
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.thumb_grid_layout import ThumbGridLayout
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
@@ -165,7 +167,8 @@ def qt_driver(library: Library, library_dir: Path):
|
||||
driver.app = Mock()
|
||||
driver.main_window = Mock()
|
||||
driver.main_window.thumb_size = 128
|
||||
driver.item_thumbs = []
|
||||
driver.main_window.thumb_layout = ThumbGridLayout(driver, QScrollArea())
|
||||
driver.main_window.menu_bar.autofill_action = Mock()
|
||||
|
||||
driver.copy_buffer = {"fields": [], "tags": []}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -145,6 +145,7 @@ def test_title_update(
|
||||
qt_driver.main_window.menu_bar.fix_dupe_files_action = QAction(menu_bar)
|
||||
qt_driver.main_window.menu_bar.clear_thumb_cache_action = QAction(menu_bar)
|
||||
qt_driver.main_window.menu_bar.folders_to_tags_action = QAction(menu_bar)
|
||||
qt_driver.main_window.menu_bar.macros_menu = None
|
||||
|
||||
# Trigger the update
|
||||
qt_driver._init_library(library_dir, open_status) # pyright: ignore[reportPrivateUsage]
|
||||
|
||||
@@ -17,8 +17,7 @@ def test_badge_visual_state(qt_driver: QtDriver, entry_min: int, new_value: bool
|
||||
)
|
||||
|
||||
qt_driver.frame_content = [entry_min]
|
||||
qt_driver.selected = [0]
|
||||
qt_driver.item_thumbs = [thumb]
|
||||
qt_driver.toggle_item_selection(0, append=False, bridge=False)
|
||||
|
||||
thumb.badges[BadgeType.FAVORITE].setChecked(new_value)
|
||||
assert thumb.badges[BadgeType.FAVORITE].isChecked() == new_value
|
||||
|
||||
@@ -2,19 +2,17 @@
|
||||
# Licensed under the GPL-3.0 License.
|
||||
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
|
||||
|
||||
|
||||
from tagstudio.core.library.alchemy.enums import BrowsingState, ItemType
|
||||
from tagstudio.core.library.alchemy.enums import BrowsingState
|
||||
from tagstudio.core.utils.types import unwrap
|
||||
from tagstudio.qt.mixed.item_thumb import ItemThumb
|
||||
from tagstudio.qt.ts_qt import QtDriver
|
||||
|
||||
|
||||
def test_browsing_state_update(qt_driver: QtDriver):
|
||||
# Given
|
||||
for entry in qt_driver.lib.all_entries(with_joins=True):
|
||||
thumb = ItemThumb(ItemType.ENTRY, qt_driver.lib, qt_driver, (100, 100))
|
||||
qt_driver.item_thumbs.append(thumb)
|
||||
qt_driver.frame_content.append(entry.id)
|
||||
entries = qt_driver.lib.all_entries(with_joins=True)
|
||||
ids = [e.id for e in entries]
|
||||
qt_driver.frame_content = ids
|
||||
qt_driver.main_window.thumb_layout.set_entries(ids)
|
||||
|
||||
# no filter, both items are returned
|
||||
qt_driver.update_browsing_state()
|
||||
@@ -49,7 +47,7 @@ def test_close_library(qt_driver: QtDriver):
|
||||
assert qt_driver.lib.library_dir is None
|
||||
assert not qt_driver.frame_content
|
||||
assert not qt_driver.selected
|
||||
assert not any(x.mode for x in qt_driver.item_thumbs)
|
||||
assert len(qt_driver.main_window.thumb_layout._entry_ids) == 0
|
||||
|
||||
# close library again to see there's no error
|
||||
qt_driver.close_library()
|
||||
|
||||
Reference in New Issue
Block a user