Compare commits

..

444 Commits

Author SHA1 Message Date
Travis Abendshien
2fc0dd03aa ui: increase thumbnail edge contrast 2024-09-13 17:39:46 -07:00
Travis Abendshien
90b9af48e3 chore: bump version to v9.4.1 2024-09-13 17:31:49 -07:00
Sean Krueger
b2dbc5722b feat(ui): warn user if FFmpeg not installed (#441)
* feat: Warn user if FFmpeg is not installed

Creates a Warning dialog on startup if the program cannot find FFmpeg or
FFprobe in the PATH. Other interactions with the program are blocked
until the issue is either ignore or resolved.

* docs: Add FFmpeg installation guide

* ruff formatting

* chore: Cleanup missing logic and warning message

* chore: Remove custom icon

Per QT docs, handling custom iconPixmap requires multiple icons per
platform. Easier to just use universal, default warning icon (yellow
triangle)

* fix: Ignore dialog with X button

* fix: Move startup checks after CI

* chore: Unreverse install check logic

* doc: Improve docs formatting

* docs: Point help url to new docs sites

* Remove ffmpeg docs page

* Use which from python stdlib
2024-09-13 17:25:09 -07:00
Travis Abendshien
6490cc905d feat: increase file scanning performance (#486)
* feat: increase file scanning performance

* fix: correct typo in comment

* refactor: use `continue` in place of nested `ifs`
2024-09-12 14:52:27 -07:00
Sean Krueger
dfa4079b23 fix(ui): retain filter on directory refresh (#483)
* fix(QtDriver): Retain filter on directory refresh

* ruff formatting
2024-09-10 01:46:59 -07:00
Travis Abendshien
6ff7303321 fix: use birthtime for default library sorting
The cutoff for how many files get sorted also changes to 150,000.
2024-09-09 12:09:59 -07:00
Travis Abendshien
4d405b5d77 feat: add .raf file to _IMAGE_RAW_SET 2024-09-07 21:45:06 -07:00
Sean Krueger
bf8816f715 fix(ui): use default audio icon if ffmpeg is absent (#471)
* fix(ThumbRenderer): Use audio icon when no ffmpeg

When ffmpeg is missing, Popen raises a FileNotFound error. This would
be caught as an Unlinked file and use the broken file icon. The
exception is now caught and a more appropriate exception is raised in
its place.

* ruff formatting
2024-09-07 20:24:10 -07:00
Sean Krueger
8c9b04d1ec fix(ui): use birthtime for creation time on mac & win (#472)
* fix(PreviewPanel): Use birthtime for creation time

st_ctime does not provide accurate creation time on MacOS, and as of
Python 3.12 is deprecated for Windows. On these two platforms use
st_birthtime, but fall back to st_ctime on linux.

* mypy errors
2024-09-07 20:17:18 -07:00
Travis Abendshien
5995e4d416 feat: add .orf file to _IMAGE_RAW_SET 2024-09-07 00:59:28 -07:00
Sean Krueger
fc714e02e6 fix: Do not create command prompt window on subprocess (#436)
* fix: Do not create command prompt window on subcmd

Patches files from abandoned libraries are located and updated in
src/qt/helpers/vendored with modified sections labeld PATCHED. A wrapper
around subprocess.Popen automatically sets the creation flag to no
window on windows.

* fix: Replace Popen in mediainfo_json decoder

* fixup: Pipe stdin to stdin

* chore: Exclude vendored dir from tooling checks

* suppress mypy warnings
2024-09-02 23:40:52 -07:00
Travis Abendshien
85b6d9decc Merge branch 'main' into Alpha-v9.4 2024-09-02 23:39:39 -07:00
xarvex
3e2fb1282c feat(flake): expose formatter
Fixes: #433
2024-09-03 00:12:03 -05:00
Travis Abendshien
9a78bf3066 feat(ui): show file creation/modified dates + restyle path label (#430)
* feat(ui): show file dates, change path look

* use `os.path.sep`

* refactor: simplify file label cases
2024-09-02 14:30:29 -07:00
Travis Abendshien
1c53f05e4f chore: ensure splash width is int 2024-09-02 00:43:11 -07:00
Travis Abendshien
1e4883c577 fix(ui): scale splash screen with screen width 2024-09-02 00:32:36 -07:00
xarvex
3e950a0cbe fix(direnv)!: gitignore .envrc
A common workflow is to have a local .envrc, allow contributors to do
so. Still provide the recommended Nix-based setup, for those who wish to
use it.
That file can then be copied to or symlinked to `.envrc`.
2024-09-01 21:28:58 -05:00
yed
ca08ce57b6 ui: postpone creating modals (#425) 2024-09-01 16:17:19 -07:00
Travis Abendshien
7f3b3d06af ui: update splash 2024-08-31 23:11:42 -07:00
Travis Abendshien
3d427997ea fix(ui): remove default video border 2024-08-31 22:40:55 -07:00
Travis Abendshien
65237ed106 fix(ui): seek next valid video frame for thumbs 2024-08-31 22:29:19 -07:00
Travis Abendshien
cb12956309 fix(ui): deleting files will not reset search 2024-08-31 21:32:00 -07:00
Travis Abendshien
cc2e9f97c4 ui: increase thumbnail edge contrast 2024-08-31 21:14:24 -07:00
Travis Abendshien
81ddf5366c fix(ui): unlinked videos use correct icon 2024-08-31 20:52:19 -07:00
Travis Abendshien
8219ffc416 feat: expanded file deletion/trashing (#409)
* feat: send deleted files to system trash

This refactors the file deletion code to send files to the system trash instead of performing a hard deletion. It also fixes deleting video files and GIFs loaded in the Preview Panel.

* feat(ui): add file deletion confirmation boxes

* feat(ui): add delete file menu option + shortcut

* ui: update file deletion message boxes

* fix(ui): same default confirm button on win/mac

- Make "Yes" the default choice in the delete file modal for both Windows and macOS (Linux untested)
- Change status messages to be more broad, since they also are displayed when cancelling the operation

* ui: show perm deletion warning on all platforms
2024-08-31 17:26:24 -07:00
Jann Stute
85d62e6519 fix: gdl sidecar files load properly
* fix: run_macro didn't work for files that aren't in a sub directory

* fix: add_generic_data_to_entry would add a new Content Tags Field if the Content Tags field was the first field

* fix: get_gdl_sidecar used wrong file extension for discovering gdl side car files

* run_macro: ensure that source folder parameter is case insensitive

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

---------

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-08-31 17:17:29 -07:00
EJ Stinson
341aa92ecb feat(ui): preview support for source engine files
* Fix text and RAW image handling

- Fix RAW images not being loaded correctly in the preview panel
- Fix trying to read size data from null images
- Refactor `os.stat` to `<Path object>.stat()`
- Remove unnecessary upper/lower conversions
- Improve encoding compatibility beyond UTF-8 when reading text files
- Code cleanup

* Use chardet for character encoding detection

* Add support for waveform + album cover thumbnails

* Rename "cover" variables for MyPy

* Rename "audio_tags" variables for MyPy + typing

* Add # type: ignore to fromstring method

* Add GIF preview support

* Add rough check for invalid video codecs

* Add ".plist" to PLAINTEXT_TYPES

* Add readable video tester

* Add ".psd" to IMAGE_TYPES; Handle ID3NoHeaderError

* Improve and style waveform previews

* Add final return statement to _album_artwork()

* Add final return statement to _audio_waveform()

* Tweak waveform color and size

* Fix ItemThumb label text color in light mode

* Fix most theme UI legibility issues

* Match additional UI to color scheme

* ruff format

* feat(ui): add UI color palette dict

* feat(ui) center and color small font previews

* fix(ui): large font previews follow app theme

* fix(ui): blender previews follow app theme

* feat(ui): add resizable thumbnail options

* fix: mkv files with "[0][0][0][0]" codec load properly

* fix: missing audio files properly handled

* feat(ui): use system accent color for thumb selections

* fix(ui): hide gif preview in multi-selections

* feat(ui): add dynamic file thumb icons

* fix(ui): hide previous thumbnail before resizing

* (fix): catch ffmpeg errors in file tester

* Squashed commit of the following:

commit 9a3c19d398
Author: Travis Abendshien <lvnvtravis@gmail.com>
Date:   Wed Jul 24 22:57:32 2024 -0700

    fix: add missing comma + sort extensions

commit 53b2db9b5f
Author: Travis Abendshien <lvnvtravis@gmail.com>
Date:   Wed Jul 24 14:46:16 2024 -0700

    refactor: move type constants to new media classes

* feat(ui): add media types and icon resources

* feat(ui): add more default media types and icons

Add additional default icons for:
- Blender
- Presentation
- Program
- Spreadsheet
Add/expand additional media types:
- PDF
- Packages

* fix: remove leading dot in preview panel ext

* refactor: remove edge from `four_corner_gradient()`

* fix: handle missing files in `resource_manager`

* fix(ui): thumb edges fading on refresh

* feat(ui): add default icons for audio+vector thumbs

* feat(ui): apply edge to default icon thumbs

* chore: remove unused code

* refactor(ui): move loading icon to `ResourceManager`

* added support for Source 1 + 2 file thumbnails 

All plaintext variants and VTF file conversions.

* Added render code for VTF files

Added support for VTF files by using the vtf2img library for PIL

* Add files via upload

* fixed Ruff errors

* fixed Ruff errors

* chore: organize imports, lists; ruff formatting

* Change references of Source to Source Engine

* Added error handler + changed source to source engine

* add struct to import and docstring for source_engine

* complying to the demigod ruff

* chore: format with ruff

---------

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-08-31 17:15:33 -07:00
SupKittyMeow
dcb8ded987 ui: "open in explorer" action follows os name (#370)
* Update item_thumb.py

* Update preview_panel.py

* Update video_player.py

* made it so preview_panel.py uses self.open_explorer_action instead of just normal open_explorer_action
2024-08-31 16:47:26 -07:00
Travis Abendshien
569390ea72 fix: correct behavior for tag widget search options (#398)
* fix(tags): include cluster in tag_id search

* fix(ui): remove unused tag context menu item

Remove unused "Add to Search" context menu item for tag widgets.

* fix(ui): add tag search from tag_database

Add missing functionality for the "Search for Tag" context menu option + left click functionality inside `tag_database.py` aka the "Tag Manager" panel.

* fix: verify `tag_id:` input in search

* style: remove commented code

* fix: change `Library` import to type check only
2024-08-31 13:11:54 -07:00
Travis Abendshien
4590226bca feat(ui): expanded thumbnail and preview features (#390)
* Fix text and RAW image handling

- Fix RAW images not being loaded correctly in the preview panel
- Fix trying to read size data from null images
- Refactor `os.stat` to `<Path object>.stat()`
- Remove unnecessary upper/lower conversions
- Improve encoding compatibility beyond UTF-8 when reading text files
- Code cleanup

* Use chardet for character encoding detection

* Add support for waveform + album cover thumbnails

* Rename "cover" variables for MyPy

* Rename "audio_tags" variables for MyPy + typing

* Add # type: ignore to fromstring method

* Add GIF preview support

* Add rough check for invalid video codecs

* Add ".plist" to PLAINTEXT_TYPES

* Add readable video tester

* Add ".psd" to IMAGE_TYPES; Handle ID3NoHeaderError

* Improve and style waveform previews

* Add final return statement to _album_artwork()

* Add final return statement to _audio_waveform()

* Tweak waveform color and size

* Fix ItemThumb label text color in light mode

* Fix most theme UI legibility issues

* Match additional UI to color scheme

* ruff format

* feat(ui): add UI color palette dict

* feat(ui) center and color small font previews

* fix(ui): large font previews follow app theme

* fix(ui): blender previews follow app theme

* feat(ui): add resizable thumbnail options

* fix: mkv files with "[0][0][0][0]" codec load properly

* fix: missing audio files properly handled

* feat(ui): use system accent color for thumb selections

* fix(ui): hide gif preview in multi-selections

* feat(ui): add dynamic file thumb icons

* fix(ui): hide previous thumbnail before resizing

* (fix): catch ffmpeg errors in file tester

* Squashed commit of the following:

commit 9a3c19d398
Author: Travis Abendshien <lvnvtravis@gmail.com>
Date:   Wed Jul 24 22:57:32 2024 -0700

    fix: add missing comma + sort extensions

commit 53b2db9b5f
Author: Travis Abendshien <lvnvtravis@gmail.com>
Date:   Wed Jul 24 14:46:16 2024 -0700

    refactor: move type constants to new media classes

* feat(ui): add media types and icon resources

* feat(ui): add more default media types and icons

Add additional default icons for:
- Blender
- Presentation
- Program
- Spreadsheet
Add/expand additional media types:
- PDF
- Packages

* fix: remove leading dot in preview panel ext

* refactor: remove edge from `four_corner_gradient()`

* fix: handle missing files in `resource_manager`

* fix(ui): thumb edges fading on refresh

* feat(ui): add default icons for audio+vector thumbs

* feat(ui): apply edge to default icon thumbs

* chore: remove unused code

* refactor(ui): move loading icon to `ResourceManager`

* fix(ui) color for default icons follow theme

* fix: remove `theme_color` redef

* refactor: make some consts and args clearer

* refactor: organize arguments, update docstrings

The ability to pass a border radius scaling argument is also included.

* chore: format docstrings with ruff

* refactor: replace magic numbers with named values

* refactor: remove unused code, comments, & imports

* refactor: rename args to not shadow builtins

* refactor: remove unused vars from `thumb_renderer`

* fix: handle ValueError in `render()`

Handle ValueErrors in `render()`. This case was encountered when attempting to render an `XPM` file during testing.

* docs: add FFmpeg requirement to README
2024-08-31 13:08:27 -07:00
Tobias Berger
d8ef54392b fix(dupes): fix duplicate file matching (#410)
chore: remove constant newline printing in file matching
2024-08-31 12:42:19 -07:00
Travis Abendshien
41087b14c6 Merge branch 'main' into Alpha-v9.4 2024-08-31 12:29:17 -07:00
xarvex
38626ac690 chore(direnv): update .envrc
- Cleanup direnv-root file
- Set filetype for vi-like editors
- Format and lint according to shellcheck and shfmt
2024-08-31 13:16:30 -05:00
xarvex
bc38e568fa feat(flake): remove impurity, update nix-direnv
Use path as an input that can be overriden automatically when direnv is
in use.
nix-direnv version present in .envrc has been updated, using watch_file on the flake is already handled.
2024-08-30 14:44:22 -05:00
Florian Zier
4b35df0924 fix(flake): GPU hardware acceleration
* Enable hardware acceleration for Nix devenv

Section "nativeBuildInputs" needs the dependency "qt6.full" to provide hardware acceleration in QT.
Library "wayland" is needed to create a proper OpenGL context under Wayland as well.

Provide a check for open AMD driver and use it for VDPAU video hardware acceleration.

Move "wrapQtAppsHook" to it's correct place under "nativeBuildInputs".

* Add xorg.libXrandr for hardware accelerated video playback.

Using libva and openssl libraries eliminates the need for a dependency on the qt6.full library.
2024-08-29 23:49:00 -05:00
xarvex
750cbf0f9c fix(flake): add missing media dependencies
Fixes: #417

Did not opt for setting VDPAU_DRIVER, should be done on user side
See: https://wiki.archlinux.org/title/Hardware_video_acceleration#Configuring_VA-API
2024-08-29 19:38:23 -05:00
Björn Out
5ac40f5b11 Add the ability to create tags when adding a tag to a file (#262)
* Add the ability to create tags when adding a tag to a file.

* ui: unify tag widget appearance

Unify the tag widget appearance and remove unnecessary "*1" multiplication.

* refactor: change some var names & add docstrings

* feat: edit panel is opened before adding tag

* feat(ui): focus save button on add panel

Focus the save button on the Add Tag panel. This allows the user to promptly hit enter to add the tag as-is.

---------

Co-authored-by: bjorn-out <b.g.out@uva.nl>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-08-27 21:59:21 -07:00
Travis Abendshien
fda6077b20 chore: bump version to v9.4.0 2024-08-25 17:11:57 -07:00
xarvex
cb4798b715 feat(flake): complete revamp with devenv/direnv
Not perfect, and mostly a port of the previous edition. Hours have
already been sunk into this, and need to get this out for consumption,
and for ironing out.
For more information see: https://devenv.sh

NOTE: impure is used only because of the devenv-managed state, do not be
alarmed!
2024-08-24 22:57:00 -05:00
Travis Abendshien
c51f9869b2 Merge branch 'main' into Alpha-v9.4 2024-08-24 17:28:57 -07:00
Xarvex
e1b1ef9888 Merge pull request #229 from seakrueger/flake-setup-venv
ci(flake): create and activate venv via Nix Flake
2024-08-22 20:09:24 -05:00
UnusualEgg
3fcf6022b9 refactor: combine open launch args (#364)
Combine the `--open` and `-o` launch arguments into a single argument option.
2024-08-22 18:02:03 -07:00
Travis Abendshien
938832505b Merge branch 'main' into Alpha-v9.4 2024-08-21 00:41:10 -07:00
Travis Abendshien
b107fb5809 refactor: move type constants to new media classes (#331)
* refactor: move type constants to new media classes

* fix: add missing comma + sort extensions
2024-08-20 23:31:31 -07:00
Travis Abendshien
ec960f2372 (fix): use .get() to avoid KeyError (#347) 2024-08-11 19:01:08 -07:00
Sam
30b60a0d31 feat(ui): sort tags in add tag panel by color/alphabetical (close #327) (#329)
* Implement #327

Sort tags in the Library Tags panel and the Add Parent Tags panel with Archived and Favorite at the top, then sort by color, and then sort alphabetically.

* Sort tags alphabetically when a search is performed

* Format with Ruff

* Prioritize tags whose names match the query over tags that match the query in other ways
2024-07-29 16:56:14 -07:00
Sam
ce87b11fbd Fix #2 for Add Library Tags panel (#328)
The "Add Tags" panel displays all tags when no search has been performed. Modifies the "Add Library Tags panel" to be the same.
2024-07-22 06:59:43 -07:00
Theasacraft
e463635cc0 Add font thumbnail preview support (#307)
* Add font thumbnail preview support

* Add multiple font sizes to thumbnail

* Ruff reformat

* Ruff reformat

* Added Metadata to info

* Change the way thumbnails are structured

* Small performance improvement

* changed Metadata display structure

* added copyright notice to added file

* fix(ui): dynamically scale font previews; add .woff2, .ttc

---------

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-07-19 07:22:15 -07:00
Creepler13
aa0aad4300 Copy and Paste + Shortcuts (#79)
* Fixed merge conflicts

* fixed format?

* Improve readability (Apply suggestions from code review)

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

* bug fix: Copy last selected not first

* Fix copy entanglement; Fix paste overwriting

* Change multi-selection copy to merge data

- Multi-selection copy now merges fields of all selected entries
- Action states are now handled

---------

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-07-18 23:33:52 -07:00
yed
bebca634de use list widget for selecting fields to add (#134)
* use list widget for selecting fields to add

* fix(ui): allow list widget resizing
2024-07-18 21:40:17 -07:00
Travis Abendshien
92a6e1130c Merge branch 'main' into Alpha-v9.4 2024-07-18 18:23:16 -07:00
Travis Abendshien
c79086f715 Fix collation data not clearing on library close 2024-07-04 17:40:19 -07:00
Travis Abendshien
9ce07bd369 Bump version to 9.3.2 2024-07-03 17:41:21 -07:00
Theasacraft
33ee27a84f Fix small bug (#306) 2024-07-03 17:02:59 -07:00
Ethnogeny
883354b263 Blender thumbnail support (#273)
* Update thumb_renderer.py

Included support for rendering blender thumbnails

* Add files via upload

Add functions that get the thumbnail's data

* Update thumb_renderer.py

* Update blender_thumbnailer.py

* Update thumb_renderer.py

* Update thumb_renderer.py

Changed where imports are according to feedback

* Update thumb_renderer.py

Changed blender thumbnail function name to reduce ambiguity

* Update blender_thumbnailer.py

Updated function name

* Update blender_thumbnailer.py

* Update blender_thumbnailer.py

Ruff format

* Update thumb_renderer.py

Ruff format

* Update constants.py

Add .blend1, 2, 3 etc file support

* Update blender_thumbnailer.py

Refactor to follow requested changes

* Update thumb_renderer.py

More refactoring

* Update blender_thumbnailer.py

Ruff format

* Update thumb_renderer.py

Ruff format
2024-07-03 16:50:59 -07:00
Travis Abendshien
6862f89d1a Merge branch 'main' into Alpha-v9.4 2024-07-03 16:47:16 -07:00
Travis Abendshien
1204d2b7b5 Fix search ignoring case of extension list 2024-06-21 11:28:12 -07:00
Sean Krueger
15ee13c7b4 Bump Qt6 version to 6.7.1 2024-06-17 13:05:17 -05:00
Xarvex
49ad8117ef fix(flake): resolve mypy access to libraries 2024-06-17 13:05:17 -05:00
Sean Krueger
4f193613de Update Contributing documentation for dev on Nix
Moves the previous updated blurb from the README to the new CONTRIBUTING
file. Also reworks some wording to link to the Flake nix wiki page for
nix users who haven't enable flakes yet.
2024-06-17 13:05:17 -05:00
Sean Krueger
31038711f2 Install ruff via nixpkgs 2024-06-17 13:05:17 -05:00
Sean Krueger
cc827108ef Add xcb as fallback when wayland fails to load
Mostly as a fallback for xserver.
2024-06-17 13:05:17 -05:00
Sean Krueger
9fec4822c1 Setup and activate virtual environment via flake
When using the nix flake to generate a development shell, the python
virtual environment will now automatically be created and dependecies
from both requirements.txt and requirements-dev.txt will be installed.
This removes the need for using the setup script after entering the
dev shell. Exec bash must be the last thing called, as any other
commands past it will not get executed by the shell hook. Also removes
some duplicate dependencies that I found.
2024-06-17 13:05:17 -05:00
Travis Abendshien
501ab1f977 Update issue templates to ask for title 2024-06-16 19:54:56 -07:00
Theasacraft
b3c01e180a Update to pyside6 version 6.7.1 (#223)
* Update to pyside6.7.1

* Fix Ruff

* Fix MyPy

* Update mypy job to also use PySide6 6.7.1

* Remove unused imports

* Add Description to class

* Ruff format

* Fix Warning in pagination.py

* Probably fix Pyside app test

* Rename CustomQPushButton to QPushButtonWrapper
also renamed custom_qbutton.py to qbutton_wrapper.py
2024-06-16 16:53:38 -07:00
Jiri
4c6ebec529 refactoring: centralize field IDs (#157)
* use enum with named fields instead of ad-hoc numbers

* move tag ids into constants file
2024-06-16 14:24:48 -07:00
Travis Abendshien
5c25666e67 Fix TypeError in folders_to_tags.py
- Additionally use proper comparison syntax
2024-06-15 13:19:28 -07:00
Lennart S
fae65bd9e9 docs: Fixed broken markdown doc link (#291) 2024-06-15 13:10:55 -07:00
Jiri
8e065ca8ac create testing library files ad-hoc (#292) 2024-06-14 10:11:00 -07:00
Hayden Andreyka
888b674f05 fix: backslashes in f-string error on file drop dupe widget (#289)
* fix: python complaining about backslashes inside f-string expressions
refactor excessively long f-string into separate variables

* fix: missing f on f-string

* Format with Ruff
2024-06-13 18:34:44 -07:00
Travis Abendshien
82946cb0b8 Update CONTRIBUTING.md with PyTest info 2024-06-13 15:39:13 -07:00
Jiri
aa2925cde0 add pytest to CI pipeline (#286) 2024-06-13 15:29:22 -07:00
Creepler13
e5a0e5aa9b Drag and drop files in and out of TagStudio (#153)
* Ability to drop local files in to TagStudio to add to library

* Added renaming option to drop import

* Improved readability and switched to pathLib

* format

* Apply suggestions from code review

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

* Revert Change

* Update tagstudio/src/qt/modals/drop_import.py

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

* Added support for folders

* formatting

* Progress bars added

* Added Ability to Drag out of window

* f

* format

* Ability to drop local files in to TagStudio to add to library

* Added renaming option to drop import

* Improved readability and switched to pathLib

* format

* Apply suggestions from code review

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

* Revert Change

* Update tagstudio/src/qt/modals/drop_import.py

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

* Added support for folders

* formatting

* Progress bars added

* Added Ability to Drag out of window

* f

* format

* format

* formatting and refactor

* format again

* formatting for mypy

* convert lambda to func for clarity

* mypy fixes

* fixed dragout only worked on selected

* Refactor typo, Add license

* Reformat QMessageBox

* Disable drops when no library is open

---------

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>
Co-authored-by: Travis Abendshien <lvnvtravis@gmail.com>
2024-06-13 10:59:10 -07:00
Travis Abendshien
5bc80a043f Update tagstudio.spec 2024-06-13 09:17:14 -07:00
Travis Abendshien
65d88b9987 Refactor video_player.py (Fix #270) (#274)
* Refactor video_player.py

- Move icons files to qt/images folder, some being renamed
- Reduce icon loading to single initial import
- Tweak icon dimensions and animation timings
- Remove unnecessary commented code
- Remove unused/duplicate imports
- Add license info to file

* Add basic ResourceManager, use in video_player.py

* Revert tagstudio.spec changes

* Change tuple usage to dicts

* Move ResourceManager initialization steps

* Fix errant list notation
2024-06-12 23:20:17 -07:00
Travis Abendshien
37ff35fcf6 Set mouse event transparency on ItemThumbs (#279) 2024-06-12 02:00:16 -07:00
Xarvex
9b13e338bb Use bug report and feature request forms for issues (#277)
* Initial bug report

* Images can be attached in description

* Enclose label in quotes

* Wikis are no longer being used

* Use footnote to clarify what is up-to-date

* Footnotes not supported in checklist

* Initial feature request form

* Fixup grammar/wording
2024-06-11 19:32:18 -07:00
Travis Abendshien
a47b0adb6e Update icon.ico 2024-06-11 17:29:30 -07:00
Travis Abendshien
9f39bf6fdc Update README: Correct version number in figure 2024-06-11 01:27:21 -07:00
Andrew Arneson
e375166bfe Raise error if video file has 0 frames or is in valid. (#275)
video.get(cv2.CAP_PROP_FRAME_COUNT) returns 0 or -1
2024-06-10 18:10:57 -07:00
Sean Krueger
7054ffd227 Separately pin QT nixpkg version (#244)
* Add missing libraries for video player

* Pin qt6 package version to 6.6.3

Currently, this succesfully launches the program. Pinning qt seperatly
allows the rest of unstable nixpkgs to be updated even after the qt
package version has been bumped. This fixes vim failing to launch in the
nix shell because of a bad gcc version. Bumping the package version to
qt6.7.1 also will require bumping PySide to 6.7.1, otherwise it will
fail to find qt. Qt 6.7.1 nixpkg commit is 47da0aee5616a063015f10ea593688646f2377e4

* fixup: Pin Qtcreator also

QtCreator was still against nixpkgs not the specific qt variant.
2024-06-10 14:52:13 -07:00
Travis Abendshien
6d283d1f2d Add CONTRIBUTING.md, update README 2024-06-10 02:30:16 -07:00
Travis Abendshien
a0baf015db Bump version to v9.3.1 Pre-Release 2024-06-08 15:34:29 -07:00
Travis Abendshien
58be4cdb4b Bump version to v9.3.0 2024-06-08 15:21:37 -07:00
Travis Abendshien
08761d5f8a Add Landing Page When No Library Is Opened (#258)
* Add landing page when no library is open

- Add landing page when no library is open
- Add linear_gradient method
- Reformat main_window.py with spaces instead of tabs because apparently it wasn't formatted already?

* Add color_overlay methods, ClickableLabel widget

- Add color_overlay helper methods
- Add clickable_label widget
- Add docstrings to landing.py methods
- Add logo easter egg
- Refactor landing.py content

* Fix redefinition

* Fix macOS shortcut text
2024-06-08 15:18:40 -07:00
Travis Abendshien
6a680ad3d1 Increase shown tag limit from 29 to 100 (#227) 2024-06-08 12:40:37 -07:00
PencilVoid
b5ec3598e1 Add "Clear Selection" button (#259)
* Add "Clear Selection" button

* Change clear select keybind to Esc
2024-06-08 10:51:39 -07:00
Theasacraft
926dfffebe Add option to use a allowed extensions instead of ignored extensions (#251)
* Add option to use a whitelist instead of a blacklist

* maybe fix mypy?

* Fix Mypy and rename ignored_extensions

* This should fix mypy

* Update checkbox text

* Update window title

* shorten if statment and update text

* update variable names

* Fix Mypy

* hopefully fix mypy

* Fix mypy

* deprecate ignored_extensions

Co-authored-by: Jiri <yedpodtrzitko@users.noreply.github.com>

* polishing

* polishing

* Fix mypy

* finishing touches

Co-authored-by: Jiri <yedpodtrzitko@users.noreply.github.com>

* Fix boolean loading

* UI/UX + ext list loading tweaks

- Change extension list mode setting from Checkbox to ComboBox to help better convey its purpose
- Change and simplify wording
- Add type hints to extension variables and change loading to use `get()` with default values
- Sanitize older extension lists that don't use extensions with a leading "."
- Misc. code organization and docstrings

---------

Co-authored-by: Jiri <yedpodtrzitko@users.noreply.github.com>
Co-authored-by: Travis Abendshien <lvnvtravis@gmail.com>
2024-06-07 18:02:28 -07:00
Xarvex
461906c349 Workflows: attempt fix for mismatched hashes in pip and bump MacOS version (#255)
* Attempted fix at mismatched hashes
Due to the seemingly random nature of the bug, this cannot be tested

* macos-11 runner has been deprecated, bump to 12
2024-06-06 12:51:08 -07:00
Travis Abendshien
2dc5197fbd Add upcoming feature documentation 2024-06-04 15:59:39 -07:00
PossiblePanda
11f0c7f9b8 Added various file formats to constants.py (#231)
* Added various file formats to constants.py

* Update tagstudio/src/core/constants.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Update tagstudio/src/core/constants.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

---------

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-06-04 14:13:57 -07:00
Andrew Arneson
fb445e6ab0 Fix Default Ignored File Extension (#245)
Add item delegate for Ignored File Extension to add leading `.` if left off extension
2024-06-03 21:47:56 -07:00
Giochino Danilo Ramos Silva
6e96a0ff61 Multi mode search system (#232)
* multi search mode system

A way to change the search from requiring all tags to and of the tags

* better wording

* Update start_win.bat

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Fix home_ui.py using PySide6 instead of PyQt5

* Refresh search on mode change

* Search mode selections naming fix

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* converted SearchMode from constants to enums
2024-06-03 15:37:56 -07:00
Travis Abendshien
c75aff4db3 Rename "Subtags" to "Parent Tags"
Mentioned change in #211
2024-06-03 13:30:15 -07:00
Travis Abendshien
84a4b2f0cf Merge pull request #240 from Loran425/bugfix/cancel_library_dialog
Bugfix Open Library Dialog
2024-06-02 22:54:51 -07:00
Andrew Arneson
10b90dcc74 Bugfix for recent library re-creating a library at the last library location. (#238)
* Prevent Automatic opening of a Library if the ".TagStudio" folder has been deleted.
If the library no longer has a `.TagStudio` folder clear the Last_Library value

* Add disabling recent libraries that are missing or have missing `.TagStudio` folders

* Fix bug where this would crash if an empty library was passed

* Grabbed the wrong color
2024-06-02 22:53:42 -07:00
Andrew Arneson
2d89df620e Fix Open Library Dialog
Resolve issues where the open library dialog will try to open `.` if no path is returned from the dialog
2024-06-02 22:43:10 -06:00
Travis Abendshien
0646508c24 Fix Raw Image Handling and Improve Text File Encoding Compatibility (#233)
* Fix text and RAW image handling

- Fix RAW images not being loaded correctly in the preview panel
- Fix trying to read size data from null images
- Refactor `os.stat` to `<Path object>.stat()`
- Remove unnecessary upper/lower conversions
- Improve encoding compatibility beyond UTF-8 when reading text files
- Code cleanup

* Use chardet for character encoding detection
2024-06-02 20:18:40 -07:00
Travis Abendshien
0137ed5be8 Update README.md 2024-06-01 21:09:55 -07:00
Theasacraft
779a251c09 Fix small bugs (#228) 2024-05-31 16:45:13 -07:00
Travis Abendshien
868b553670 Duplicate Entry Handling (Fixes #179) (#204)
* Reapply "Add duplicate entry handling (Fix #179)"

This reverts commit 66ec0913b6.

* Reapply "Fix create library + type checks"

This reverts commit 57e27bb51f.

* Type and hint changes

* Remove object cast

* MyPy wrestling

* Remove type: ignore, change __eq__ cast

- Remove `type: ignore` comments from `Entry`'s `__eq__` method
- Change the cast in this method from `__value = cast(Self, object)` to `__value = cast(Self, __value)`

Co-Authored-By: Jiri <yedpodtrzitko@users.noreply.github.com>

* Fix formatting + mypy

---------

Co-authored-by: Jiri <yedpodtrzitko@users.noreply.github.com>
2024-05-29 15:47:37 -07:00
DrRetro
9f630fe315 Video Player (#149)
* Basic Video Player

* Fixes and Comments

* Fixed Bug Where Video's Audio did not stop when switching to a Image.

* Redo on VideoPlayer. Now with rounded corners.

* Fixed size not being correct when first starting video player.

* Ruff Check Fix

* Fixed Sizing Issue, and added Autoplay option in right click menu.

* Autoplay Toggle and Fixed Issue with video not stoping after closing library.

* Ruff Format

* Suggested Changes Done

* Commented out useless code that cause first warning.

* Fixed Album Art Error

* Might have found solution to Autoplay Inconsistency

* Ruff Format

* Finally Fixed Autoplay Inconsistency

* Fixed Merge Conficts

* Requested Changes and Ruff Format

* Test for new check

* Fix for PySide App Test

* More typing fixes and a few other changes.

* Ruff Format

* MyPy Fix

* MyPy Fix

* Ruff Format

* MyPy Fix

* MyPy and Ruff Fix

* Code Clean-Up and Requests completed.

* Conflict Fixes

* MyPy Fix

* Confict Fix

It appears one of the commits from main fixed the autoplay issue.
2024-05-29 13:58:09 -07:00
Icosahunter
6798ffd0a7 Replace use of os.path with pathlib (#156)
* Replace usage of os.path with usage of pathlib.Path in ts_cli.py

* Replace use of os.path with pathlib in Library.py

* Replace use of os.path with pathlib in ts_core.py

* resolve entry path/filename on creation/update

* Fix errors and bugs related to move from os.path to pathlib.

* Remove most uses of '.resolve()' as it didn't do what I thought it did

* Fix filtering in refresh directories to not need to cast to string.

* Some work on ts_qt, thumbnails don't load...

* Fixed the thumbnail issue, things seem to be working.

* Fix some bugs

* Replace some isfile with is_file ts_cli.py

* Update tagstudio/src/core/library.py

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

* Update library.py

* Update library.py

* Update library.py

* Update ts_cli.py

* Update library.py

* Update ts_qt

* Fix path display in delete unlinked entries modal

* Ruff formatting

* Builds and opens/creates library now

* Fix errors

* Fix ruff and mypy issues (hopefully)

* Fixed some things, broke some things

* Fixed the thumbnails not working

* Fix some new os.path instances in qt files

* Fix MyPy issues

* Fix ruff and mypy issues

* Fix some issues

* Update tagstudio/src/qt/widgets/preview_panel.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Update tagstudio/src/qt/widgets/preview_panel.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Update tagstudio/src/qt/widgets/preview_panel.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Update tagstudio/src/qt/widgets/preview_panel.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Update tagstudio/src/qt/widgets/thumb_renderer.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Update tagstudio/src/qt/widgets/thumb_renderer.py

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Fix refresh_dupe_files issue

* Ruff format

* Tweak filepaths

- Suffix comparisons are now case-insensitive
- Restore original thumbnail extension label behavior
- Fix preview panel trying to read file size from missing files

---------

Co-authored-by: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>
Co-authored-by: Travis Abendshien <lvnvtravis@gmail.com>
2024-05-26 16:17:05 -07:00
Jiri
2e8678414b feat: add select all hotkey (#217)
* add select all hotkey

* add item to selected
2024-05-26 01:00:56 -07:00
Gawi
e1cd46d010 Wiki/Docs Updates (#194)
* split file + link fix

* Cleanup & Minimum Fill

* polish & link

* Update doc/Tag.md

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

---------
2024-05-25 13:49:12 -07:00
Travis Abendshien
9879697c95 Bump version to v9.2.2 2024-05-23 00:42:00 -07:00
Travis Abendshien
57e27bb51f Revert "Fix create library + type checks"
This reverts commit 6357fea8db.
2024-05-20 17:44:52 -07:00
Travis Abendshien
66ec0913b6 Revert "Add duplicate entry handling (Fix #179)"
This reverts commit 491ebb6714.
2024-05-20 17:43:25 -07:00
Travis Abendshien
6357fea8db Fix create library + type checks 2024-05-20 17:36:22 -07:00
Travis Abendshien
491ebb6714 Add duplicate entry handling (Fix #179)
- Running "Fix Unlinked Entries" will no longer result in duplicate entries if the directory was refreshed after the original entries became unlinked.
- A "Duplicate Entries" section is added to the "Fix Unlinked Entries" modal to help repair existing affected libraries.
2024-05-20 17:14:30 -07:00
Travis Abendshien
385b4117db Fix incorrect pillow-heif import 2024-05-18 19:03:57 -07:00
Travis Abendshien
be3992f655 Add HEIC/HEIF image support
- Add support for HEIC/HEIF image thumbnails and previews
- Replace dependency "pillow_avif_plugin" with "pi-heif"
- Remove unused dependencies in ts_cli.py
2024-05-18 18:58:01 -07:00
Travis Abendshien
18becd62a3 Add RAW image support (Resolve #193)
- Add thumbnail and preview support for RAW images ["raw", "dng", "rw2", "nef", "arw", "crw", "cr3"]
- Optimize the preview panel's dimension calculations (still need to move this elsewhere)
- Refactored use of "Path" in thumb_renderer.py
2024-05-18 18:49:35 -07:00
Travis Abendshien
699ecd367c Adaptive resampling method for images (Fix #174)
When loading an image for thumbnails and previews, the resampling method is now determined by the size of the original image. Now low resolution images use "nearest neighbor" sampling while higher resolution images continue to use "bilinear" sampling.
2024-05-18 17:57:28 -07:00
Travis Abendshien
9d7609a8e5 Load palletized images as RGBA (Fix #175) 2024-05-18 17:32:54 -07:00
Theasacraft
e94c4871d7 Refactor Thumbrenderer (#168)
* Merge Render methods

* Cleanup comments

* Removed old render methods and replaced with new one

* Fix Formatting

- Change all instances of "os.path.normpath" to pathlib's "Path"
- Remove unused import
- Modify log formatting
- Change "self.tr" to "self.thumb_renderer" to avoid masking internal method
- Restore DecompressionBombError handling from main
- Misc. formatting

* Fix MyPy no-redef

---------

Co-authored-by: Travis Abendshien <lvnvtravis@gmail.com>
2024-05-18 16:56:45 -07:00
Travis Abendshien
02bf15e080 Merge pull request #142 from Hidorikun/test-support-2
Add pytest support
2024-05-17 21:13:41 -07:00
Travis Abendshien
5f60ec1702 Add missing imports to ts_core.py 2024-05-17 21:12:02 -07:00
Travis Abendshien
cdf2581f84 Merge pull request #192 from yedpodtrzitko/yed/better-mypy-pr
use reviewdog for mypy job
2024-05-17 21:02:02 -07:00
yedpodtrzitko
af8b4e3872 use reviewdog for mypy job 2024-05-18 11:21:40 +08:00
Travis Abendshien
ac9dd5879e Merge pull request #189 from michaelmegrath/main
fix: Clear Edit Button on container update (#115)
2024-05-17 14:14:59 -07:00
Michael Megrath
badcd72bea fix: Clear Edit Button on container update (#115) 2024-05-16 22:09:41 -07:00
Vele George
8733c8d301 Update constants.py 2024-05-16 10:37:34 +03:00
Vele George
4726f1fc63 Merge branch 'main' into test-support-2 2024-05-16 10:37:27 +03:00
Travis Abendshien
1461f2ee70 Merge pull request #186 from yedpodtrzitko/main
fix: update recent libs when creating new one
2024-05-15 22:39:42 -07:00
yedpodtrzitko
1bfc24b70f fix: update recent libs when creating new one 2024-05-16 13:28:29 +08:00
Jiri
c09f50c568 ci: add mypy check (#161)
* ci: add mypy check

* fix remaining mypy issues

* ignore whole methods
2024-05-15 22:25:53 -07:00
Travis Abendshien
66aecf2030 Merge pull request #180 from yedpodtrzitko/yed/fix-sidebar-size
fix sidebar expanding
2024-05-15 16:38:57 -07:00
yedpodtrzitko
dc188264f9 fix sidebar expanding 2024-05-16 07:25:21 +08:00
Travis Abendshien
6e56f13eda Bump version to v9.2.1 2024-05-15 15:30:33 -07:00
Vele George
c9ea25b940 Merge branch 'main' into test-support-2 2024-05-15 10:23:36 +03:00
Travis Abendshien
e814d09c60 Add macOS Gatekeeper note to README 2024-05-15 00:15:44 -07:00
Travis Abendshien
69115ed9bb Merge pull request #173 from xarvex/release-binary-2
Correct upload binaries used in release workflow
2024-05-14 22:46:35 -07:00
Xarvex
296aed6575 Correct upload binaries used in release workflow 2024-05-15 00:45:19 -05:00
Travis Abendshien
e655fd091d Update CHANGELOG.md 2024-05-14 22:27:15 -07:00
Travis Abendshien
8780063e22 Merge branch 'main' of https://github.com/TagStudioDev/TagStudio 2024-05-14 22:11:51 -07:00
Travis Abendshien
c6d2a89263 Update documentation
- Update README
- Update CHNAGELOG
- Update `--config-file` argument help message
2024-05-14 22:11:40 -07:00
Xarvex
ecea6effa4 Release workflow with binary executables (#172)
* Refactor: remove __init__ meant for Python versions before 3.3
This does mess with a large amount of imports, as the system was being
misused to re-export submodules. This change is necessary if PyInstaller
is to work at all.

* Add MacOS icon

* Create PyInstaller spec file

* Create Release workflow
Creates executable with PyInstaller, leveraging tag_studio.spec

* Support both nonportable and portable in tag_studio.spec

* Rename spec-file to create consistently-named directories

* Only ignore other spec files

* Swap exclusion option

* Use windowed application

* Ensure environment variables are strings

* Cleanup visual order on GitHub interface

* Use app for MacOS

* Only cycle through MacOS version

* All executables generated for MacOS are portable

* Use up-to-date packages

Should resolve caching issues

* Correct architecture naming for MacOS
2024-05-14 22:06:39 -07:00
Travis Abendshien
8e11e28561 Merge pull request #159 from Loran425/main
Change QSettings behavior to work with executables
2024-05-14 14:36:56 -07:00
Travis Abendshien
5d85417ce4 Merge pull request #151 from yedpodtrzitko/yed/libs-sidebar
add list of libraries into sidebar
2024-05-14 12:06:42 -07:00
Vele George
4b1119ecba Merge branch 'main' into test-support-2 2024-05-14 11:38:24 +03:00
yedpodtrzitko
5d21375e65 dont expand recent libs 2024-05-14 15:51:41 +08:00
yedpodtrzitko
f60a93f35b keep remove button small 2024-05-14 14:58:42 +08:00
yedpodtrzitko
a71ed7c426 add button for removing recent lib 2024-05-14 12:52:25 +08:00
yedpodtrzitko
06f528f8b5 CR feedback 2024-05-14 12:37:09 +08:00
yedpodtrzitko
94a0b00007 add list of libraries into sidebar 2024-05-14 12:37:08 +08:00
Andrew Arneson
eba7c3e178 Merge remote-tracking branch 'upstream/main' 2024-05-13 20:45:47 -06:00
Andrew Arneson
89b1921e56 Eliminate guess work on config file
Removes support for directory as a `--config-file` argument
2024-05-13 20:45:37 -06:00
Travis Abendshien
f35d9c1313 Merge pull request #165 from yedpodtrzitko/yed/ci-run
ci: try to run the app
2024-05-13 14:31:46 -07:00
Theasacraft
6a2199dd2e Fix pillow decompression bomb error mentioned in #164 (#166)
* Fixes DecompressionBombError

* Fixes DecompressionBombError in PreviewPanel

* Ruff reformat

* Handle all DecompressionBombErrors

* Handle all DecompressionBombErrors

* RUFF

* fix typo

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* fix typo

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

* Ruff reformat

---------

Co-authored-by: Thesacraft <admin@samuelbellmann.de>
2024-05-13 14:18:07 -07:00
Xarvex
0416fde7f5 Refactor: remove __init__.py files meant for Python versions before 3.3 (#160)
* Refactor: remove __init__ meant for Python versions before 3.3
This does mess with a large amount of imports, as the system was being
misused to re-export submodules. This change is necessary if PyInstaller
is to work at all.

* Thanks Ruff

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>

---------

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-05-13 12:50:04 -07:00
Travis Abendshien
02d6b22b25 Splash screen now stays on top of other windows 2024-05-13 12:13:06 -07:00
Travis Abendshien
851d1fb3b2 Changes to allow for native menu bars 2024-05-13 01:10:40 -07:00
Travis Abendshien
4616da4e5f Added the splash screen to the QResources system 2024-05-12 23:52:44 -07:00
Travis Abendshien
d43b00bd00 Updated macOS Icon
- Also cleaned up surrounding commented-out code
- This should hopefully fix the dock icon trying to swap during runtime
2024-05-12 23:44:41 -07:00
Andrew Arneson
e7318c7473 Ruff Formatting 2024-05-12 23:09:28 -06:00
Andrew Arneson
74e90df680 Revert QSettings location to IniFormat UserScope defaults
Adds `-c/--config-file <filename/dir>` argument to tag_studio.py
2024-05-12 23:07:01 -06:00
Andrew Arneson
6566682504 Merge remote-tracking branch 'refs/remotes/upstream/main' 2024-05-12 22:44:50 -06:00
Travis Abendshien
b00dbf9548 Squashed commit of the following:
commit 094b6d50d975ec8feaa24af6a8a7b121fe87bce3
Author: Travis Abendshien <lvnvtravis@gmail.com>
Date:   Sun May 12 19:52:25 2024 -0700

    Formatted using Ruff

    Co-Authored-By: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>

commit 088ef5263e38c948dda9a875fcc56af97762a73e
Author: Travis Abendshien <lvnvtravis@gmail.com>
Date:   Sun May 12 19:51:03 2024 -0700

    Reduced QResource Usage + Path Refactor

    - Removed unused or redundant QResources
    - Removed unreliable uses of the Qt resource system in favor of direct paths
    - Refactored paths with "parent.parent.parent" to use ".parents[index]"

    Co-Authored-By: yed podtrzitko <yedpodtrzitko@users.noreply.github.com>
2024-05-12 21:15:46 -07:00
Travis Abendshien
f8d44c5fae Updated Application Icons
- Updated application icons
- Added .icns file for macOS
- (Potentially) stopped macOS dock icon from being updated with a different icon during runtime
2024-05-12 21:05:29 -07:00
Andrew Arneson
88b0f70271 Merge remote-tracking branch 'refs/remotes/upstream/main' 2024-05-12 21:29:13 -06:00
yedpodtrzitko
93526fa73f run tagstudio in CI 2024-05-13 08:46:55 +08:00
Travis Abendshien
f69f173368 Disable Native Menubars 2024-05-12 15:23:03 -07:00
Travis Abendshien
92752aef4a Reverted macOS menubar change
Reverted exception to allow the native macOS menubar in 94f929d122 because it doesn't work anyway.
2024-05-12 14:51:49 -07:00
Vele George
ad850cba94 Merge branch 'main' into test-support-2 2024-05-11 21:30:15 +03:00
Andrew Arneson
191d8f995f Merge remote-tracking branch 'refs/remotes/upstream/main' 2024-05-10 18:00:43 -06:00
Andrew Arneson
eede5b3600 Move the tagstudio.ini file to alongside the executable 2024-05-10 17:58:56 -06:00
Travis Abendshien
3aa71d6f8a Formatted with Ruff 2024-05-10 15:45:19 -07:00
Travis Abendshien
94f929d122 Allow the use of the native macOS menu bar 2024-05-10 15:43:26 -07:00
Travis Abendshien
03a46ae57b Style Changes
- Removed legacy style experiments, including strange translucent widgets and indigo default tags
- Renamed "Folders To Tags" to "Create Tags From Folders"
- Edited formatting of "Create Tags From Folders" modal
- Renamed "Tag Database" to "Manage Tags"/"Library Tags"
- Tweaked names of other menubar actions
- Removed some commented-out code
2024-05-10 15:29:28 -07:00
yed podtrzitko
b8d72a65c8 misc: remove duplicate code for tags updating (#135) 2024-05-09 17:39:46 -07:00
William de Castro
8321f43d6e Add Build Script for mac os systems (#76)
* chore: add TagStudio.spec to gitignore

Prevent TagStudio.spec to be added to repo in the future

* chore: add Build Script for macos

Create script using pyinstaller to generate a macos app for tagstudio

* chore: revert duplicated files

* chore: rename build file naming
2024-05-09 01:22:51 -07:00
Sylvia K
f9ea20e29c Refactor: Deduplication in pagination.py's "Set Elipses Sizes" section (#141) 2024-05-08 12:07:58 -07:00
Travis Abendshien
b6ccb88a95 Fixed Some Images Breaking Thumbnailer
Fixed images that were considered to be "truncated" from breaking the thumbnail renderer when trying to transpose via an EXIF flag. This was happening with certain panorama photos.
2024-05-08 11:39:03 -07:00
Travis Abendshien
de434872d6 Merge pull request #145 from yedpodtrzitko/yed/hold-the-jobs
dont run job threads needlessly
2024-05-08 10:36:58 -07:00
Travis Abendshien
7acfecf7b9 Merge pull request #147 from arthniwa/add-help-menu-action
Add action to help menu
2024-05-08 10:15:46 -07:00
arthniwa
7f776f4c86 Fix format required by Ruff 2024-05-08 10:57:48 -05:00
yedpodtrzitko
e803f6adcb wait for threads to finish 2024-05-08 22:49:05 +08:00
Hidorikun
b6848bb81f Ruff format 2024-05-08 17:32:15 +03:00
Travis Abendshien
7ef2aa6a80 Merge pull request #78 from Thesacraft/main
Build Script for windows
2024-05-07 23:15:32 -07:00
arthniwa
48ad4aaad2 Add action to help menu
Add "Go to GitHub Repository" to the help menu.
2024-05-08 00:42:16 -05:00
yedpodtrzitko
0e621011fc dont run job threads needlessly 2024-05-08 11:18:01 +08:00
Hidorikun
fb7c73d96b Add pytest support 2024-05-06 12:06:30 +03:00
Travis Abendshien
57a15f651e Merge pull request #140 from yedpodtrzitko/yed/fix-edit-enter
fix input enterPressed event
2024-05-04 23:36:40 -07:00
yedpodtrzitko
3aa4fa214f fix input enterPressed event 2024-05-05 14:22:37 +08:00
Travis Abendshien
ec55e92599 Merge pull request #136 from SylviaSK/main
Fix for #119, Prompt for new location user if library cannot be saved
2024-05-04 18:28:23 -07:00
Travis Abendshien
c27f99e3a4 Merge pull request #117 from abby-freakazoid/improve-startup-script 2024-05-04 15:53:36 -07:00
Sylvia Krech
78ea0b3641 close_library() fix 2024-05-04 16:45:38 -05:00
Sylvia Krech
523f233f4a Ruff formatting 2024-05-04 15:16:31 -05:00
Sylvia Krech
ea05907227 Fix for #119, Prompt for new location user if library cannot be saved 2024-05-04 12:20:43 -05:00
Travis Abendshien
089c8dd50c Reformatted using Ruff 2024-05-03 19:40:36 -07:00
Travis Abendshien
77d7559014 Merge pull request #111 from yedpodtrzitko/yed/sidebar-active-cursor
feat: add hand cursor for active sidebar elements
2024-05-03 19:15:37 -07:00
Travis Abendshien
164aba1bb0 Merge pull request #113 from TechCrafterGaming/PR-003
minor bug fixes to Tag Search Box
2024-05-03 19:08:34 -07:00
Travis Abendshien
fd622ea378 Merge pull request #114 from Loran425/refactor/tag_database
Remove functionally duplicated code in update_tags
2024-05-03 18:22:42 -07:00
Travis Abendshien
b2d87b05d8 Merge pull request #123 from SylviaSK/main
Fix opening to a file with spaces in path on windows / #120
2024-05-03 18:13:07 -07:00
Travis Abendshien
ac3d7c95cb Merge pull request #126 from JinguBangWest/main
Refactor strip_web_protocol()
2024-05-03 17:59:32 -07:00
Travis Abendshien
64514db457 Merge pull request #107 from yedpodtrzitko/yed/ruff-formatting
add code formatting & Github Action via ruff
2024-05-03 17:52:10 -07:00
JinguBangWest
58c773a0de change to string.removeprefix(prefix) 2024-05-03 14:37:32 -04:00
JinguBangWest
bb1161baa9 Refactor strip_web_protocol
This allows for more prefixes to be added in the future if needed without repeating code multiple times.
2024-05-02 22:05:57 -04:00
Sylvia Krech
cd719c6d01 minor comment fix 2024-05-02 11:54:10 -05:00
Sylvia Krech
9a405dd336 Fix for #120, Windows filepaths with spaces 2024-05-02 11:47:32 -05:00
yedpodtrzitko
afd6e113d2 add ruff pre-commit hook and README info 2024-05-02 14:19:58 +08:00
Travis Abendshien
ea8d954548 Merge pull request #122 from abby-freakazoid/bugfix/validate-library-path-before-open/#118
Fix library reopen doesn't check if path is valid #118
2024-05-01 23:00:06 -07:00
Travis Abendshien
a1fcd23d13 Merge pull request #121 from gabrieljreed/bugfix/right-click-file-path/#116
Bugfix/right click file path/#116
2024-05-01 22:34:47 -07:00
Abby
99a0bfe919 Fix library reopen doesn't check if path is valid #118 2024-05-02 00:25:21 -05:00
gabrieljreed
eb5124bd0a Update docstrings 2024-05-01 22:01:08 -07:00
gabrieljreed
0e1e9e924b Merge remote-tracking branch 'upstream/main' into bugfix/right-click-file-path/#116 2024-05-01 21:56:29 -07:00
gabrieljreed
85b4be8525 Add docstrings 2024-05-01 21:45:43 -07:00
gabrieljreed
08c0704926 Fix open_file for platforms other than Windows 2024-05-01 21:42:58 -07:00
gabrieljreed
81f550a543 Fix open_explorer on Mac, fix right click on FileOpenerLabel 2024-05-01 21:41:11 -07:00
Abby
aedc5afefa Improved TagStudio.sh
"set -e" to abort on error
"cd …" to prevent creating .venv if script is launched outside git dir
"[ … ]" to skip creating venv when it already exists
2024-05-01 22:37:50 -05:00
Andrew.Arneson
9951c00a45 Remove functionally duplicated code in update_tags 2024-05-01 13:04:17 -06:00
TechCrafterGaming
b834166d61 minor bug fixes to Tag Search Box 2024-05-01 15:27:12 +02:00
yedpodtrzitko
61f9a49782 feat: add hand cursor for active sidebar elements 2024-05-01 18:46:55 +08:00
Travis Abendshien
f71b947673 Merge pull request #110 from yedpodtrzitko/yed/fix-thumbs-orientation
fix image thumbnails rotation
2024-05-01 03:00:46 -07:00
Travis Abendshien
3d5ed3a948 Added EXIF transpose to small thumbnails 2024-05-01 02:58:43 -07:00
yedpodtrzitko
8604a7f08f fix image thumbnails rotation 2024-05-01 17:15:33 +08:00
Xarvex
67c18e9a25 Merge pull request #109 from yedpodtrzitko/yed/macos-file-open
fix file opening on posix
2024-05-01 03:51:23 -05:00
Xarvex
81e0e7b072 Accidental double sys import during merge conflict 2024-05-01 03:50:27 -05:00
Xarvex
ba5a995b5d Merge branch 'yed/macos-file-open' of github.com:yedpodtrzitko/TagStudio into yed/macos-file-open 2024-05-01 03:43:53 -05:00
Xarvex
c58590a221 Make use of open_file from #84
Refactor done in #80 essentially reverted changes
Re-fixes #81, also re-fixes windows opening behind TagStudio
2024-05-01 03:30:35 -05:00
yedpodtrzitko
f40be005f8 fix file opening on posix 2024-05-01 16:21:40 +08:00
yedpodtrzitko
f9fc28d5ec fix file opening on posix 2024-05-01 15:46:08 +08:00
yedpodtrzitko
1030328420 add ruff formatting info and CI pipeline 2024-05-01 15:19:20 +08:00
Travis Abendshien
1a7316d54c Merge pull request #103 from yedpodtrzitko/yed/show-tags-implicitly
show all tags in Add Tags panel by default
2024-04-30 21:55:46 -07:00
Travis Abendshien
92e7e05540 Merge pull request #99 from TechCrafterGaming/FIX-001
added action to close a library
2024-04-30 21:07:06 -07:00
yedpodtrzitko
d478116094 show all tags in tag panel by default 2024-05-01 00:04:37 +08:00
Travis Abendshien
a10478bc8b Misc Bug Fixes
- Catches additional exception in the sorting process of new files added to the library
- Skips this sorting process if there are more than 100,000 files (this is a temporary sorting measure, anyway)
- Possibly improved performance during the functionless (and cursed) "Applying Configured Macros" step of loading new files
2024-04-30 02:41:07 -07:00
TechCrafterGaming
a669fd67c3 small adjustments and comments 2024-04-30 08:07:10 +02:00
TechCrafterGaming
7cdb26e822 added if statement 2024-04-30 08:04:13 +02:00
TechCrafterGaming
16a9d32ef3 added last_library value to be set properly 2024-04-30 08:02:46 +02:00
Travis Abendshien
9b90bfad84 Merge pull request #98 from Creepler13/Folders-to-tags-cleanup
Folders to tags refractor + Bug fix + Enhancement
2024-04-29 22:43:15 -07:00
Travis Abendshien
6f900ff371 Merge pull request #101 from TechCrafterGaming/FIX-002 2024-04-29 16:54:07 -07:00
TechCrafterGaming
d02f068991 small changes to README 2024-04-30 00:13:24 +02:00
TechCrafterGaming
878a5dfc8a small changes to ts_qt.py (doc strings) 2024-04-30 00:12:39 +02:00
TechCrafterGaming
030c817323 added action to close a library 2024-04-29 23:57:35 +02:00
Travis Abendshien
9ad81c4582 Merge pull request #94 from Thesacraft/Shutdown-threads-safely
Shuts the threads down before quitting the application Fixes #86
2024-04-29 14:42:22 -07:00
Creepler13
b1c0ec5817 Open/Close all buttons 2024-04-29 23:01:15 +02:00
Creepler13
ea904da58b Folders to tags Cleanup + bugfix 2024-04-29 21:29:43 +02:00
Travis Abendshien
0c9dd7f43b Merge pull request #95 from Loran425/patch/library-loading
Patch Bug that prevents loading ts_library.json fields ids as integers
2024-04-29 12:01:04 -07:00
Andrew.Arneson
885b2b0358 Patch Bug that prevents loading ts_library.json fields ids as integers 2024-04-29 12:55:30 -06:00
Theasacraft
7139eea4c4 Ends threads before quitting application
This fixes this warning:
QThread: Destroyed while thread is still running
2024-04-29 19:37:36 +02:00
Theasacraft
41e419c1e7 Ends threads before quitting application
This fixes this warning:
QThread: Destroyed while thread is still running
2024-04-29 18:46:35 +02:00
Travis Abendshien
93177dd696 Merge pull request #89 from yedpodtrzitko/main
fix: strip leading slash in library items
2024-04-29 01:05:36 -07:00
yedpodtrzitko
d8a11a796d fix: strip leading slash in library items 2024-04-29 12:53:41 +08:00
Travis Abendshien
c9c399faa9 Merge pull request #80 from Loran425/qt-refactor
Qt refactor
2024-04-28 21:22:20 -07:00
Theasacraft
44106e2c59 Updates Build_win.bat to not delete source and be able to build portable version 2024-04-29 00:13:48 +02:00
Theasacraft
260583cfeb Update Build_win.bat for faster start of executable
I changed it to output an executable and a _internals dir because this makes it, atleast from my experience, much faster (12s -> 1-2s). This is probably because the decompression that has to happen before startup if its in one file
2024-04-28 21:52:16 +02:00
Andrew Arneson
eb2a175b75 Changes from #84 split into src.qt.helpers.open_file from ts_qt.py 2024-04-28 13:37:28 -06:00
Andrew Arneson
89b159cfa1 Merge remote-tracking branch 'upstream/main' into qt-refactor
# Conflicts:
#	tagstudio/src/qt/ts_qt.py
2024-04-28 13:36:25 -06:00
Travis Abendshien
fb300d0d07 Merge pull request #84 from xarvex/main
Allow opening and selecting files in file managers for all platforms
2024-04-28 12:26:33 -07:00
Xarvex
3446e0601a Incorrect usage of list append
Co-authored-by: William de Castro <williamtdcastro@gmail.com>
2024-04-28 14:07:23 -05:00
Andrew Arneson
22e0ef8f4b Cleanup Imports 2024-04-28 12:57:21 -06:00
Andrew Arneson
1351002378 Breakout ItemThumb and PreviewPanel from ts_qt.py 2024-04-28 12:55:37 -06:00
Andrew Arneson
6e8baced7d Revert "Cannot split out ItemThumb or PreviewPanel due to close ties with driver"
This reverts commit 6b9b813e26.
2024-04-28 12:18:31 -06:00
Andrew Arneson
310fc0d958 Re-enable typechecking and autocompletion for modals that rely on QtDriver in ts_qt.py 2024-04-28 12:17:16 -06:00
Xarvex
737be6199f DETACHED_PROCESS is no longer necessary
Causes program window to open below TagStudio
2024-04-28 12:34:25 -05:00
Andrew Arneson
ca9735ca86 Split out remaining modals from ts_qt.py 2024-04-28 11:09:06 -06:00
Xarvex
4a9c4de56a Further isolate program window from TagStudio 2024-04-28 11:31:18 -05:00
Andrew Arneson
f7c4e1ccc0 Revert "Cannot split out unlinked file functions due to close ties with driver"
This reverts commit c848c57cb4.
2024-04-28 10:28:05 -06:00
Andrew Arneson
f6b131c412 Revert "Cannot split out duped file functions due to close ties with driver"
This reverts commit abd36e55b3.
2024-04-28 10:28:05 -06:00
Andrew Arneson
a695e222f4 Revert "Cannot split out folder_to_tag file functions due to close ties with driver"
This reverts commit 237bcd90b0.
2024-04-28 10:28:04 -06:00
Andrew Arneson
0d6746abe0 Revert "Cannot split out mirror entities file functions due to close ties with driver"
This reverts commit a62dbc3f2d.
2024-04-28 10:28:04 -06:00
Xarvex
2d558efde7 Allow opening and selecting files in file managers for all platforms
Fixes: #81
Refactored file opener helper to use already present open_file
Refactored open_file to allow option for file manager
2024-04-28 04:14:07 -05:00
Andrew Arneson
82a53481f7 Missing Newlines 2024-04-27 21:40:53 -06:00
Andrew Arneson
d26b308ae2 split TextWidget from ts_qt.py 2024-04-27 21:25:01 -06:00
Andrew Arneson
5431c1996a Copied (with git history):
ts_qt.py

 — into: —

./widgets/text_edit.py
2024-04-27 21:21:02 -06:00
Andrew Arneson
731b6d1568 * (merge)
Copied (with git history):

ts_qt.py

 — into: —

./widgets/text_edit.py
2024-04-27 21:21:02 -06:00
Andrew Arneson
68b075a6c8 * (keep ts_qt.py)
Copied (with git history):

ts_qt.py

 — into: —

./widgets/text_edit.py
2024-04-27 21:21:02 -06:00
Andrew Arneson
99cc8dc991 * (create ./widgets/text_edit.py)
Copied (with git history):

ts_qt.py

 — into: —

./widgets/text_edit.py
2024-04-27 21:21:02 -06:00
Andrew Arneson
cdba60c7d3 Cleanup Imports 2024-04-27 21:00:38 -06:00
Theasacraft
0495824878 Update requirements.txt to use last tested pyinstaller version
Thanks to @williamtcastro for pointing it out
2024-04-28 04:54:02 +02:00
Andrew Arneson
6b9b813e26 Cannot split out ItemThumb or PreviewPanel due to close ties with driver
Might be able to resolve with more time and a separate PR
2024-04-27 20:52:51 -06:00
Andrew Arneson
ad85266f98 Error File Creation 2024-04-27 20:46:16 -06:00
Andrew Arneson
a62dbc3f2d Cannot split out mirror entities file functions due to close ties with driver
Might be able to resolve with more time and a separate PR
2024-04-27 20:45:04 -06:00
Andrew Arneson
237bcd90b0 Cannot split out folder_to_tag file functions due to close ties with driver
Might be able to resolve with more time and a separate PR
2024-04-27 20:44:46 -06:00
Andrew Arneson
abd36e55b3 Cannot split out duped file functions due to close ties with driver
Might be able to resolve with more time and a separate PR
2024-04-27 20:43:35 -06:00
Andrew Arneson
7b0064d14b split FileExtensionModal from ts_qt.py 2024-04-27 20:42:24 -06:00
Andrew Arneson
c848c57cb4 Cannot split out unlinked file functions due to close ties with driver
Might be able to resolve with more time and a separate PR
2024-04-27 20:36:21 -06:00
Andrew Arneson
ebf2c0bb99 split AddFieldModal from ts_qt.py 2024-04-27 20:26:26 -06:00
Andrew Arneson
53fefb7497 split TagBoxWidget from ts_qt.py 2024-04-27 20:22:02 -06:00
Andrew Arneson
a9afb8e2cf split TagBoxWidget from ts_qt.py 2024-04-27 20:15:14 -06:00
Andrew Arneson
f0019c7086 split BuildTagPanel from ts_qt.py 2024-04-27 20:12:40 -06:00
Andrew Arneson
c8439c976f split TagSearchPanel from ts_qt.py 2024-04-27 20:10:01 -06:00
Andrew Arneson
4a3b0c103f split TagWidget from ts_qt.py 2024-04-27 19:58:35 -06:00
Andrew Arneson
6168434f3d split ProgressWidget from ts_qt.py 2024-04-27 19:52:02 -06:00
Andrew Arneson
9b7b384183 split EditTextLine from ts_qt.py 2024-04-27 19:43:53 -06:00
Andrew Arneson
5f6752e067 split EditTextBox from ts_qt.py 2024-04-27 19:40:55 -06:00
Andrew Arneson
e71ef7f671 split PanelWidget and PanelModal from ts_qt.py 2024-04-27 19:35:52 -06:00
Andrew Arneson
a1fe57a352 split ThumbRenderer from ts_qt.py 2024-04-27 19:22:42 -06:00
Andrew Arneson
0364d3a95c split ThumbButton from ts_qt.py 2024-04-27 19:15:44 -06:00
Andrew Arneson
63f8268fd4 split collage renderer from ts_qt.py 2024-04-27 19:05:47 -06:00
Andrew Arneson
e29b2838c6 split FieldContainer and FieldWidget from ts_qt.py 2024-04-27 19:05:46 -06:00
Andrew Arneson
7caba3b825 add missing empty line at end of file 2024-04-27 18:45:59 -06:00
Andrew Arneson
74c4c6c85d split FileOpenerHelper/Label from ts_qt.py 2024-04-27 18:40:07 -06:00
Andrew Arneson
abc9f3f4e4 split open_file func from ts_qt.py 2024-04-27 18:33:29 -06:00
Andrew Arneson
f26fd5a63c Copied (with git history):
./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:37 -06:00
Andrew Arneson
bb6a73e410 * (merge)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:36 -06:00
Andrew Arneson
54b70676f3 * (keep ./ts_qt.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:36 -06:00
Andrew Arneson
91c918796d * (create ./modals/folders_to_tags.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
fb05d386c1 * (create ./widgets/thumb_renderer.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
4665fb22ff * (create ./widgets/collage_icon.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
b25c1efc9d * (create ./widgets/thumb_button.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
f160071b27 * (create ./widgets/item_thumb.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
73ba643132 * (create ./widgets/preview_panel.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
effdd28b80 * (create ./helpers/file_opener.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
875bc34519 * (create ./modals/file_extension.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
77bbbe95b3 * (create ./modals/add_field.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
5f31fe4623 * (create ./modals/relink_unlinked.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
2f61ac706f * (create ./modals/delete_unlinked.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
822aa4df39 * (create ./modals/fix_unlinked.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
d67f8b6f0e * (create ./modals/mirror_entities.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
60d1d290a2 * (create ./modals/fix_dupes.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:35 -06:00
Andrew Arneson
65a2fe676d * (create ./widgets/progress.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
30998a144a * (create ./modals/tag_database.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
9c44d74cb6 * (create ./modals/build_tag.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
4de7865aba * (create ./modals/tag_search.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
8fed3350f4 * (create ./modals/edit_text.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
02542bda7e * (create ./modals/__init__.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
36841da965 * (create ./widgets/panel.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
58b0e94d65 * (create ./widgets/tag.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
4b7b915c68 * (create ./widgets/text_box_edit.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
6091916b86 * (create ./widgets/text_line_edit.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
273843f9c1 * (create ./widgets/tag_box.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
da1c3f8fa8 * (create ./widgets/fields.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Andrew Arneson
aec0786e61 * (create ./helpers/open_file.py)
Copied (with git history):

./ts_qt.py

 — into: —

./helpers/open_file.py ./widgets/fields.py ./widgets/tag_box.py ./widgets/text_line_edit.py ./widgets/text_box_edit.py ./widgets/tag.py ./widgets/panel.py ./modals/__init__.py ./modals/edit_text.py ./modals/tag_search.py ./modals/build_tag.py ./modals/tag_database.py ./widgets/progress.py ./modals/fix_dupes.py ./modals/mirror_entities.py ./modals/fix_unlinked.py ./modals/delete_unlinked.py ./modals/relink_unlinked.py ./modals/add_field.py ./modals/file_extension.py ./helpers/file_opener.py ./widgets/preview_panel.py ./widgets/item_thumb.py ./widgets/thumb_button.py ./widgets/collage_icon.py ./widgets/thumb_renderer.py ./modals/folders_to_tags.py
2024-04-27 18:20:34 -06:00
Theasacraft
9959eb1049 Update .gitignore to revert doubled entrys 2024-04-28 02:00:17 +02:00
Theasacraft
4f00a8ac88 Update .gitignore to ignore build specific files and folders 2024-04-28 01:56:13 +02:00
Theasacraft
329c23e23c Update requirements.txt to include pyinstaller
Pyinstaller is used to build the windows executable
2024-04-28 01:54:17 +02:00
Theasacraft
f53a9249f0 Build script for windows
Adds a build script for windows
2024-04-28 01:51:09 +02:00
Travis Abendshien
6097570591 Merge branch 'text-thumbnails' 2024-04-27 16:26:11 -07:00
Travis Abendshien
8541fc59d1 Increased plaintext types; Exception handling 2024-04-27 16:25:49 -07:00
Travis Abendshien
c955fb1589 Code Style Changes 2024-04-27 15:59:56 -07:00
Travis Abendshien
276cfaf635 Merge pull request #40 from chao-master/feature/typed-dict-and-typing
🏷️ Add strict typing dicts for ts_library.json
2024-04-27 15:53:58 -07:00
Travis Abendshien
6bba7dafbc Merge branch 'main' into feature/typed-dict-and-typing 2024-04-27 15:34:08 -07:00
Travis Abendshien
2110592971 Merge pull request #72 from yedpodtrzitko/yed/readability
improve code readability
2024-04-27 15:27:58 -07:00
Travis Abendshien
15de97cfe7 Merge pull request #58 from Creepler13/Folders-to-Tags
Add folders to tags tool
2024-04-27 14:58:17 -07:00
Travis Abendshien
114c1a4481 Merge pull request #69 from cirillom/image-preview
Ability to open file or file location using context menu
2024-04-27 13:33:59 -07:00
Creepler13
1f9a13fc4d Removed unused imports 2024-04-27 21:14:37 +02:00
Creepler13
e2aba7ddf7 Added Proper Visualls to show what would be added 2024-04-27 21:13:57 +02:00
yedpodtrzitko
f0f8e0ea7e simplify bool conditions 2024-04-28 01:47:16 +08:00
yedpodtrzitko
d5d9cd3e7a improve code readability 2024-04-28 01:17:41 +08:00
Matheus Cirillo
ade1fb1c11 Merge remote-tracking branch 'tags/main' into image-preview 2024-04-27 09:54:16 -03:00
Matheus Cirillo
955d4a0c9f fixed bug where it wouldn't open outside debug mode 2024-04-27 09:44:04 -03:00
Travis Abendshien
31f4022895 Added File Extension Blacklist
- All file types (minus JSON, XMP, and AAE) are now shown by default in the library (existing libraries will need to refresh)
- Added the Edit -> "Ignore File Extensions" option, providing the user with a way to blacklist certain file extensions from their library
- The targeted version number has been updated to 9.2.0 (this is not the final 9.2.0 release, commits will still be added before that release is packaged up)
2024-04-27 02:00:18 -07:00
Travis Abendshien
5b4d35b5c0 Added default thumbnail for files 2024-04-26 22:13:10 -07:00
Matheus Cirillo
6831a89392 file opening preview panel context menu 2024-04-26 23:19:24 -03:00
Matheus Cirillo
5bd2aaaf9e context menu for thumbs 2024-04-26 22:04:40 -03:00
Travis Abendshien
c789d09b07 Plaintext Thumbs (Proof of Concept)
**BASIC** support for rendering thumbnails for certain plaintext types (txt, md, html, etc.) using PIL.
Notable issues include:
- Long draw times (entire files are read)
- No text wrapping
- Hardcoded style
- Blurry text in preview pane images
- No cached thumbnails (I call dibs on the thumbnail caching system)
2024-04-26 17:33:02 -07:00
Matheus Cirillo
a9cbab40ab works as expected (open file in explorer) in windows 2024-04-26 20:40:43 -03:00
Matheus Cirillo
bcf4453c8d clickable label to the right place 2024-04-26 20:17:54 -03:00
Matheus Cirillo
18dcedd6a0 code cleanup 2024-04-26 20:13:58 -03:00
Matheus Cirillo
79e0263e97 file_label opens file path 2024-04-26 20:09:43 -03:00
Creepler13
960b2038ef Merge branch 'Folders-to-Tags' of https://github.com/Creepler13/TagStudio into Folders-to-Tags 2024-04-26 23:52:20 +02:00
Creepler13
88292f42af Merge branch 'Folders-to-Tags' of https://github.com/Creepler13/TagStudio into Folders-to-Tags 2024-04-26 23:37:47 +02:00
Creepler13
3cd6fa136f Finished folders to Tags tool 2024-04-26 23:36:50 +02:00
Creepler13
0541c9fb01 first prototype 2024-04-26 23:36:50 +02:00
Travis Abendshien
039c574cf4 Merge pull request #60 from Thesacraft/main
Fixes issue with badges not getting updated if meta tags gets removed
2024-04-26 13:36:57 -07:00
Theasacraft
042ed9209f Merge branch 'CyanVoxel:main' into main 2024-04-26 22:33:14 +02:00
Travis Abendshien
992a840dfe Merge pull request #63 from DrRetro2033/Shortcuts
Keyboard Shortcuts
2024-04-26 13:32:55 -07:00
Theasacraft
1e17b6c467 Merge branch 'CyanVoxel:main' into main 2024-04-26 22:29:04 +02:00
Travis Abendshien
a0b017815e Merge pull request #61 from DrRetro2033/main
A simple Tag Database.
2024-04-26 13:23:32 -07:00
Travis Abendshien
80d6e09834 Merge pull request #64 from xarvex/file-open-2
Windows: fix files w/ spaces opening cmd rather than associated program
2024-04-26 13:10:39 -07:00
Xarvex
66fec73136 Correct usage of start command 2024-04-26 15:05:07 -05:00
Xarvex
1f7a5d3cbb Windows: fix files w/ spaces opening cmd rather than associated program 2024-04-26 14:46:13 -05:00
DrRetro
dde7eec946 Keyboard Shortcuts Added to basic Functions 2024-04-26 12:01:02 -04:00
DrRetro
85ae167817 Fixed Issue with Tags in Database not refreshing after Tag was Edited. 2024-04-26 11:01:09 -04:00
DrRetro
5feb3a6d20 Fixed Issue with Previous Commit 2024-04-26 10:51:49 -04:00
DrRetro
f23ff1669e Fixed Issue when Searching Tags, Editing Option was not Connected to Searched TagWidets 2024-04-26 10:50:19 -04:00
DrRetro
6b1035b0f6 A simple TagDatabasePanel has been created based off TagSearchPanel.
To access, go to Edit > Tag Database
2024-04-26 10:07:59 -04:00
Theasacraft
243d786298 Update ts_qt.py to update badges if meta tag field is removed 2024-04-26 15:41:37 +02:00
Theasacraft
898ce5fdc7 Update ts_qt.py to update badges if meta tag field is removed 2024-04-26 15:34:06 +02:00
Creepler13
749d7c8fc0 Finished folders to Tags tool 2024-04-26 14:59:41 +02:00
Creepler13
1774a00d34 first prototype 2024-04-26 14:59:40 +02:00
Creepler13
9020aaddf4 Finished folders to Tags tool 2024-04-26 14:58:21 +02:00
Travis Abendshien
00651e6242 Fixed Incorrect Fields Being Updated in Multi-Selection
Fixes #55

Co-Authored-By: Andrew Arneson <Loran425@gmail.com>
Co-Authored-By: Xarvex <60973030+xarvex@users.noreply.github.com>
2024-04-26 01:45:03 -07:00
Travis Abendshien
b7638046a3 Addded TagStudio.ini to gitignore; Updated Qt resource comment 2024-04-25 22:22:28 -07:00
Travis Abendshien
c446911b59 Merge pull request #34 from DrRetro2033/main
Mutli-Select Tagging
2024-04-25 22:18:00 -07:00
DrRetro
201a63e273 Refresh_badges added to QtDriver, and favorite and archived badges checks selection. 2024-04-25 20:51:12 -04:00
Creepler13
d8faa27dbf first prototype 2024-04-26 00:11:58 +02:00
Travis Abendshien
ff488da6c8 Merge pull request #51 from Loran425/main
QOL Open last opened library
2024-04-25 14:22:12 -07:00
Andrew Arneson
2514809e17 remove doubled up line 2024-04-25 14:20:46 -06:00
Andrew Arneson
82bb63191a Tweak setting location to ensure compatibility between IDEs
Explicitly call sync to save `.ini` file
2024-04-25 14:12:40 -06:00
Andrew Arneson
9a076a775f Merge remote-tracking branch 'upstream/main' 2024-04-25 12:23:55 -06:00
Andrew Arneson
5c746a9950 add Qsettings and restore last library on open
Settings are currently stored as an INI file within the project directory rather than messing with registry or system configurations.
2024-04-25 12:23:13 -06:00
Travis Abendshien
00dea27279 Merge pull request #46 from eltociear/patch-1
docs: update documentation.md
2024-04-25 10:39:42 -07:00
Ikko Eltociear Ashimine
a0dc34a5ad docs: update documentation.md
minor fix
2024-04-26 00:46:32 +09:00
DrRetro
2a46251831 Fixed slow down from refreshing all thumbnails for every added and removed tag. 2024-04-25 09:57:37 -04:00
DrRetro
92834800e2 Merge remote-tracking branch 'upstream/main' 2024-04-25 09:46:22 -04:00
DrRetro
794401ae58 Archive Button and Favorite Button Now work 2024-04-25 09:40:12 -04:00
DrRetro
b2fbc4b4a2 Large Changes to how code gets Field ID. 2024-04-25 09:34:14 -04:00
Travis Abendshien
13c2ca1ea5 Allows shortcut files to show in library
Shortcut files (.lnk, .url, .desktop) can now be added to the library (no thumbnail previews currently).
2024-04-25 01:41:32 -07:00
Travis Abendshien
e823bb5c93 Merge pull request #41 from Loran425/feature/modify-imports
Feature/modify imports
2024-04-24 22:37:27 -07:00
Travis Abendshien
7652289fe5 Merge branch 'main' into feature/modify-imports 2024-04-24 22:36:56 -07:00
Travis Abendshien
b9b23611f7 Merge pull request #43 from xarvex/file-open-1
Allow files to be opened in their respective programs in the background for Windows, MacOS, and Linux
2024-04-24 22:18:56 -07:00
Andrew Arneson
de09da1592 remove tagstudio prefix for source libraries 2024-04-24 23:18:16 -06:00
Xarvex
956ffd4663 Properly detach process on Windows 2024-04-25 00:07:14 -05:00
Xarvex
8b4b2507fa Account for start being a shell builtin on Windows 2024-04-24 23:50:26 -05:00
Xarvex
f125e5a50d Implement file opening for Linux and MacOS, allow Windows in background
Note: this is only tested on Linux
2024-04-24 23:37:36 -05:00
Andrew Arneson
0b1c097f97 update tagstudio.py refrences to tag_studio.py 2024-04-24 22:11:22 -06:00
Andrew Arneson
2b5697ea50 Remove wildcard Imports 2024-04-24 21:51:43 -06:00
Andrew Arneson
4e5b7b1c7d Fix reference to datetime 2024-04-24 21:51:22 -06:00
Andrew Arneson
0b4ccac5ff Import Humanfriendly format_size when importing format_timespan 2024-04-24 21:14:13 -06:00
Andrew Arneson
952ed8f27d Remove Unused Imports 2024-04-24 21:10:44 -06:00
Andrew Arneson
c0c18dabc1 Optimize & Sort Imports 2024-04-24 19:52:10 -06:00
Andrew Arneson
7b48e5e17e Prevent Import collisions
Rename tagstudio.py to tag_studio.py
2024-04-24 19:48:25 -06:00
Travis Abendshien
6e7567a192 Update launch.json
Updated launch.json to be cross-platform between Windows and UNIX systems
2024-04-24 17:12:40 -07:00
Travis Abendshien
ad6fefbe2b Merge pull request #35 from dakota-marshall/nixos-support
Add NixOS Dev Environment Support
2024-04-24 17:01:16 -07:00
Travis Abendshien
4a55af66ee Remove duplicate tag IDs when loading library
Tags with duplicate IDs inside a library save file are removed when opening the library. Cleans up the mess from #38.
2024-04-24 16:22:36 -07:00
Ripp_
f0148c7f35 🏷️ Add strict typing dicts for ts_library.json 2024-04-25 00:10:32 +01:00
Travis Abendshien
ac00890c90 Merge pull request #39 from Thesacraft/main
Update library.py to not duplicate default tags on save
2024-04-24 15:26:46 -07:00
DrRetro
9e61d45ea5 Rewrote Multi-Select to use field templates. 2024-04-24 18:11:41 -04:00
Theasacraft
432f4851f3 Update library.py to not duplicate default tags on save 2024-04-25 00:02:32 +02:00
Dakota Marshall
4184848f9c Update Nix flake pinned hash for python3.12 and QT 6.6.3 support 2024-04-24 16:51:06 -04:00
Dakota Marshall
bc0f8b991e Update install documentation for NixOS 2024-04-24 16:25:57 -04:00
Dakota Marshall
c4e8d40abe Update bash script to use env for nix support 2024-04-24 16:25:57 -04:00
Dakota Marshall
c7492b78d3 Add flake files for working Nix environment 2024-04-24 16:25:57 -04:00
Travis Abendshien
e69e4998e5 Merge branch 'main' of https://github.com/CyanVoxel/TagStudio 2024-04-24 13:14:21 -07:00
Travis Abendshien
0b9b4dac73 Updated Prerequisites to Python 3.12 2024-04-24 13:14:11 -07:00
Travis Abendshien
844f756dba Merge pull request #32 from Thesacraft/main
python 3.12 support
2024-04-24 13:13:21 -07:00
DrRetro
6e341e097b Merge pull request #1 from CyanVoxel/main
Update
2024-04-24 15:25:15 -04:00
DrRetro
def244b732 Fixed bug that occured with adding other fields to one entry. 2024-04-24 15:18:22 -04:00
Theasacraft
129d336357 Merge branch 'CyanVoxel:main' into main 2024-04-24 21:13:38 +02:00
Travis Abendshien
071100bf90 Merge pull request #33 from LennartCode/patch-1
docs(README.md): Removed typo.
2024-04-24 12:04:11 -07:00
Lennart S
e161290571 docs(README.md): Removed typo. 2024-04-24 20:59:41 +02:00
Theasacraft
e8ab8059cd Update requirements.txt to support python 3.12 2024-04-24 19:18:24 +02:00
Theasacraft
7ec29228b5 Update requirements.txt to also support python3.12 2024-04-24 19:15:17 +02:00
DrRetro
3974c1b031 Multi-Select Removing Tags 2024-04-24 12:09:07 -04:00
DrRetro
fba2f8f46b Multi-Select Tag Adding 2024-04-24 11:31:53 -04:00
Travis Abendshien
0529f1fe7e Fixed library creation bug inside of empty .TagStudio folder
Fixed a library creation bug where the program would malfunction when trying to create a new library from a folder called ".TagStudio".
2024-04-23 23:22:29 -07:00
Travis Abendshien
59be7c0cf9 Merge pull request #30 from Loran425/main
Allow network path libraries
2024-04-23 22:21:41 -07:00
Andrew Arneson
dfe2b57952 Allow network path libraries
Swap normalized path strip from using strip to using rstrip to avoid stripping leading slashes
2024-04-23 22:59:18 -06:00
Travis Abendshien
45e765862d Fixed forward slash being stripped from Unix paths 2024-04-23 20:10:16 -07:00
Travis Abendshien
cf1ce6bb24 Merge pull request #27 from Thesacraft/main
Prevent exceptions when no Library is Loaded
2024-04-23 17:33:09 -07:00
Theasacraft
e3e1c55fab Merge branch 'CyanVoxel:main' into main 2024-04-24 02:28:34 +02:00
Travis Abendshien
2e57e0397c Extended filetype support
Added rudimentary support for audio types, text types, spreadsheets, presentations, archives, and programs. These files will now be scanned and picked up when refreshing the library.
2024-04-23 17:10:23 -07:00
Travis Abendshien
5e33d07e39 Removed unused dependencies 2024-04-23 16:26:10 -07:00
Theasacraft
fffd9dba6c Update ts_qt.py to prevent exceptions in file menu
Before this Refresh Directorys/Save Library/Save Library Backup would throw an exception if no library was loaded this prevents that
2024-04-24 01:17:30 +02:00
Theasacraft
98a01aea80 Merge branch 'CyanVoxel:main' into main 2024-04-24 00:55:17 +02:00
Theasacraft
1489d56be7 Update ts_qt.py to not throw Errors when no library is open
Before this the Refresh/Save Library/Save Library Backup would throw an Error when no Library is open
2024-04-24 00:53:41 +02:00
Travis Abendshien
d974aa777c Removed (most) janky theme overriding (#5)
- Removed most of the temporary theming that was clashing with Qt, especially in system light mode
- Possibly fixed the "transparent menu" issue
2024-04-23 15:49:05 -07:00
Travis Abendshien
f67b26fbd6 Added SIGTERM handling (#13)
- Also removed miscellaneous whitespace
- Removed leftover print statement on startup
2024-04-23 13:31:53 -07:00
Travis Abendshien
a074bed540 Merge pull request #22 from Thesacraft/main
Update ts_qt.py to fix bootup bug
2024-04-23 11:29:28 -07:00
Theasacraft
a55e649d83 Update ts_qt.py to fix bootup bug
Fixes the visual bug
2024-04-23 20:20:13 +02:00
160 changed files with 46924 additions and 42331 deletions

16
.envrc.recommended Normal file
View File

@@ -0,0 +1,16 @@
# vi: ft=bash
#
# If you wish to use this file, copy or symlink it to `.envrc` for direnv to read it.
# This will use the flake development shell.
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
fi
devenv_root_file="$(mktemp -t devenv-root-XXXXXXXX)"
printf %s "${PWD}" >"${devenv_root_file}"
if ! use flake . --override-input devenv-root "file+file://${devenv_root_file}"; then
printf '%s\n' "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
rm "${devenv_root_file}"
unset devenv_root_file

64
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,64 @@
name: Bug Report
description: File a bug or issue report.
title: '[Bug]: '
labels: ['Type: Bug']
body:
- type: markdown
attributes:
value: |
*Please add an appropriate title for this issue.*
Before reporting, read the [documentation](https://github.com/TagStudioDev/TagStudio/blob/main/doc/index.md) and search existing [issues](https://github.com/TagStudioDev/TagStudio/issues).
Validate that you are using an up-to-date version[^1], your issue might already be fixed!
Questions, guidance, and usage goes in [discussions](https://github.com/TagStudioDev/TagStudio/discussions). Invalid issues will be closed.
[^1]: This can mean latest release, pre-release, or git commit.
- type: checkboxes
attributes:
label: Checklist
description: Make sure you've checked (and actually did) all of the below.
options:
- label: I am using an up-to-date version.
required: true
- label: I have read the [documentation](https://github.com/TagStudioDev/TagStudio/blob/main/doc/index.md).
required: true
- label: I have searched existing [issues](https://github.com/TagStudioDev/TagStudio/issues).
required: true
- type: input
attributes:
label: TagStudio Version
placeholder: Alpha 9.1.0
validations:
required: true
- type: input
attributes:
label: Operating System & Version
placeholder: TagOS 3.14
validations:
required: true
- type: textarea
attributes:
label: Description
description: Clear and concise description of the problem. Attach screenshots if needed, and include any errors you see.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: Clear and concise description of what you think should happen.
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: Minimal steps neded for the problem to occur.
placeholder: |
1.
2.
3.
validations:
required: true
- type: textarea
attributes:
label: Logs
description: Provide any logs, if applicable.

View File

@@ -0,0 +1,40 @@
name: Feature Request
description: Suggest a new feature.
title: '[Feature Request]: '
labels: ['Type: Enhancement']
body:
- type: markdown
attributes:
value: |
*Please add an appropriate title for this feature request.*
Before suggesting, read the [documentation](https://github.com/TagStudioDev/TagStudio/blob/main/doc/index.md) and search existing [issues](https://github.com/TagStudioDev/TagStudio/issues).
Validate that you are using an up-to-date version[^1], your feature might already be implemented!
Questions, guidance, and usage goes in [discussions](https://github.com/TagStudioDev/TagStudio/discussions). Invalid issues will be closed.
[^1]: This can mean latest release, pre-release, or git commit.
- type: checkboxes
attributes:
label: Checklist
description: Make sure you've checked (and actually did) all of the below.
options:
- label: I am using an up-to-date version.
required: true
- label: I have read the [documentation](https://github.com/TagStudioDev/TagStudio/blob/main/doc/index.md).
required: true
- label: I have searched existing [issues](https://github.com/TagStudioDev/TagStudio/issues).
required: true
- type: textarea
attributes:
label: Description
description: Clear and concise description of the problem or missing capability. Attach screenshots if needed, and explain your own use case.
validations:
required: true
- type: textarea
attributes:
label: Solution
description: Clear and concise description of what you think should happen.
- type: textarea
attributes:
label: Alternatives
description: Any considered alternative solutions or workarounds. If undesirable, why?

52
.github/workflows/apprun.yaml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: PySide App Test
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install system dependencies
run: |
# dont run update, it is slow
# sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libxkbcommon-x11-0 \
x11-utils \
libyaml-dev \
libegl1-mesa \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libopengl0 \
libxcb-cursor0 \
libpulse0 \
ffmpeg
- name: Install dependencies
run: |
pip install -Ur requirements.txt
- name: Run TagStudio app and check exit code
run: |
xvfb-run --server-args="-screen 0, 1920x1200x24 -ac +extension GLX +render -noreset" python tagstudio/tag_studio.py --ci -o /tmp/
exit_code=$?
if [ $exit_code -eq 0 ]; then
echo "TagStudio ran successfully"
else
echo "TagStudio failed with exit code $exit_code"
exit 1
fi

37
.github/workflows/mypy.yaml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: MyPy
on: [ push, pull_request ]
jobs:
mypy:
name: Run MyPy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install mypy==1.10.0
mkdir tagstudio/.mypy_cache
- uses: tsuyoshicho/action-mypy@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-check
fail_on_error: true
workdir: tagstudio
level: error
mypy_flags: --config-file ../pyproject.toml

22
.github/workflows/pytest.yaml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: pytest
on: [push, pull_request]
jobs:
pytest:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run tests
run: |
pytest tagstudio/tests/

106
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,106 @@
name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
jobs:
linux:
strategy:
matrix:
build-type: ['', portable]
include:
- build-type: ''
build-flag: ''
suffix: ''
- build-type: portable
build-flag: --portable
suffix: _portable
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -Ur requirements.txt pyinstaller
- run: pyinstaller tagstudio.spec -- ${{ matrix.build-flag }}
- run: tar czfC dist/tagstudio_linux_x86_64${{ matrix.suffix }}.tar.gz dist tagstudio
- uses: actions/upload-artifact@v4
with:
name: tagstudio_linux_x86_64${{ matrix.suffix }}
path: dist/tagstudio_linux_x86_64${{ matrix.suffix }}.tar.gz
macos:
strategy:
matrix:
os-version: ['12', '14']
include:
- os-version: '12'
arch: x86_64
- os-version: '14'
arch: aarch64
runs-on: macos-${{ matrix.os-version }}
env:
# even though we run on 12, target towards compatibility
MACOSX_DEPLOYMENT_TARGET: '11.0'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -Ur requirements.txt pyinstaller
- run: pyinstaller tagstudio.spec
- run: tar czfC dist/tagstudio_macos_${{ matrix.arch }}.tar.gz dist TagStudio.app
- uses: actions/upload-artifact@v4
with:
name: tagstudio_macos_${{ matrix.arch }}
path: dist/tagstudio_macos_${{ matrix.arch }}.tar.gz
windows:
strategy:
matrix:
build-type: ['', portable]
include:
- build-type: ''
build-flag: ''
suffix: ''
file-end: ''
- build-type: portable
build-flag: --portable
suffix: _portable
file-end: .exe
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -Ur requirements.txt pyinstaller
- run: PyInstaller tagstudio.spec -- ${{ matrix.build-flag }}
- run: Compress-Archive -Path dist/TagStudio${{ matrix.file-end }} -DestinationPath dist/tagstudio_windows_x86_64${{ matrix.suffix }}.zip
- uses: actions/upload-artifact@v4
with:
name: tagstudio_windows_x86_64${{ matrix.suffix }}
path: dist/tagstudio_windows_x86_64${{ matrix.suffix }}.zip
publish:
needs: [linux, macos, windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v2
with:
files: |
tagstudio_linux_x86_64/*
tagstudio_linux_x86_64_portable/*
tagstudio_macos_x86_64/*
tagstudio_macos_aarch64/*
tagstudio_windows_x86_64/*
tagstudio_windows_x86_64_portable/*

11
.github/workflows/ruff.yaml vendored Normal file
View File

@@ -0,0 +1,11 @@
name: Ruff
on: [ push, pull_request ]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
version: 0.4.2
args: 'format --check'

8
.gitignore vendored
View File

@@ -35,6 +35,7 @@ MANIFEST
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
!tagstudio.spec
# Installer logs
pip-log.txt
@@ -54,6 +55,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
tagstudio/tests/fixtures/library/*
# Translations
*.mo
@@ -249,5 +251,9 @@ compile_commands.json
# TagStudio
.TagStudio
TagStudio.ini
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,qt
.envrc
.direnv
.devenv

6
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.2
hooks:
- id: ruff-format

2
.vscode/launch.json vendored
View File

@@ -8,7 +8,7 @@
"name": "TagStudio",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}\\TagStudio\\tagstudio.py",
"program": "${workspaceRoot}/tagstudio/tag_studio.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": []

69
Build_MacOS_app.sh Executable file
View File

@@ -0,0 +1,69 @@
#! /usr/bin/env bash
# GETTING BASE DIR
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# SETTING UP CONSTANTS
TAGSTUDIO_NAME="TagStudio"
TAGSTUDIO_DIR="$SCRIPT_DIR/tagstudio"
TAGSTUDIO_DIR_RESOURCES="$TAGSTUDIO_DIR/resources"
TAGSTUDIO_ICON="$TAGSTUDIO_DIR/resources/icon.ico"
TAGSTUDIO_SRC="$TAGSTUDIO_DIR/src"
TAGSTUDIO_MAIN="$TAGSTUDIO_DIR/tag_studio.py"
DIST_PATH="$SCRIPT_DIR/dist"
BUILD_PATH="$SCRIPT_DIR/build"
LOGS_PATH="$BUILD_PATH/logs"
printf -- "🏁 Starting Script \n"
# CREATE VENV AND INSTALL REQUIREMENTS
printf -- "🐍 Creating Python virtual env\n"
python3 -m venv .venv
source .venv/bin/activate
if [ ! -d $LOGS_PATH ]; then
printf -- "📁 Creating Logs folder\n"
mkdir -p $LOGS_PATH;
fi
printf -- "💻 Installing Requirements \n"
pip install -r requirements.txt > "$LOGS_PATH/pip.log" 2>&1
pip install PyInstaller > "$LOGS_PATH/pip.log" 2>&1
if [[ "$OSTYPE" == "darwin"* ]]; then
printf -- "🍏 MacOS Detected \n"
SYS_CMD="--windowed"
OS=0
fi
SECONDS=0
# CREATE COMMAND
printf -- "⏳ Building App \n"
COMMAND=$( python -m PyInstaller \
--name "$TAGSTUDIO_NAME" \
--icon "$TAGSTUDIO_ICON" \
--add-data "$TAGSTUDIO_DIR_RESOURCES:./resources" \
--add-data "$TAGSTUDIO_SRC:./src" \
--distpath "$DIST_PATH" \
-p "$TAGSTUDIO_DIR" \
--noconsole \
--workpath "$BUILD_PATH" \
-y "$SYS_CMD" "$TAGSTUDIO_MAIN" \
> "$LOGS_PATH/pyinstaller.log" 2>&1 )
duration=$SECONDS
if $COMMAND; then
printf -- "✅ Build Successfull \n"
printf -- "$((duration)) seconds of build\n"
if [[ "$OS" == 0 ]]; then
printf -- "📁 Opening App folder \n"
open $DIST_PATH
fi
else
printf -- "❌ Error Building the app\nPlease read the logs\navailable at build/logs\n"
fi
printf -- "🏁 END OF TRANSMISSION"

31
Build_win.bat Normal file
View File

@@ -0,0 +1,31 @@
@echo off
set TAGSTUDIO_NAME=TagStudio
set TAGSTUDIO_DIR=tagstudio
set TAGSTUDIO_DIR_RESOURCES=%TAGSTUDIO_DIR%/resources
set TAGSTUDIO_ICON=%TAGSTUDIO_DIR%/resources/icon.ico
set TAGSTUDIO_SRC=%TAGSTUDIO_DIR%/src
set TAGSTUDIO_MAIN=%TAGSTUDIO_DIR%/tag_studio.py
set BUILD_MODE=--onedir
if "%1" == "--help" (
echo run "%~nx0" for normal Build
echo run "%~nx0 --portable" for Build packaged into one file
goto end
)
if "%1" == "--portable" (
echo Building portable executable...
set BUILD_MODE=--onefile
goto run
)
if not "%1" == "" (
echo Invalid argument run "%~nx0 --help" for help
goto end
)
:run
echo Building executable...
set COMMAND=PyInstaller --name "%TAGSTUDIO_NAME%" --icon "%TAGSTUDIO_ICON%" --add-data "%TAGSTUDIO_DIR_RESOURCES%:./resources" --add-data "%TAGSTUDIO_SRC%:./src" -p "%TAGSTUDIO_DIR%" --console %BUILD_MODE% "%TAGSTUDIO_MAIN%" -y
call .venv\Scripts\activate.bat
%COMMAND%
deactivate
:end

View File

@@ -5,7 +5,56 @@ 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.1.0-alpha] - 2024-04-22
## [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

170
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,170 @@
# Contributing to TagStudio
_Last Updated: June 10th, 2024_
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 [Planned Features](https://github.com/TagStudioDev/TagStudio/blob/main/doc/updates/planned_features.md) page, [FAQ](/README.md/#faq), as well as the open [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 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.
### Contribution Checklist
- I've read the [Planned Features](https://github.com/TagStudioDev/TagStudio/blob/main/doc/updates/planned_features.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 open [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 _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 and Mypy
- I've read the [Code Guidelines](#code-guidelines) and/or [Documentation Guidelines](#documentation-guidelines)
- **_I mean it, I've found or created a new issue for my feature!_**
## Creating a Development Environment
### Prerequisites
- [Python](https://www.python.org/downloads/) 3.12
- [Ruff](https://github.com/astral-sh/ruff) (Included in `requirements-dev.txt`)
- [Mypy](https://github.com/python/mypy) (Included in `requirements-dev.txt`)
- [PyTest](https://docs.pytest.org) (Included in `requirements-dev.txt`)
### Creating a Python Virtual Environment
If you wish to launch the source version of TagStudio outside of your IDE:
> [!IMPORTANT]
> Depending on your system, Python may be called `python`, `py`, `python3`, or `py3`. These instructions use the alias `python3` for consistency. You can check to see which alias your system uses and if it's for the correct Python version by typing `python3 --version` (or whichever alias) into your terminal.
> [!TIP]
> On Linux and macOS, you can launch the `tagstudio.sh` script to skip the following process, minus the `requirements-dev.txt` installation step. _Using the script is fine if you just want to launch the program from source._
1. In the root repository directory, create a python virtual environment:
`python3 -m venv .venv`
2. Activate your environment:
- Windows w/Powershell: `.venv\Scripts\Activate.ps1`
- Windows w/Command Prompt: `.venv\Scripts\activate.bat`
- Linux/macOS: `source .venv/bin/activate`
3. Install the required packages:
- `pip install -r requirements.txt`
- If developing (includes Ruff and Mypy): `pip install -r requirements-dev.txt`
_Learn more about setting up a virtual environment [here](https://docs.python.org/3/tutorial/venv.html)._
### Manually Launching (Outside of an IDE)
- **Windows** (start_win.bat)
- To launch TagStudio, launch the `start_win.bat` file. You can modify this .bat file or create a shortcut and add one or more additional arguments if desired.
- **Linux/macOS** (TagStudio.sh)
- Run the "TagStudio.sh" script and the program should launch! (Make sure that the script is marked as executable if on Linux). Note that launching from the script from outside of a terminal will not launch a terminal window with any debug or crash information. If you wish to see this information, just launch the shell script directly from your terminal with `./TagStudio.sh`.
- **NixOS** (Nix Flake)
> [!WARNING]
> Support for NixOS is still a work in progress.
- Use the provided [Flake](https://nixos.wiki/wiki/Flakes) to create and enter a working environment by running `nix develop`. Then, run the program via `python3 tagstudio/tag_studio.py` from the root directory.
- **Any** (No Scripts)
- Alternatively, with the virtual environment loaded, run the python file at `tagstudio\tag_studio.py` from your terminal. If you're in the project's root directory, simply run `python3 tagstudio/tag_studio.py`.
## 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
- Lint code with by moving into the `/tagstudio` directory with `cd tagstudio` and running `ruff --config ../pyproject.toml`.
- Format code with `ruff format` inside the repository directory
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:** Move into the `/tagstudio` directory with `cd tagstudio` and run the following:
- `mkdir -p .mypy_cache`
- `mypy --install-types --non-interactive`
- Check code by moving into the `/tagstudio` directory with `cd tagstudio` _(if you aren't already inside)_ and running `mypy --config-file ../pyproject.toml .`. _(Don't forget the `.` at the end!)_
> [!CAUTION]
> There's a known issue between PySide v6.6.3 and Mypy where Mypy will detect issues with the `.pyi` files inside of PySide and prematurely stop checking files. This issue is not present in PySide v6.6.2, which _should_ be compatible with everything else if you wish to try using that version in the meantime.
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 moving into the `/tagstudio` directory with `cd tagstudio` and running `pytest tests/`.
## Code Guidelines
### 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.
- Try to keep a maximum column with of no more than **100** characters.
- Code comments should be used to help describe sections of code that don'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 (in newly created python files).
- When writing text for window titles, form titles, or dropdown options, 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/)!
> [!WARNING]
> Column width limits, docstring formatting, and import sorting aren't currently checked in the Ruff workflow but likely will be in the near future.
### Implementations
- Avoid direct calls to `os`
- Use `Pathlib` library instead of `os.path`
- Use `sys.platform` instead of `os.name`
- Don't prepend local imports with `tagstudio`, stick to `src`
- Use `logging` instead of `print` statements
- Avoid nested `f-string`s
#### Runtime
- Code must function on supported versions of Windows, macOS, and Linux:
- Windows: 10, 11
- macOS: 12.0+
- Linux: TBD
- Avoid use of unnecessary logging statements in final submitted code.
- Code should not cause unreasonable slowdowns to the program outside of a progress-indicated task.
#### Git/GitHub Specifics
- 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.
- Use imperative-style present-tense commit messages. Examples:
- "Add feature foo"
- "Change method bar"
- "Fix function foobar"
- 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.
## Documentation Guidelines
Documentation contributions include anything inside of the `doc/` folder, as well as the `README.md` and `CONTRIBUTING.md` files.
- 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
_TBA_

111
README.md
View File

@@ -1,4 +1,4 @@
# TagStudio (Preview/Alpha): A User-Focused Document Management System
# TagStudio (Alpha): A User-Focused Document Management System
<p align="center">
<img width="60%" src="github_header.png">
@@ -10,14 +10,18 @@
TagStudio is a photo & file organization application with an underlying system that focuses on giving freedom and flexibility to the user. No proprietary programs or formats, no sea of sidecar files, and no complete upheaval of your filesystem structure.
<p align="center">
<img width="80%" src="screenshot.jpg">
</p>
<figure align="center">
<img width="80%" src="screenshot.jpg" alt="TagStudio Screenshot" align="center">
<figcaption><i>TagStudio Alpha v9.1.0 running on Windows 10.</i></figcaption>
</figure>
## Contents
- [Goals](#goals)
- [Priorities](#priorities)
- [Current Features](#current-features)
- [Contributing](#contributing)
- [Installation](#installation)
- [Usage](#usage)
- [FAQ](#faq)
@@ -44,64 +48,35 @@ TagStudio is a photo & file organization application with an underlying system t
- Name, Author, Artist (Single-Line Text Fields)
- Description, Notes (Multiline Text Fields)
- Tags, Meta Tags, Content Tags (Tag Boxes)
- Crete rich tags composed of a name, a list of aliases, and a list of “subtags” - being tags in which these tags inherit values from.
- Search for entries based on tags, metadata, or filename (using `filename: <query>`)
- Create rich tags composed of a name, a list of aliases, and a list of “subtags” - being tags in which these tags inherit values from.
- Search for entries based on tags, ~~metadata~~ (TBA), or filenames/filetypes (using `filename: <query>`)
- Special search conditions for entries that are: `untagged`/`no tags` and `empty`/`no fields`.
> [!NOTE]
> For more information on the project itself, please see the [FAQ](#faq) section and other docs.
> For more information on the project itself, please see the [FAQ](#faq) section as well as the [documentation](/doc/index.md).
## Contributing
If you're interested in contributing to TagStudio, please take a look at the [contribution guidelines](/CONTRIBUTING.md) for how to get started!
## Installation
> [!CAUTION]
> TagStudio is only currently verified to work on Windows. I've run into issues with the Qt code running on Linux, but I don't know how severe these issues are. There's also likely bugs regarding filenames and portability of the databases across different OSes.
### Prerequisites
To download TagStudio, visit the [Releases](https://github.com/TagStudioDev/TagStudio/releases) section of the GitHub repository and download the latest release for your system under the "Assets" section. TagStudio is available for **Windows**, **macOS** _(Apple Silicon & Intel)_, and **Linux**. Windows and Linux builds are also available in portable versions if you want a more self-contained executable to move around.
- Python 3.9.6 - ~3.10 *(Not working on 3.12)*
For video thumbnails and playback, you'll also need [FFmpeg](https://ffmpeg.org/download.html) installed on your system.
### Creating the Virtual Environment
*Skip this step if launching from the .sh script on Linux.*
1. In the root repository directory, create a python virtual environment:
`python3 -m venv .venv`
2. Activate your environment:
- Windows w/Powershell: `.venv\Scripts\Activate.ps1`
- Windows w/Command Prompt: `.venv\Scripts\activate.bat`
- Linux/macOS: `source .venv/bin/activate`
3. Install the required packages:
`pip install -r requirements.txt`
_Learn more about setting up a virtual environment [here](https://docs.python.org/3/tutorial/venv.html)._
### Launching
> [!NOTE]
> Depending on your system, Python may be called `python`, `py`, `python3`, or `py3`. These instructions use the alias `python3`.
> [!IMPORTANT]
> On macOS, you may be met with a message saying _""TagStudio" can't be opened because Apple cannot check it for malicious software."_ If you encounter this, then you'll need to go to the "Settings" app, navigate to "Privacy & Security", and scroll down to a section that says _""TagStudio" was blocked from use because it is not from an identified developer."_ Click the "Open Anyway" button to allow TagStudio to run. You should only have to do this once after downloading the application.
#### Optional Arguments
Optional arguments to pass to the program.
> `--open <path>` / `-o <path>`
> Path to a TagStudio Library folder to open on start.
#### Windows
To launch TagStudio, launch the `start_win.bat` file. You can modify this .bat file or create a shortcut and add one or more additional arguments if desired.
Alternatively, with the virtual environment loaded, run the python file at `tagstudio\tagstudio.py` from your terminal. If you're in the project's root directory, simply run `python3 tagstudio/tagstudio.py`.
> [!CAUTION]
> TagStudio on Linux & macOS likely won't function correctly at this time. If you're trying to run this in order to help test, debug, and improve compatibility, then charge on ahead!
#### macOS
With the virtual environment loaded, run the python file at "tagstudio/tagstudio.py" from your terminal. If you're in the project's root directory, simply run `python3 tagstudio/tagstudio.py`. When launching the program in the future, remember to activate the virtual environment each time before launching *(an easier method is currently being worked on).*
#### Linux
Run the "TagStudio.sh" script, and the program should launch! (Make sure that the script is marked as executable). Note that launching from the script from outside of a terminal will not launch a terminal window with any debug or crash information. If you wish to see this information, just launch the shell script directly from your terminal with `sh TagStudio.sh`.
> `--config-file <path>` / `-c <path>`
> Path to the TagStudio config file to load.
## Usage
@@ -146,9 +121,6 @@ To create a new tag, click on Edit -> New Tag from the menu bar. From there, ent
To edit a tag, right-click the tag in the tag field of the preview pane and select “Edit Tag”
> [!WARNING]
> There is currently no method to view all tags that youve created in your library. This is a top priority for future releases.
### Relinking Renamed/Moved Files
Inevitably, some of the files inside your library will be renamed, moved, or deleted. If a file has been renamed or moved, TagStudio will display the thumbnail as a red tag with a cross through it _(this icon is also used for items with broken thumbnails)._ To relink moved files or delete these entries, go to Tools -> Manage Unlinked Entries. Click the “Refresh” button to scan your library for unlinked entries. Once complete, you can attempt to “Search & Relink” any unlinked entries to their respective files, or “Delete Unlinked Entries” in the event the original files have been deleted and you no longer wish to keep their metadata entries inside your library.
@@ -177,7 +149,7 @@ Load in a .dupeguru file generated by [dupeGuru](https://github.com/arsenetar/du
Create an image collage of your photos and videos.
> [!CAUTION]
> Collage sizes and options are hardcoded.
> Collage sizes and options are hardcoded, and there's no GUI indicating the process of the collage creation.
#### Macros
@@ -193,14 +165,21 @@ Import JSON sidecar data generated by [gallery-dl](https://github.com/mikf/galle
> [!CAUTION]
> This feature is not supported or documented in any official capacity whatsoever. It will likely be rolled-in to a larger and more generalized sidecar importing feature in the future.
## Launching/Building From Source
See instructions in the "[Creating Development Environment](/CONTRIBUTING.md/#creating-a-development-environment)" section from the [contribution documentation](/CONTRIBUTING.md).
## FAQ
### What State Is the Project Currently In?
As of writing (Alpha v9.1.0) the project is in a useable state, however it lacks proper testing and quality of life features. Currently the program has only been verified to work properly on Windows, and is unlikely to properly run on Linux or macOS in its current state, however this functionality is a priority going forward with testers.
As of writing (Alpha v9.3.0) the project is in a useable state, however it lacks proper testing and quality of life features.
### What Features Are You Planning on Adding?
> [!IMPORTANT]
> See the [Planned Features](/doc/updates/planned_features.md) documentation for the latest feature lists. The lists here are currently being migrated over there with individual pages for larger features.
Of the several features I have planned for the project, these are broken up into “priority” features and “future” features. Priority features were originally intended for the first public release, however are currently absent from the Alpha v9.x.x builds.
#### Priority Features
@@ -210,18 +189,16 @@ Of the several features I have planned for the project, these are broken up into
- Boolean Search
- Coexisting Text + Tag Search
- Searchable File Metadata
- Tag management view
- Applying metadata via multi-selection
- Comprehensive Tag management tab
- Easier ways to apply tags in bulk
- Tag Search Panel
- Recent Tags Panel
- Top Tags Panel
- Pinned Tags Panel
- Apply tags based on system folders
- Better (stable, performant) library grid view
- Improved entry relinking
- Cached thumbnails
- Collations
- Tag-like Groups
- Resizable thumbnail grid
- User-defined metadata fields
- Multiple directory support
@@ -231,13 +208,13 @@ Of the several features I have planned for the project, these are broken up into
- Better internal API for accessing Entries, Tags, Fields, etc. from the library.
- Proper testing workflow
- Continued code cleanup and modularization
- Reassessment of save file structure in order to prioritize portability (leading to exportable tags, presets, etc)
- Exportable/importable library data including "Tag Packs"
#### Future Features
- Support for multiple simultaneous users/clients
- Draggable files outside the program
- Ability to ignore specific files
- Comprehensive filetype whitelist
- A finished “macro system” for automatic tagging based on predetermined criteria.
- Different library views
- Date and time fields
@@ -245,20 +222,20 @@ Of the several features I have planned for the project, these are broken up into
- Audio waveform previews
- 3D object previews
- Additional previews for miscellaneous file types
- Exportable/sharable tags and settings
- Optional global tags and settings, spanning across libraries
- Importing & exporting libraries to/from other programs
- Port to a more performant language and modern frontend (Rust?, Tauri?, etc.)
- Plugin system
- Local OCR search
- Support for local machine learning-based tag suggestions for images
- Mobile version
- Mobile version _(FAR future)_
#### Features I Likely Wont Add/Pull
- Native Cloud Integration
- Native Cloud Integration
- There are plenty of services already (native or third-party) that allow you to mount your cloud drives as virtual drives on your system. Pointing TagStudio to one of these mounts should function similarly to what native integration would look like.
- Native ChatGPT/Non-Local LLM Integration
- This could mean different things depending on what you're intending. Whether it's trying to use an LLM to replace the native search, or to trying to use a model for image recognition, I'm not interested in hooking people's TagStudio libraries into non-local LLMs such as ChatGPT and/or turn the program into a "chatbot" interface (see: [Goals/Privacy](#goals)). I wouldn't, however, mind using **locally** hosted models to provide the *optional* ability for additional searching and tagging methods (especially when it comes to facial recognition).
- This could mean different things depending on what you're intending. Whether it's trying to use an LLM to replace the native search, or to trying to use a model for image recognition, I'm not interested in hooking people's TagStudio libraries into non-local LLMs such as ChatGPT and/or turn the program into a "chatbot" interface (see: [Goals/Privacy](#goals)). I wouldn't, however, mind using **locally** hosted models to provide the _optional_ ability for additional searching and tagging methods (especially when it comes to facial recognition).
### Why Is the Version Already v9?
@@ -266,10 +243,4 @@ Ive been developing this project over several years in private, and have gone
### Wait, Is There a CLI Version?
As of right now, no. However, I _did_ have a CLI version in the recent past before dedicating my efforts to the Qt GUI version. Ive left in the currently-inoperable CLI code just in case anyone was curious about it. Also yes, its just a bunch of glorified print statements (_the outlook for some form of curses on Windows didnt look great at the time, and I just needed a driver for the newly refactored code...)._
### Can I Contribute?
**Yes!!** I recommend taking a look at the [Priority Features](#priority-features), [Future Features](#future-features), and [Features I Won't Pull](#features-i-likely-wont-addpull) lists, as well as the project issues to see whats currently being worked on. Please do not submit pull requests with new feature additions without opening up an issue with a feature request first.
As of writing I dont have a concrete style guide, just try to stay within or close enough to the PEP 8 style guide and/or match the style of the existing code.
As of right now, **no**. However, I _did_ have a CLI version in the recent past before dedicating my efforts to the Qt GUI version. Ive left in the currently-inoperable CLI code just in case anyone was curious about it. Also yes, its just a bunch of glorified print statements (_the outlook for some form of curses on Windows didnt look great at the time, and I just needed a driver for the newly refactored code...)._

View File

@@ -1,5 +1,7 @@
#! /bin/bash
python3 -m venv .venv
#! /usr/bin/env bash
set -e
cd "$(dirname "$0")"
! [ -d .venv ] && python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python tagstudio/tagstudio.py
python tagstudio/tag_studio.py

BIN
doc/assets/db_schema.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -1,189 +0,0 @@
# TagStudio Documentation (Alpha v9.1.0)
## _A User-Focused Document Management System_
> [!WARNING]
> This documentation is still a work in progress, and is intended to aide with deconstructing and understanding of the core mechanics of TagStudio and how it operates.
## Contents
- [Library](#library)
- [Fields](#fields)
- [Entries](#entries)
- [Tags](#tags)
- [Retrieving Entries](#retrieving-entries-based-on-tag-cluster)
- [Missing File Resolution](#missing-file-resolution)
## Library
The Library is how TagStudio represents your chosen directory. In this Library or Vault system, all files within this directory are represented by Entries, which then contain metadata Fields. All TagStudio data for a Library is stored within a `.TagStudio` folder at the root of the Library's directory. Internal Library objects include:
- Fields (v9+)
- Text Line (Title, Author, Artist, URL)
- Text Box (Description, Notes)
- Tag Box (Tags, Content Tags, Meta Tags)
- Datetime (Date Created, Date Modified, Date Taken) [WIP]
- Collation (Collation) [WIP]
- `name: str`: Collation Name
- `page: int`: Page #
- Checkbox (Archive, Favorite) [WIP]
- Drop Down (Group of Tags to select one from) [WIP]
- Entries (v1+)
- Tags (v7+)
- Macros (v9/10+)
## Fields
Fields are the the building blocks of metadata stored in Entires. Fields have several base types for representing different types of information, including:
- `text_line`
- A string of text, displayed as a single line.
- Useful for Titles, Authors, URLs, etc.
- `text_box`
- A long string of text displayed as a box of text.
- Useful for descriptions, notes, etc.
- `datetime` [WIP]
- A date and time value.
- `tag_box`
- A box of tags added by the user.
- Multiple tag boxes can be used to separate classifications of tags, ex. 'Content Tags' and 'Meta Tags'.
- `checkbox` [WIP]
- A two-state checkbox.
- Can be associated with a tag for quick organization.
- `collation` [WIP]
- A collation is a collection of files that are intended to be displayed and retrieved together. Examples may include pages of a book or document that are spread out across several individual files. If you're intention is to associate files across multiple 'collations', use Tags instead!
## Entries
Entries are the representations of your files within the Library. They consist of a reference to the file on your drive, as well as the metadata associated with it.
### Entry Object Structure (v9):
- `id`:
- ID for the Entry.
- Int, Unique, Required
- Used for internal processing
- `filename`:
- The filename with extension of the referenced media file.
- String, Required
- `path`:
- The folder path in which the media file is located in.
- String, Required, OS Agnostic
- `fields`:
- A list of Field ID/Value dicts.
- List of dicts, Optional
NOTE: _Entries currently have several unused optional fields intended for later features._
## Tags
**Tags** are small data objects that represent an attribute of something. A person, place, thing, concept, you name it! Tags in TagStudio allow for more sophisticated Entry organization and searching thanks to their ability to contain alternate names and spellings via `aliases`, relational organization thanks to inherent `subtags`, and more! Tags can be as simple or as powerful as you want to make them, and TagStudio aims to provide as much power to you as possible.
### Tag Object Structure (v9):
- `id`:
- ID for the Tag.
- Int, Unique, Required
- Used for internal processing
- `name`:
- The normal name of the Tag, with no shortening or specification.
- String, Required
- Doesn't have to be unique
- Each word analyzed individually
- Used for display, searching, and storing
- `shorthand`:
- The shorthand name for the Tag.
- String, Optional
- Doesn't have to be unique
- Entire string analyzed as-is
- Used for display and searching
- `aliases`:
- Alternate names for the Tag.
- List of Strings, Optional
- Recommended to be unique to this Tag
- Entire string analyzed as-is
- Used for searching
- `subtags`:
- Other Tags that make up properties of this Tag.
- List of Strings, Optional
- Used for display (first subtag only) and searching.
- `color`:
- A hex code value for customizing the Tag's display color
- String, Optional
- Used for display
### Tag Examples:
#### League of Legends
- `name`: "League of Legends"
- `shorthand`: "LoL"
- `aliases`: ["League"]
- `subtags`: ["Game", "Fantasy"]
#### Arcane
- `name`: "Arcane"
- `shorthand`: ""
- `aliases`: []
- `subtags`: ["League of Legends", "Cartoon"]
#### Jinx (LoL)
- `name`: "Jinx Piltover"
- `shorthand`: "Jinx"
- `aliases`: ["Jinxy", "Jinxy Poo"]
- `subtags`: ["League of Legends", "Arcane", "Character"]
#### Zander (Arcane)
- `name`: "Zander Zanderson"
- `shorthand`: "Zander"
- `aliases`: []
- `subtags`: ["Arcane", "Character"]
#### Mr. Legend (LoL)
- `name`: "Mr. Legend"
- `shorthand`: ""
- `aliases`: []
- `subtags`: ["League of Legends", "Character"]
### Query "League of Legends" returns results for:
- League of Legends [because of "League of Legend"'s name]
- Arcane [because of "Arcane"'s subtag]
- Jinx (LoL) [because of "Jinx Piltover"'s subtag]
- Mr. Legend (LoL) [because of "Mr. Legned (LoL)'s subtag"]
- Zander (Arcane) [because of "Zander Zanderson"'s subtag ("Arcane")'s subtag]
### Query "LoL" returns results for:
- League of Legends [because of "League of Legend"'s shorthand]
- LoL [because of "League of Legend"'s shorthand]
- Arcane [because of "Arcane"'s subtag]
- Jinx (LoL) [because of "Jinx Piltover"'s subtag]
- Mr. Legend (LoL) [because of "Mr. Legned (LoL)'s subtag"]
- Zander (Arcane) [because of "Zander Zanderson"'s subtag ("Arcane")'s subtag]
### Query "Arcane" returns results for:
- Arcane [because of "Arcane"'s name]
- Jinx (LoL) [because of "Jinx Piltover"'s subtag "Arcane"]
- Zander (Arcane) [because of "Zander Zanderson"'s subtag]
## Retrieving Entries based on Tag Cluster
By default when querying Entries, each Entry's `tags` list (stored in the form of Tag `id`s) is compared against the Tag `id`s in a given Tag cluster (list of Tag `id`s) or appended clusters in the case of multi-term queries. The type of comparison depends on the type of query and whether or not it is an inclusive or exclusive query, or a combination of both. This default searching behavior is done in _O(n)_ time, but can be sped up in the future by building indexes on certain search terms. These indexes can be stored on disk and loaded back into memory in future sessions. These indexes will also need to be updated as new Tags and Entries are added or edited.
## Missing File Resolution
1. Refresh missing file list (`refresh missing`) (Automatically run if library has few entries)
2. Fix missing files screen (`fix missing`)
### Fix Missing Files Screen
0. **Match Search** (Determines if entries can be fixed) Scans for filename in library directory
1. **Quick Fixes** (one match found, no existing entry)
2. **Match Selection** (multiple matches found)
3. **Merge Conflict Resolution** (match has existing entry)
Any remaining missing files can be listed, but they probably really are missing at this point. You can update the path and filename to point to new files if you know where they should actually be pointing to.

24
doc/index.md Normal file
View File

@@ -0,0 +1,24 @@
# Welcome to the TagStudio Documentation!
> [!WARNING]
> This documentation is still a work in progress, and is intended to aide with deconstructing and understanding of the core mechanics of TagStudio and how it operates.
<div align="center">
<img src="../github_header.png" alt="TagStudio Alpha" height="100">
<img src="https://i0.wp.com/www.bapl.org/wp-content/uploads/2019/02/old-under-construction-gif.gif" alt="Under Construction" height="100">
</div>
## Table of Contents
- [Library](/doc/library/library.md)
- [Entries](/doc/library/entry.md)
- [Fields](/doc/library/field.md)
- [Tags](/doc/library/tag.md)
- [Tools & Macros](/doc/utilities/macro.md)
- [Planned Features](/doc/updates/planned_features.md)
---
### [Database Migration](/doc/updates/db_migration.md)
The "Database Migration", "DB Migration", or "SQLite Migration" is an upcoming update to TagStudio which will replace the current JSON [library](/doc/library/library.md) with a SQL-based one, and will additionally include some fundamental changes to how some features such as [tags](/doc/library/tag.md) will work.

25
doc/library/entry.md Normal file
View File

@@ -0,0 +1,25 @@
# Entry
Entries are the units that fill a [library](/doc/library/library.md). Each one corresponds to a file, holding a reference to it along with the metadata associated with it.
### Entry Object Structure
1. `id`:
- Int, Unique, **Required**
- The ID for the Entry.
- Used for internal processing
2. `filename`:
- String, **Required**
- The filename with extension of the referenced media file.
3. `path`:
- String, **Required**, OS Agnostic
- The folder path in which the media file is located in.
4. [`fields`](/doc/library/field.md):
- List of dicts, Optional
- A list of Field ID/Value dicts.
NOTE: _Entries currently have several unused optional fields intended for later features._
## Retrieving Entries based on [Tag](/doc/library/tag.md) Cluster
By default when querying Entries, each Entry's `tags` list (stored in the form of Tag `id`s) is compared against the Tag `id`s in a given Tag cluster (list of Tag `id`s) or appended clusters in the case of multi-term queries. The type of comparison depends on the type of query and whether or not it is an inclusive or exclusive query, or a combination of both. This default searching behavior is done in _O(n)_ time, but can be sped up in the future by building indexes on certain search terms. These indexes can be stored on disk and loaded back into memory in future sessions. These indexes will also need to be updated as new Tags and Entries are added or edited.

View File

@@ -0,0 +1,3 @@
# Entry Groups (Upcoming Feature)
Entries can be grouped via tags marked as “groups” which when applied to different entries will signal TagStudio to treat those entries as a single group inside of searches and browsing.

34
doc/library/field.md Normal file
View File

@@ -0,0 +1,34 @@
# Field
Fields are the building blocks of metadata stored in [entries](/doc/library/entry.md). Fields have several base types for representing different kinds of information, including:
#### `text_line`
- A string of text, displayed as a single line.
- e.g: Title, Author, Artist, URL, etc.
#### `text_box`
- A long string of text displayed as a box of text.
- e.g: Description, Notes, etc.
#### `tag_box`
- A box of [tags](/doc/library/tag.md) defined and added by the user.
- Multiple tag boxes can be used to separate classifications of tags.
- e.g: Content Tags, Meta Tags, etc.
#### `datetime` [WIP]
- A date and time value.
- e.g: Date Created, Date Modified, Date Taken, etc.
#### `checkbox` [WIP]
- A simple two-state checkbox.
- Can be associated with a tag for quick organization.
- e.g: Archive, Favorite, etc.
#### `collation` [obsolete]
- Previously used for associating files to be used in a [collation](/doc/utilities/macro.md#create-collage), will be removed in favor of a more flexible feature in future updates.

11
doc/library/library.md Normal file
View File

@@ -0,0 +1,11 @@
# Library
The library is how TagStudio represents your chosen directory, with every file inside of it being displayed as an [entry](/doc/library/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.
Note that this means [tags](/doc/library/tag.md) you create only exist _per-library_.
### Library Contents
- [Entries](/doc/library/entry.md)
- [Fields](/doc/library/field.md)
- [Tags](/doc/library/tag.md)
- [Macros](/doc/utilities/macro.md)

85
doc/library/tag.md Normal file
View File

@@ -0,0 +1,85 @@
# Tag
Tags are user-defined attributes made up of one or more keywords, aliases, and relationships to other tags. A person, place, thing, concept, you name it! Tags allow for a more sophisticated way to organize and search [entries](/doc/library/entry.md) thanks to their aliases, parent tags, and more.
Tags can be as simple or complex as wanted, so that any user can tune TagStudio to fit their needs.
Among the things that make tags so useful, aliases give the ability to contain alternate names and spellings, making searches intuitive and expansive. Furthermore, parent-tags/subtags offer relational organization capabilities for the structuring and connection of the [library's](/doc/library/library.md) contents.
## Tag Object Structure
#### `id`
ID for the tag.
- Int, Unique, Required
- Used for internal processing
#### `name`
The normal name of the tag, with no shortening or specification.
- String, Required
- Doesn't have to be unique
- Used for display, searching, and storing
#### `shorthand`
The shorthand name for the tag. Works like an alias but is used for specific display purposes.
- String, Optional
- Doesn't have to be unique
- Used for display and searching
#### `aliases`
Alternate names for the tag.
- List of Strings, Optional
- Recommended to be unique to this tag
- Used for searching
#### `subtags`
Other Tags that make up properties of this tag. Also called "parent tags".
- List of Strings, Optional
- Used for display (first parent tag only) and searching.
#### `color`
A color name string for customizing the tag's display color
- String, Optional
- Used for display
## Tag Search Examples:
Using for example, a library of files including some tagged with the following tags:
| Tag | `name` | `shorthand` | `aliases` | `parent tags` |
| ------------------- | ------------------- | ----------- | ---------------------- | -------------------------------------------- |
| _League of Legends_ | "League of Legends" | "LoL" | ["League"] | ["Game", "Fantasy"] |
| _Arcane_ | "Arcane" | "" | [] | ["League of Legends", "Cartoon"] |
| _Jinx (LoL)_ | "Jinx Piltover" | "Jinx" | ["Jinxy", "Jinxy Poo"] | ["League of Legends", "Arcane", "Character"] |
| _Zander (Arcane)_ | "Zander Zanderson" | "Zander" | [] | ["Arcane", "Character"] |
| _Mr. Legend (LoL)_ | "Mr. Legend" | "" | [] | ["League of Legends", "Character"] |
**The query "Arcane" will display results tagged with:**
| Tag | Cause of Inclusion | Tag Tree Lineage |
| --------------- | -------------------------------- | -------------------------- |
| Arcane | Direct match of tag name | "Arcane" |
| Jinx (LoL) | Search term is set as parent tag | "Jinx (LoL) > Arcane" |
| Zander (Arcane) | Search term is set as parent tag | "Zander (Arcane) > Arcane" |
**The query "League of Legends" will display results tagged with:**
| Tag | Cause of Inclusion | Tag Tree Lineage |
| ----------------- | ------------------------------------------------------ | ---------------------------------------------- |
| League of Legends | Direct match of tag name | "League of Legends" |
| Arcane | Search term is set as parent tag | "Arcane > League of Legends" |
| Jinx (LoL) | Search term is set as parent tag | "Jinx (LoL) > League of Legends" |
| Mr. Legend (LoL) | Search term is set as parent tag | "Mr. Legend (LoL) > League of Legends" |
| Zander (Arcane) | Search term is a parent tag of a tag set as parent tag | "Zander (Arcane) > Arcane > League of Legends" |
Note: The query "LoL" will display the same results as the above example since "LoL" is the shorthand for "League of Legends".

View File

@@ -0,0 +1,3 @@
# Tag Categories (Upcoming Feature)
Replaces [Tag Fields](/doc/library/field.md#tag_box). Tags are able to be marked as a “category” which then displays as tag fields currently do, with any tags inheriting from that category being displayed underneath.

View File

@@ -0,0 +1,16 @@
# Tag Overrides (Upcoming Feature)
Tag overrides are the ability to add or remove [parent tags](/doc/library/tag.md#subtags) from a [tag](/doc/library/tag.md) on a per- [entry](/doc/library/entry.md) basis. Relies on the [Database Migration](/doc/updates/db_migration.md) update being complete.
## Examples
<figure>
<img src="../assets/tag_override_ex-1.png" alt="Example 1" height="300">
<figcaption>Ex. 1 - Comparing standard tag composition vs additive and subtractive inheritance overrides.</figcaption>
</figure>
<figure>
<img src="../assets/tag_override_ex-2.png" alt="Example 2" height="300">
<figcaption>Ex. 2 - Parent tag swap using tag overrides.</figcaption>
</figure>

View File

@@ -0,0 +1,43 @@
# Database Migration
The database migration is an upcoming refactor to TagStudio's library data storage system. The database will be migrated from a JSON-based one to a SQLite-based one. Part of this migration will include a reworked schema, which will allow for several new features and changes to how [tags](/doc/library/tag.md) and [fields](/doc/library/field.md) operate.
## Schema
<img src="../assets/db_schema.png" alt="Database Schema" width="500">
### `alias` Table
_Description TBA_
### `entry` Table
_Description TBA_
### `entry_attribute` Table
_Description TBA_
### `entry_page` Table
_Description TBA_
### `location` Table
_Description TBA_
### `tag` Table
_Description TBA_
### `tag_relation` Table
_Description TBA_
## Resulting New Features and Changes
- Multiple Directory Support
- [Tag Categories](/doc/library/tag_categories.md) (Replaces [Tag Fields](/doc/library/field.md#tag_box))
- [Tag Overrides](/doc/library/tag_overrides.md)
- User-Defined [Fields](/doc/library/field.md)
- Tag Icons

View File

@@ -0,0 +1,59 @@
# Planned Features
The following lists outline the planned major and minor features for TagStudio, in no particular order.
# Major Features
- [SQL Database Migration](/doc/updates/db_migration.md)
- Multiple Directory Support
- [Tags Categories](/doc/library/tag_categories.md)
- [Entry Groups](/doc/library/entry_groups.md)
- [Tag Overrides](/doc/library/tag_overrides.md)
- Tagging Panel
- Top Tags
- Recent Tags
- Tag Search
- Pinned Tags
- Configurable Default Fields (May be part of [Macros](/doc/utilities/macro.md))
- Deep File Extension Control
- Settings Menu
- Custom User Colors
- Search Engine Rework
- Boolean Search
- Tag Objects In Search
- Search For Fields
- Sortable Search Results
- Automatic Entry Relinking
- Detect Renames
- Detect Moves
- Thumbnail Caching
- User-Defined Fields
- Exportable Library/Tag Data
- Exportable Human-Readable Library
- Exportable/Importable Human-Readable “Tag Packs”
- Exportable/Importable Color Palettes
- Configurable Thumbnail Labels
- Toggle Extension Label
- Toggle File Size Label
- Configurable Thumbnail Tag Badges
- Customize tags that appear instead of just “Archive” and “Favorite”
- OCR Search
## Minor Features
- Deleting Tags
- Merging Tags
- Tag Icons
- Tag/Field Copy + Paste
- Collage UI
- Resizable Thumbnail Grid
- Draggable Files Outside The Program
- File Property Caching
- 3D Previews
- Audio Waveform Previews
- Toggle Between Waveform And Album Artwork
- PDF Previews
- SVG Previews
- Full Video Player
- Duration Properties For Video + Audio Files
- Optional Starter Tag Packs

43
doc/utilities/macro.md Normal file
View File

@@ -0,0 +1,43 @@
# Tools & Macros
Tools and macros are features that serve to create a more fluid [library](/doc/library/library.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](/doc/library/entry.md), and some options for their resolution.
1. Refresh
- Scans through the library and updates the unlinked entry count.
2. Search & Relink
- Attempts to automatically find and reassign missing files.
3. 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.
1. Load DupeGuru File
- load the "results" file created from a DupeGuru scan
2. 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](/doc/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 future update.
### Sort fields
Tool is in development, will allow for user-defined sorting of [fields](/doc/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](/doc/library/tag.md#subtags). Tags will initially be named after the folders, but can be fully edited and customized afterwards.

563
flake.lock generated Normal file
View File

@@ -0,0 +1,563 @@
{
"nodes": {
"cachix": {
"inputs": {
"devenv": "devenv_2",
"flake-compat": [
"devenv",
"flake-compat"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"pre-commit-hooks": [
"devenv",
"pre-commit-hooks"
]
},
"locked": {
"lastModified": 1712055811,
"narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=",
"owner": "cachix",
"repo": "cachix",
"rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "cachix",
"type": "github"
}
},
"devenv": {
"inputs": {
"cachix": "cachix",
"flake-compat": "flake-compat_2",
"nix": "nix_2",
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1724763216,
"narHash": "sha256-oW2bwCrJpIzibCNK6zfIDaIQw765yMAuMSG2gyZfGv0=",
"owner": "cachix",
"repo": "devenv",
"rev": "1e4ef61205b9aa20fe04bf1c468b6a316281c4f1",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"devenv-root": {
"flake": false,
"locked": {
"narHash": "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=",
"type": "file",
"url": "file:///dev/null"
},
"original": {
"type": "file",
"url": "file:///dev/null"
}
},
"devenv_2": {
"inputs": {
"flake-compat": [
"devenv",
"cachix",
"flake-compat"
],
"nix": "nix",
"nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix",
"pre-commit-hooks": [
"devenv",
"cachix",
"pre-commit-hooks"
]
},
"locked": {
"lastModified": 1708704632,
"narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=",
"owner": "cachix",
"repo": "devenv",
"rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "python-rewrite",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1725024810,
"narHash": "sha256-ODYRm8zHfLTH3soTFWE452ydPYz2iTvr9T8ftDMUQ3E=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "af510d4a62d071ea13925ce41c95e3dec816c01d",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"devenv",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1712911606,
"narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=",
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "devenv-2.21",
"repo": "nix",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688870561,
"narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "165b1650b753316aa7f1787f3005a8d2da0f5301",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix2container": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1724996935,
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
"owner": "nlewo",
"repo": "nix2container",
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
"type": "github"
},
"original": {
"owner": "nlewo",
"repo": "nix2container",
"type": "github"
}
},
"nix_2": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression_2"
},
"locked": {
"lastModified": 1712911606,
"narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=",
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "devenv-2.21",
"repo": "nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1692808169,
"narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9201b5ff357e781bf014d0330d18555695df7ba8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-qt6": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-regression_2": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1713361204,
"narHash": "sha256-TA6EDunWTkc5FvDCqU3W2T3SFn0gRZqh6D/hJnM02MM=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1724819573,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils",
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1692876271,
"narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1713775815,
"narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"devenv-root": "devenv-root",
"flake-parts": "flake-parts",
"nix2container": "nix2container",
"nixpkgs": "nixpkgs_3",
"nixpkgs-qt6": "nixpkgs-qt6",
"systems": "systems_4"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

208
flake.nix Normal file
View File

@@ -0,0 +1,208 @@
{
description = "TagStudio";
inputs = {
devenv.url = "github:cachix/devenv";
devenv-root = {
url = "file+file:///dev/null";
flake = false;
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
nix2container = {
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Pinned to Qt version 6.7.1
nixpkgs-qt6.url = "github:NixOS/nixpkgs/e6cea36f83499eb4e9cd184c8a8e823296b50ad5";
systems.url = "github:nix-systems/default-linux";
};
outputs =
{
flake-parts,
nixpkgs,
nixpkgs-qt6,
self,
systems,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.devenv.flakeModule ];
systems = import systems;
perSystem =
{
config,
pkgs,
system,
...
}:
let
inherit (nixpkgs) lib;
qt6Pkgs = import nixpkgs-qt6 { inherit system; };
in
{
formatter = pkgs.nixfmt-rfc-style;
devenv.shells = rec {
default = tagstudio;
tagstudio =
let
cfg = config.devenv.shells.tagstudio;
in
{
# NOTE: many things were simply transferred over from previous,
# there must be additional work in ensuring all relevant dependencies
# are in place (and no extraneous). I have already spent much
# work making this in the first place and just need to get it out
# there, especially after my promises. Would appreciate any help
# (possibly PRs!) on taking care of this. Otherwise, just expect
# this to get ironed out over time.
#
# Thank you! -Xarvex
devenv.root =
let
devenvRoot = builtins.readFile inputs.devenv-root.outPath;
in
# If not overriden (/dev/null), --impure is necessary.
pkgs.lib.mkIf (devenvRoot != "") devenvRoot;
name = "TagStudio";
# Derived from previous flake iteration.
packages =
(with pkgs; [
cmake
binutils
coreutils
dbus
fontconfig
freetype
gdb
glib
libGL
libGLU
libgcc
libxkbcommon
mypy
ruff
xorg.libxcb
zstd
])
++ (with qt6Pkgs; [
qt6.full
qt6.qtbase
qt6.qtwayland
qtcreator
]);
enterShell =
let
setQtEnv =
pkgs.runCommand "set-qt-env"
{
buildInputs = with qt6Pkgs.qt6; [
qtbase
];
nativeBuildInputs =
(with pkgs; [
makeShellWrapper
])
++ (with qt6Pkgs.qt6; [
wrapQtAppsHook
]);
}
''
makeShellWrapper "$(type -p sh)" "$out" "''${qtWrapperArgs[@]}"
sed "/^exec/d" -i "$out"
'';
in
''
source ${setQtEnv}
'';
scripts.tagstudio.exec = ''
python ${cfg.devenv.root}/tagstudio/tag_studio.py
'';
env = {
QT_QPA_PLATFORM = "wayland;xcb";
# Derived from previous flake iteration.
# Not desired given LD_LIBRARY_PATH pollution.
# See supposed alternative below, further research required.
LD_LIBRARY_PATH = lib.makeLibraryPath (
(with pkgs; [
dbus
fontconfig
freetype
gcc-unwrapped
glib
libglvnd
libkrb5
libpulseaudio
libva
libxkbcommon
openssl
stdenv.cc.cc.lib
wayland
xorg.libxcb
xorg.libXrandr
zlib
zstd
])
++ (with qt6Pkgs.qt6; [
qtbase
qtwayland
full
])
);
};
languages.python = {
enable = true;
venv = {
enable = true;
quiet = true;
requirements =
let
excludeDeps =
req: deps:
builtins.concatStringsSep "\n" (
builtins.filter (line: !(lib.any (elem: lib.hasPrefix elem line) deps)) (lib.splitString "\n" req)
);
in
''
${builtins.readFile ./requirements.txt}
${excludeDeps (builtins.readFile ./requirements-dev.txt) [
"mypy"
"ruff"
]}
'';
};
# Should be able to replace LD_LIBRARY_PATH?
# Was not quite able to get working,
# will be consulting cachix community. -Xarvex
# libraries = with pkgs; [ ];
};
};
};
};
};
}

9
pyproject.toml Normal file
View File

@@ -0,0 +1,9 @@
[tool.ruff]
exclude = ["main_window.py", "home_ui.py", "resources.py", "resources_rc.py", "**/vendored/"]
[tool.mypy]
strict_optional = false
disable_error_code = ["union-attr", "annotation-unchecked", "import-untyped"]
explicit_package_bases = true
warn_unused_ignores = true
exclude = ['tests', 'src/qt/helpers/vendored']

6
requirements-dev.txt Normal file
View File

@@ -0,0 +1,6 @@
ruff==0.4.2
pre-commit==3.7.0
pytest==8.2.0
Pyinstaller==6.6.0
mypy==1.10.0
syrupy==4.6.1

View File

@@ -1,12 +1,18 @@
click==8.1.3
climage==0.1.3
humanfriendly==10.0
opencv_python==4.8.0.74
opencv_python>=4.8.0.74,<=4.9.0.80
Pillow==10.3.0
pillow_avif_plugin==1.3.1
PySide6==6.5.1.1
PySide6_Addons==6.5.1.1
PySide6_Essentials==6.5.1.1
Requests==2.31.0
typing_extensions==3.10.0.0
ujson==5.8.0
PySide6==6.7.1
PySide6_Addons==6.7.1
PySide6_Essentials==6.7.1
typing_extensions>=3.10.0.0,<=4.11.0
ujson>=5.8.0,<=5.9.0
numpy==1.26.4
rawpy==0.21.0
pillow-heif==0.16.0
chardet==5.2.0
pydub==0.25.1
mutagen==1.47.0
numpy==1.26.4
ffmpeg-python==0.2.0
Send2Trash==1.8.3
vtf2img==0.1.0

View File

@@ -1,2 +1,2 @@
@echo off
.venv\Scripts\python.exe .\TagStudio\tagstudio.py --ui qt %*
.venv\Scripts\python.exe .\TagStudio\tag_studio.py --ui qt %*

86
tagstudio.spec Normal file
View File

@@ -0,0 +1,86 @@
# -*- mode: python ; coding: utf-8 -*-
# vi: ft=python
from argparse import ArgumentParser
import sys
from PyInstaller.building.api import COLLECT, EXE, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.osx import BUNDLE
parser = ArgumentParser()
parser.add_argument('--portable', action='store_true')
options = parser.parse_args()
name = 'TagStudio' if sys.platform == 'win32' else 'tagstudio'
icon = None
if sys.platform == 'win32':
icon = 'tagstudio/resources/icon.ico'
elif sys.platform == 'darwin':
icon = 'tagstudio/resources/icon.icns'
a = Analysis(
['tagstudio/tag_studio.py'],
pathex=[],
binaries=[],
datas=[('tagstudio/resources', 'resources'), ('tagstudio/src', 'src')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
excludes=[],
runtime_hooks=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
include = [a.scripts]
if options.portable:
include += (a.binaries, a.datas)
exe = EXE(
pyz,
*include,
[],
bootloader_ignore_signals=False,
console=False,
hide_console='hide-early',
disable_windowed_traceback=False,
debug=False,
name=name,
exclude_binaries=not options.portable,
icon=icon,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None
)
coll = None if options.portable else COLLECT(
exe,
a.binaries,
a.datas,
name=name,
strip=False,
upx=True,
upx_exclude=[],
)
app = BUNDLE(
exe if coll is None else coll,
name='TagStudio.app',
icon=icon,
bundle_identifier='com.github.tagstudiodev',
version='0.0.0',
info_plist={
'NSAppleScriptEnabled': False,
'NSPrincipalClass': 'NSApplication',
}
)

View File

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 KiB

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 KiB

After

Width:  |  Height:  |  Size: 677 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="#ffffff"><path d="M560-200v-560h160v560H560Zm-320 0v-560h160v560H240Z"/></svg>

After

Width:  |  Height:  |  Size: 172 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="#ffffff"><path d="M320-200v-560l440 280-440 280Z"/></svg>

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

After

Width:  |  Height:  |  Size: 397 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="#ffffff"><path d="M560-131v-82q90-26 145-100t55-168q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm440 40v-322q47 22 73.5 66t26.5 96q0 51-26.5 94.5T560-320Z"/></svg>

After

Width:  |  Height:  |  Size: 327 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="#ffffff"><path d="M792-56 671-177q-25 16-53 27.5T560-131v-82q14-5 27.5-10t25.5-12L480-368v208L280-360H120v-240h128L56-792l56-56 736 736-56 56Zm-8-232-58-58q17-31 25.5-65t8.5-70q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 53-14.5 102T784-288ZM650-422l-90-90v-130q47 22 73.5 66t26.5 96q0 15-2.5 29.5T650-422ZM480-592 376-696l104-104v208Z"/></svg>

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
VERSION: str = "9.4.1" # Major.Minor.Patch
VERSION_BRANCH: str = "" # Usually "" or "Pre-Release"
# The folder & file names where TagStudio keeps its data relative to a library.
TS_FOLDER_NAME: str = ".TagStudio"
BACKUP_FOLDER_NAME: str = "backups"
COLLAGE_FOLDER_NAME: str = "collages"
LIBRARY_FILENAME: str = "ts_library.json"
FONT_SAMPLE_TEXT: str = (
"""ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!?@$%(){}[]"""
)
FONT_SAMPLE_SIZES: list[int] = [10, 15, 20]
BOX_FIELDS = ["tag_box", "text_box"]
TEXT_FIELDS = ["text_line", "text_box"]
DATE_FIELDS = ["datetime"]
TAG_COLORS = [
"",
"black",
"dark gray",
"gray",
"light gray",
"white",
"light pink",
"pink",
"red",
"red orange",
"orange",
"yellow orange",
"yellow",
"lime",
"light green",
"mint",
"green",
"teal",
"cyan",
"light blue",
"blue",
"blue violet",
"violet",
"purple",
"lavender",
"berry",
"magenta",
"salmon",
"auburn",
"dark brown",
"brown",
"light brown",
"blonde",
"peach",
"warm gray",
"cool gray",
"olive",
]
TAG_FAVORITE = 1
TAG_ARCHIVED = 0

View File

@@ -0,0 +1,41 @@
import enum
class SettingItems(str, enum.Enum):
"""List of setting item names."""
START_LOAD_LAST = "start_load_last"
LAST_LIBRARY = "last_library"
LIBS_LIST = "libs_list"
WINDOW_SHOW_LIBS = "window_show_libs"
AUTOPLAY = "autoplay_videos"
class Theme(str, enum.Enum):
COLOR_BG_DARK = "#65000000"
COLOR_BG_LIGHT = "#22000000"
COLOR_DARK_LABEL = "#DD000000"
COLOR_HOVER = "#65AAAAAA"
COLOR_PRESSED = "#65EEEEEE"
COLOR_DISABLED = "#65F39CAA"
COLOR_DISABLED_BG = "#65440D12"
class SearchMode(int, enum.Enum):
"""Operational modes for item searching."""
AND = 0
OR = 1
class FieldID(int, enum.Enum):
TITLE = 0
AUTHOR = 1
ARTIST = 2
DESCRIPTION = 4
NOTES = 5
TAGS = 6
CONTENT_TAGS = 7
META_TAGS = 8
DATE_PUBLISHED = 14
SOURCE = 21

View File

@@ -2,6 +2,7 @@
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
class FieldTemplate:
"""A TagStudio Library Field Template object."""
@@ -11,17 +12,17 @@ class FieldTemplate:
self.type = type
def __str__(self) -> str:
return f'\nID: {self.id}\nName: {self.name}\nType: {self.type}\n'
return f"\nID: {self.id}\nName: {self.name}\nType: {self.type}\n"
def __repr__(self) -> str:
return self.__str__()
def to_compressed_obj(self) -> dict:
"""An alternative to __dict__ that only includes fields containing non-default data."""
obj = {}
obj: dict = {}
# All Field fields (haha) are mandatory, so no value checks are done.
obj['id'] = self.id
obj['name'] = self.name
obj['type'] = self.type
obj["id"] = self.id
obj["name"] = self.name
obj["type"] = self.type
return obj

View File

@@ -0,0 +1,42 @@
from typing import TypedDict
from typing_extensions import NotRequired
class JsonLibary(TypedDict("", {"ts-version": str})):
# "ts-version": str
tags: "list[JsonTag]"
collations: "list[JsonCollation]"
fields: list # TODO
macros: "list[JsonMacro]"
entries: "list[JsonEntry]"
ext_list: list[str]
is_exclude_list: bool
ignored_extensions: NotRequired[list[str]] # deprecated
class JsonBase(TypedDict):
id: int
class JsonTag(JsonBase, total=False):
name: str
aliases: list[str]
color: str
shorthand: str
subtag_ids: list[int]
class JsonCollation(JsonBase, total=False):
title: str
e_ids_and_pages: list[list[int]]
sort_order: str
cover_id: int
class JsonEntry(JsonBase, total=False):
filename: str
path: str
fields: list[dict] # TODO
class JsonMacro(JsonBase, total=False): ... # TODO

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,486 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
import logging
import mimetypes
from enum import Enum
from pathlib import Path
logging.basicConfig(format="%(message)s", level=logging.INFO)
class MediaType(str, Enum):
"""Names of media types."""
ADOBE_PHOTOSHOP: str = "adobe_photoshop"
AFFINITY_PHOTO: str = "affinity_photo"
ARCHIVE: str = "archive"
AUDIO_MIDI: str = "audio_midi"
AUDIO: str = "audio"
BLENDER: str = "blender"
DATABASE: str = "database"
DISK_IMAGE: str = "disk_image"
DOCUMENT: str = "document"
FONT: str = "font"
IMAGE_ANIMATED: str = "image_animated"
IMAGE_RAW: str = "image_raw"
IMAGE_VECTOR: str = "image_vector"
IMAGE: str = "image"
INSTALLER: str = "installer"
MATERIAL: str = "material"
MODEL: str = "model"
PACKAGE: str = "package"
PDF: str = "pdf"
PLAINTEXT: str = "plaintext"
PRESENTATION: str = "presentation"
PROGRAM: str = "program"
SHORTCUT: str = "shortcut"
SOURCE_ENGINE: str = "source_engine"
SPREADSHEET: str = "spreadsheet"
TEXT: str = "text"
VIDEO: str = "video"
class MediaCategory:
"""An object representing a category of media. Includes a MediaType identifier,
extensions set, and IANA status flag.
Args:
media_type (MediaType): The MediaType Enum representing this category.
extensions (set[str]): The set of file extensions associated with this category.
Includes leading ".", all lowercase, and does not need to be unique to this category.
is_iana (bool): Represents whether or not this is an IANA registered category.
"""
def __init__(
self,
media_type: MediaType,
extensions: set[str],
is_iana: bool = False,
) -> None:
self.media_type: MediaType = media_type
self.extensions: set[str] = extensions
self.is_iana: bool = is_iana
class MediaCategories:
"""Contains pre-made MediaCategory objects as well as methods to interact with them."""
# These sets are used either individually or together to form the final sets
# for the MediaCategory(s).
# These sets may be combined and are NOT 1:1 with the final categories.
_ADOBE_PHOTOSHOP_SET: set[str] = {
".pdd",
".psb",
".psd",
}
_AFFINITY_PHOTO_SET: set[str] = {".afphoto"}
_ARCHIVE_SET: set[str] = {
".7z",
".gz",
".rar",
".s7z",
".tar",
".tgz",
".zip",
}
_AUDIO_MIDI_SET: set[str] = {
".mid",
".midi",
}
_AUDIO_SET: set[str] = {
".aac",
".aif",
".aiff",
".alac",
".flac",
".m4a",
".m4p",
".mp3",
".mpeg4",
".ogg",
".wav",
".wma",
}
_BLENDER_SET: set[str] = {
".blen_tc",
".blend",
".blend1",
".blend10",
".blend11",
".blend12",
".blend13",
".blend14",
".blend15",
".blend16",
".blend17",
".blend18",
".blend19",
".blend2",
".blend20",
".blend21",
".blend22",
".blend23",
".blend24",
".blend25",
".blend26",
".blend27",
".blend28",
".blend29",
".blend3",
".blend30",
".blend31",
".blend32",
".blend4",
".blend5",
".blend6",
".blend7",
".blend8",
".blend9",
}
_DATABASE_SET: set[str] = {
".accdb",
".mdb",
".sqlite",
}
_DISK_IMAGE_SET: set[str] = {".bios", ".dmg", ".iso"}
_DOCUMENT_SET: set[str] = {
".doc",
".docm",
".docx",
".dot",
".dotm",
".dotx",
".odt",
".pages",
".pdf",
".rtf",
".tex",
".wpd",
".wps",
}
_FONT_SET: set[str] = {
".fon",
".otf",
".ttc",
".ttf",
".woff",
".woff2",
}
_IMAGE_ANIMATED_SET: set[str] = {
".apng",
".gif",
".webp",
".jxl",
}
_IMAGE_RAW_SET: set[str] = {
".arw",
".cr2",
".cr3",
".crw",
".dng",
".nef",
".orf",
".raf",
".raw",
".rw2",
}
_IMAGE_VECTOR_SET: set[str] = {".svg"}
_IMAGE_SET: set[str] = {
".apng",
".avif",
".bmp",
".exr",
".gif",
".heic",
".heif",
".j2k",
".jfif",
".jp2",
".jpeg_large",
".jpeg",
".jpg_large",
".jpg",
".jpg2",
".jxl",
".png",
".psb",
".psd",
".tif",
".tiff",
".webp",
}
_INSTALLER_SET: set[str] = {".appx", ".msi", ".msix"}
_MATERIAL_SET: set[str] = {".mtl"}
_MODEL_SET: set[str] = {".3ds", ".fbx", ".obj", ".stl"}
_PACKAGE_SET: set[str] = {
".aab",
".akp",
".apk",
".apkm",
".apks",
".pkg",
".xapk",
}
_PDF_SET: set[str] = {
".pdf",
}
_PLAINTEXT_SET: set[str] = {
".bat",
".css",
".csv",
".htm",
".html",
".ini",
".js",
".json",
".jsonc",
".md",
".php",
".plist",
".prefs",
".sh",
".ts",
".txt",
".xml",
".vmt",
".fgd",
".nut",
".cfg",
".conf",
".vdf",
".vcfg",
".gi",
".inf",
".vqlayout",
".qss",
".vsc",
".kv3",
".vsnd_template",
}
_PRESENTATION_SET: set[str] = {
".key",
".odp",
".ppt",
".pptx",
}
_PROGRAM_SET: set[str] = {".app", ".exe"}
_SOURCE_ENGINE_SET: set[str] = {
".vtf",
}
_SHORTCUT_SET: set[str] = {".desktop", ".lnk", ".url"}
_SPREADSHEET_SET: set[str] = {
".csv",
".numbers",
".ods",
".xls",
".xlsx",
}
_VIDEO_SET: set[str] = {
".3gp",
".avi",
".flv",
".gifv",
".hevc",
".m4p",
".m4v",
".mkv",
".mov",
".mp4",
".webm",
".wmv",
}
ADOBE_PHOTOSHOP_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.ADOBE_PHOTOSHOP,
extensions=_ADOBE_PHOTOSHOP_SET,
is_iana=False,
)
AFFINITY_PHOTO_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.AFFINITY_PHOTO,
extensions=_AFFINITY_PHOTO_SET,
is_iana=False,
)
ARCHIVE_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.ARCHIVE,
extensions=_ARCHIVE_SET,
is_iana=False,
)
AUDIO_MIDI_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.AUDIO_MIDI,
extensions=_AUDIO_MIDI_SET,
is_iana=False,
)
AUDIO_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.AUDIO,
extensions=_AUDIO_SET | _AUDIO_MIDI_SET,
is_iana=True,
)
BLENDER_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.BLENDER,
extensions=_BLENDER_SET,
is_iana=False,
)
DATABASE_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.DATABASE,
extensions=_DATABASE_SET,
is_iana=False,
)
DISK_IMAGE_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.DISK_IMAGE,
extensions=_DISK_IMAGE_SET,
is_iana=False,
)
DOCUMENT_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.DOCUMENT,
extensions=_DOCUMENT_SET,
is_iana=False,
)
FONT_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.FONT,
extensions=_FONT_SET,
is_iana=True,
)
IMAGE_ANIMATED_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.IMAGE_ANIMATED,
extensions=_IMAGE_ANIMATED_SET,
is_iana=False,
)
IMAGE_RAW_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.IMAGE_RAW,
extensions=_IMAGE_RAW_SET,
is_iana=False,
)
IMAGE_VECTOR_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.IMAGE_VECTOR,
extensions=_IMAGE_VECTOR_SET,
is_iana=False,
)
IMAGE_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.IMAGE,
extensions=_IMAGE_SET | _IMAGE_RAW_SET | _IMAGE_VECTOR_SET,
is_iana=True,
)
INSTALLER_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.INSTALLER,
extensions=_INSTALLER_SET,
is_iana=False,
)
MATERIAL_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.MATERIAL,
extensions=_MATERIAL_SET,
is_iana=False,
)
MODEL_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.MODEL,
extensions=_MODEL_SET,
is_iana=True,
)
PACKAGE_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.PACKAGE,
extensions=_PACKAGE_SET,
is_iana=False,
)
PDF_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.PDF,
extensions=_PDF_SET,
is_iana=False,
)
PLAINTEXT_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.PLAINTEXT,
extensions=_PLAINTEXT_SET,
is_iana=False,
)
PRESENTATION_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.PRESENTATION,
extensions=_PRESENTATION_SET,
is_iana=False,
)
PROGRAM_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.PROGRAM,
extensions=_PROGRAM_SET,
is_iana=False,
)
SHORTCUT_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.SHORTCUT,
extensions=_SHORTCUT_SET,
is_iana=False,
)
SOURCE_ENGINE_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.SOURCE_ENGINE,
extensions=_SOURCE_ENGINE_SET,
is_iana=False,
)
SPREADSHEET_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.SPREADSHEET,
extensions=_SPREADSHEET_SET,
is_iana=False,
)
TEXT_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.TEXT,
extensions=_DOCUMENT_SET | _PLAINTEXT_SET,
is_iana=True,
)
VIDEO_TYPES: MediaCategory = MediaCategory(
media_type=MediaType.VIDEO,
extensions=_VIDEO_SET,
is_iana=True,
)
ALL_CATEGORIES: list[MediaCategory] = [
ADOBE_PHOTOSHOP_TYPES,
AFFINITY_PHOTO_TYPES,
ARCHIVE_TYPES,
AUDIO_MIDI_TYPES,
AUDIO_TYPES,
BLENDER_TYPES,
DATABASE_TYPES,
DISK_IMAGE_TYPES,
DOCUMENT_TYPES,
FONT_TYPES,
IMAGE_ANIMATED_TYPES,
IMAGE_RAW_TYPES,
IMAGE_TYPES,
IMAGE_VECTOR_TYPES,
INSTALLER_TYPES,
MATERIAL_TYPES,
MODEL_TYPES,
PACKAGE_TYPES,
PDF_TYPES,
PLAINTEXT_TYPES,
PRESENTATION_TYPES,
PROGRAM_TYPES,
SHORTCUT_TYPES,
SOURCE_ENGINE_TYPES,
SPREADSHEET_TYPES,
TEXT_TYPES,
VIDEO_TYPES,
]
@staticmethod
def get_types(ext: str, mime_fallback: bool = False) -> set[MediaType]:
"""Returns a set of MediaTypes given a file extension.
Args:
ext (str): File extension with a leading "." and in all lowercase.
mime_fallback (bool): Flag to guess MIME type if no set matches are made.
"""
types: set[MediaType] = set()
mime_guess: bool = False
for cat in MediaCategories.ALL_CATEGORIES:
if ext in cat.extensions:
types.add(cat.media_type)
elif mime_fallback and cat.is_iana:
type: str = mimetypes.guess_type(Path("x" + ext), strict=False)[0]
if type and type.startswith(cat.media_type.value):
types.add(cat.media_type)
mime_guess = True
# logging.info(
# f"({ext}) Media Categories Found: {[x.value for x in types]}{' (MIME)' if mime_guess else ''}"
# )
return types

View File

@@ -5,7 +5,7 @@
from enum import Enum
class ColorType(Enum):
class ColorType(int, Enum):
PRIMARY = 0
TEXT = 1
BORDER = 2
@@ -13,240 +13,322 @@ class ColorType(Enum):
DARK_ACCENT = 4
_TAG_COLORS = {
'': {ColorType.PRIMARY: '#1E1A33',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#2B2547',
ColorType.LIGHT_ACCENT: '#CDA7F7',
ColorType.DARK_ACCENT: '#1E1A33',
},
'black': {ColorType.PRIMARY: '#111018',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#18171e',
ColorType.LIGHT_ACCENT: '#b7b6be',
ColorType.DARK_ACCENT: '#03020a',
},
'dark gray': {ColorType.PRIMARY: '#24232a',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#2a2930',
ColorType.LIGHT_ACCENT: '#bdbcc4',
ColorType.DARK_ACCENT: '#07060e',
},
'gray': {ColorType.PRIMARY: '#53525a',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#5b5a62',
ColorType.LIGHT_ACCENT: '#cbcad2',
ColorType.DARK_ACCENT: '#191820',
},
'light gray': {ColorType.PRIMARY: '#aaa9b0',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#b6b4bc',
ColorType.LIGHT_ACCENT: '#cbcad2',
ColorType.DARK_ACCENT: '#191820',
},
'white': {ColorType.PRIMARY: '#f2f1f8',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#fefeff',
ColorType.LIGHT_ACCENT: '#ffffff',
ColorType.DARK_ACCENT: '#302f36',
},
'light pink': {ColorType.PRIMARY: '#ff99c4',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#ffaad0',
ColorType.LIGHT_ACCENT: '#ffcbe7',
ColorType.DARK_ACCENT: '#6c2e3b',
},
'pink': {ColorType.PRIMARY: '#ff99c4',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#ffaad0',
ColorType.LIGHT_ACCENT: '#ffcbe7',
ColorType.DARK_ACCENT: '#6c2e3b',
},
'magenta': {ColorType.PRIMARY: '#f6466f',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#f7587f',
ColorType.LIGHT_ACCENT: '#fba4bf',
ColorType.DARK_ACCENT: '#61152f',
},
'red': {ColorType.PRIMARY: '#e22c3c',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#b21f2d',
# ColorType.BORDER: '#e54252',
ColorType.LIGHT_ACCENT: '#f39caa',
ColorType.DARK_ACCENT: '#440d12',
},
'red orange': {ColorType.PRIMARY: '#e83726',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#ea4b3b',
ColorType.LIGHT_ACCENT: '#f5a59d',
ColorType.DARK_ACCENT: '#61120b',
},
'salmon': {ColorType.PRIMARY: '#f65848',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#f76c5f',
ColorType.LIGHT_ACCENT: '#fcadaa',
ColorType.DARK_ACCENT: '#6f1b16',
},
'orange': {ColorType.PRIMARY: '#ed6022',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#ef7038',
ColorType.LIGHT_ACCENT: '#f7b79b',
ColorType.DARK_ACCENT: '#551e0a',
},
'yellow orange': {ColorType.PRIMARY: '#fa9a2c',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#fba94b',
ColorType.LIGHT_ACCENT: '#fdd7ab',
ColorType.DARK_ACCENT: '#66330d',
},
'yellow': {ColorType.PRIMARY: '#ffd63d',
ColorType.TEXT: ColorType.DARK_ACCENT,
# ColorType.BORDER: '#ffe071',
ColorType.BORDER: '#e8af31',
ColorType.LIGHT_ACCENT: '#fff3c4',
ColorType.DARK_ACCENT: '#754312',
},
'mint': {ColorType.PRIMARY: '#4aed90',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#79f2b1',
ColorType.LIGHT_ACCENT: '#c8fbe9',
ColorType.DARK_ACCENT: '#164f3e',
},
'lime': {ColorType.PRIMARY: '#92e649',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#b2ed72',
ColorType.LIGHT_ACCENT: '#e9f9b7',
ColorType.DARK_ACCENT: '#405516',
},
'light green': {ColorType.PRIMARY: '#85ec76',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#a3f198',
ColorType.LIGHT_ACCENT: '#e7fbe4',
ColorType.DARK_ACCENT: '#2b5524',
},
'green': {ColorType.PRIMARY: '#28bb48',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#43c568',
ColorType.LIGHT_ACCENT: '#93e2c8',
ColorType.DARK_ACCENT: '#0d3828',
},
'teal': {ColorType.PRIMARY: '#1ad9b2',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#4de3c7',
ColorType.LIGHT_ACCENT: '#a0f3e8',
ColorType.DARK_ACCENT: '#08424b',
},
'cyan': {ColorType.PRIMARY: '#49e4d5',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#76ebdf',
ColorType.LIGHT_ACCENT: '#bff5f0',
ColorType.DARK_ACCENT: '#0f4246',
},
'light blue': {ColorType.PRIMARY: '#55bbf6',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#70c6f7',
ColorType.LIGHT_ACCENT: '#bbe4fb',
ColorType.DARK_ACCENT: '#122541',
},
'blue': {ColorType.PRIMARY: '#3b87f0',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#4e95f2',
ColorType.LIGHT_ACCENT: '#aedbfa',
ColorType.DARK_ACCENT: '#122948',
},
'blue violet': {ColorType.PRIMARY: '#5948f2',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#6258f3',
ColorType.LIGHT_ACCENT: '#9cb8fb',
ColorType.DARK_ACCENT: '#1b1649',
},
'violet': {ColorType.PRIMARY: '#874ff5',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#9360f6',
ColorType.LIGHT_ACCENT: '#c9b0fa',
ColorType.DARK_ACCENT: '#3a1860',
},
'purple': {ColorType.PRIMARY: '#bb4ff0',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#c364f2',
ColorType.LIGHT_ACCENT: '#dda7f7',
ColorType.DARK_ACCENT: '#531862',
},
'peach': {ColorType.PRIMARY: '#f1c69c',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#f4d4b4',
ColorType.LIGHT_ACCENT: '#fbeee1',
ColorType.DARK_ACCENT: '#613f2f',
},
'brown': {ColorType.PRIMARY: '#823216',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#8a3e22',
ColorType.LIGHT_ACCENT: '#cd9d83',
ColorType.DARK_ACCENT: '#3a1804',
},
'lavender': {ColorType.PRIMARY: '#ad8eef',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#b99ef2',
ColorType.LIGHT_ACCENT: '#d5c7fa',
ColorType.DARK_ACCENT: '#492b65',
},
'blonde': {ColorType.PRIMARY: '#efc664',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#f3d387',
ColorType.LIGHT_ACCENT: '#faebc6',
ColorType.DARK_ACCENT: '#6d461e',
},
'auburn': {ColorType.PRIMARY: '#a13220',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#aa402f',
ColorType.LIGHT_ACCENT: '#d98a7f',
ColorType.DARK_ACCENT: '#3d100a',
},
'light brown': {ColorType.PRIMARY: '#be5b2d',
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: '#c4693d',
ColorType.LIGHT_ACCENT: '#e5b38c',
ColorType.DARK_ACCENT: '#4c290e',
},
'dark brown': {ColorType.PRIMARY: '#4c2315',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#542a1c',
ColorType.LIGHT_ACCENT: '#b78171',
ColorType.DARK_ACCENT: '#211006',
},
'cool gray': {ColorType.PRIMARY: '#515768',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#5b6174',
ColorType.LIGHT_ACCENT: '#9ea1c3',
ColorType.DARK_ACCENT: '#181a37',
},
'warm gray': {ColorType.PRIMARY: '#625550',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#6c5e57',
ColorType.LIGHT_ACCENT: '#c0a392',
ColorType.DARK_ACCENT: '#371d18',
},
'olive': {ColorType.PRIMARY: '#4c652e',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#586f36',
ColorType.LIGHT_ACCENT: '#b4c17a',
ColorType.DARK_ACCENT: '#23300e',
},
'berry': {ColorType.PRIMARY: '#9f2aa7',
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: '#aa43b4',
ColorType.LIGHT_ACCENT: '#cc8fdc',
ColorType.DARK_ACCENT: '#41114a',
},
_TAG_COLORS: dict = {
"": {
ColorType.PRIMARY: "#1e1e1e",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#333333",
ColorType.LIGHT_ACCENT: "#FFFFFF",
ColorType.DARK_ACCENT: "#222222",
},
"black": {
ColorType.PRIMARY: "#111018",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#18171e",
ColorType.LIGHT_ACCENT: "#b7b6be",
ColorType.DARK_ACCENT: "#03020a",
},
"dark gray": {
ColorType.PRIMARY: "#24232a",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#2a2930",
ColorType.LIGHT_ACCENT: "#bdbcc4",
ColorType.DARK_ACCENT: "#07060e",
},
"gray": {
ColorType.PRIMARY: "#53525a",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#5b5a62",
ColorType.LIGHT_ACCENT: "#cbcad2",
ColorType.DARK_ACCENT: "#191820",
},
"light gray": {
ColorType.PRIMARY: "#aaa9b0",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#b6b4bc",
ColorType.LIGHT_ACCENT: "#cbcad2",
ColorType.DARK_ACCENT: "#191820",
},
"white": {
ColorType.PRIMARY: "#f2f1f8",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#fefeff",
ColorType.LIGHT_ACCENT: "#ffffff",
ColorType.DARK_ACCENT: "#302f36",
},
"light pink": {
ColorType.PRIMARY: "#ff99c4",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#ffaad0",
ColorType.LIGHT_ACCENT: "#ffcbe7",
ColorType.DARK_ACCENT: "#6c2e3b",
},
"pink": {
ColorType.PRIMARY: "#ff99c4",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#ffaad0",
ColorType.LIGHT_ACCENT: "#ffcbe7",
ColorType.DARK_ACCENT: "#6c2e3b",
},
"magenta": {
ColorType.PRIMARY: "#f6466f",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#f7587f",
ColorType.LIGHT_ACCENT: "#fba4bf",
ColorType.DARK_ACCENT: "#61152f",
},
"red": {
ColorType.PRIMARY: "#e22c3c",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#b21f2d",
# ColorType.BORDER: '#e54252',
ColorType.LIGHT_ACCENT: "#f39caa",
ColorType.DARK_ACCENT: "#440d12",
},
"red orange": {
ColorType.PRIMARY: "#e83726",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#ea4b3b",
ColorType.LIGHT_ACCENT: "#f5a59d",
ColorType.DARK_ACCENT: "#61120b",
},
"salmon": {
ColorType.PRIMARY: "#f65848",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#f76c5f",
ColorType.LIGHT_ACCENT: "#fcadaa",
ColorType.DARK_ACCENT: "#6f1b16",
},
"orange": {
ColorType.PRIMARY: "#ed6022",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#ef7038",
ColorType.LIGHT_ACCENT: "#f7b79b",
ColorType.DARK_ACCENT: "#551e0a",
},
"yellow orange": {
ColorType.PRIMARY: "#fa9a2c",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#fba94b",
ColorType.LIGHT_ACCENT: "#fdd7ab",
ColorType.DARK_ACCENT: "#66330d",
},
"yellow": {
ColorType.PRIMARY: "#ffd63d",
ColorType.TEXT: ColorType.DARK_ACCENT,
# ColorType.BORDER: '#ffe071',
ColorType.BORDER: "#e8af31",
ColorType.LIGHT_ACCENT: "#fff3c4",
ColorType.DARK_ACCENT: "#754312",
},
"mint": {
ColorType.PRIMARY: "#4aed90",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#79f2b1",
ColorType.LIGHT_ACCENT: "#c8fbe9",
ColorType.DARK_ACCENT: "#164f3e",
},
"lime": {
ColorType.PRIMARY: "#92e649",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#b2ed72",
ColorType.LIGHT_ACCENT: "#e9f9b7",
ColorType.DARK_ACCENT: "#405516",
},
"light green": {
ColorType.PRIMARY: "#85ec76",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#a3f198",
ColorType.LIGHT_ACCENT: "#e7fbe4",
ColorType.DARK_ACCENT: "#2b5524",
},
"green": {
ColorType.PRIMARY: "#28bb48",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#43c568",
ColorType.LIGHT_ACCENT: "#93e2c8",
ColorType.DARK_ACCENT: "#0d3828",
},
"teal": {
ColorType.PRIMARY: "#1ad9b2",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#4de3c7",
ColorType.LIGHT_ACCENT: "#a0f3e8",
ColorType.DARK_ACCENT: "#08424b",
},
"cyan": {
ColorType.PRIMARY: "#49e4d5",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#76ebdf",
ColorType.LIGHT_ACCENT: "#bff5f0",
ColorType.DARK_ACCENT: "#0f4246",
},
"light blue": {
ColorType.PRIMARY: "#55bbf6",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#70c6f7",
ColorType.LIGHT_ACCENT: "#bbe4fb",
ColorType.DARK_ACCENT: "#122541",
},
"blue": {
ColorType.PRIMARY: "#3b87f0",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#4e95f2",
ColorType.LIGHT_ACCENT: "#aedbfa",
ColorType.DARK_ACCENT: "#122948",
},
"blue violet": {
ColorType.PRIMARY: "#5948f2",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#6258f3",
ColorType.LIGHT_ACCENT: "#9cb8fb",
ColorType.DARK_ACCENT: "#1b1649",
},
"violet": {
ColorType.PRIMARY: "#874ff5",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#9360f6",
ColorType.LIGHT_ACCENT: "#c9b0fa",
ColorType.DARK_ACCENT: "#3a1860",
},
"purple": {
ColorType.PRIMARY: "#bb4ff0",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#c364f2",
ColorType.LIGHT_ACCENT: "#dda7f7",
ColorType.DARK_ACCENT: "#531862",
},
"peach": {
ColorType.PRIMARY: "#f1c69c",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#f4d4b4",
ColorType.LIGHT_ACCENT: "#fbeee1",
ColorType.DARK_ACCENT: "#613f2f",
},
"brown": {
ColorType.PRIMARY: "#823216",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#8a3e22",
ColorType.LIGHT_ACCENT: "#cd9d83",
ColorType.DARK_ACCENT: "#3a1804",
},
"lavender": {
ColorType.PRIMARY: "#ad8eef",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#b99ef2",
ColorType.LIGHT_ACCENT: "#d5c7fa",
ColorType.DARK_ACCENT: "#492b65",
},
"blonde": {
ColorType.PRIMARY: "#efc664",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#f3d387",
ColorType.LIGHT_ACCENT: "#faebc6",
ColorType.DARK_ACCENT: "#6d461e",
},
"auburn": {
ColorType.PRIMARY: "#a13220",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#aa402f",
ColorType.LIGHT_ACCENT: "#d98a7f",
ColorType.DARK_ACCENT: "#3d100a",
},
"light brown": {
ColorType.PRIMARY: "#be5b2d",
ColorType.TEXT: ColorType.DARK_ACCENT,
ColorType.BORDER: "#c4693d",
ColorType.LIGHT_ACCENT: "#e5b38c",
ColorType.DARK_ACCENT: "#4c290e",
},
"dark brown": {
ColorType.PRIMARY: "#4c2315",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#542a1c",
ColorType.LIGHT_ACCENT: "#b78171",
ColorType.DARK_ACCENT: "#211006",
},
"cool gray": {
ColorType.PRIMARY: "#515768",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#5b6174",
ColorType.LIGHT_ACCENT: "#9ea1c3",
ColorType.DARK_ACCENT: "#181a37",
},
"warm gray": {
ColorType.PRIMARY: "#625550",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#6c5e57",
ColorType.LIGHT_ACCENT: "#c0a392",
ColorType.DARK_ACCENT: "#371d18",
},
"olive": {
ColorType.PRIMARY: "#4c652e",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#586f36",
ColorType.LIGHT_ACCENT: "#b4c17a",
ColorType.DARK_ACCENT: "#23300e",
},
"berry": {
ColorType.PRIMARY: "#9f2aa7",
ColorType.TEXT: ColorType.LIGHT_ACCENT,
ColorType.BORDER: "#aa43b4",
ColorType.LIGHT_ACCENT: "#cc8fdc",
ColorType.DARK_ACCENT: "#41114a",
},
}
_UI_COLORS: dict = {
"": {
ColorType.PRIMARY: "#333333",
ColorType.BORDER: "#555555",
ColorType.LIGHT_ACCENT: "#FFFFFF",
ColorType.DARK_ACCENT: "#1e1e1e",
},
"red": {
ColorType.PRIMARY: "#e22c3c",
ColorType.BORDER: "#e54252",
ColorType.LIGHT_ACCENT: "#f39caa",
ColorType.DARK_ACCENT: "#440d12",
},
"green": {
ColorType.PRIMARY: "#28bb48",
ColorType.BORDER: "#43c568",
ColorType.LIGHT_ACCENT: "#DDFFCC",
ColorType.DARK_ACCENT: "#0d3828",
},
"purple": {
ColorType.PRIMARY: "#C76FF3",
ColorType.BORDER: "#c364f2",
ColorType.LIGHT_ACCENT: "#EFD4FB",
ColorType.DARK_ACCENT: "#3E1555",
},
"theme_dark": {
ColorType.PRIMARY: "#333333",
ColorType.BORDER: "#555555",
ColorType.LIGHT_ACCENT: "#FFFFFF",
ColorType.DARK_ACCENT: "#1e1e1e",
},
"theme_light": {
ColorType.PRIMARY: "#FFFFFF",
ColorType.BORDER: "#333333",
ColorType.LIGHT_ACCENT: "#999999",
ColorType.DARK_ACCENT: "#888888",
},
}
def get_tag_color(type: ColorType, color: str):
def get_tag_color(color_type, color):
color = color.lower()
try:
if type == ColorType.TEXT:
return get_tag_color(_TAG_COLORS[color][type], color)
if color_type == ColorType.TEXT:
return get_tag_color(_TAG_COLORS[color][color_type], color)
else:
return _TAG_COLORS[color][type]
return _TAG_COLORS[color][color_type]
except KeyError:
return '#FF00FF'
return "#FF00FF"
def get_ui_color(color_type: ColorType, color: str):
"""Returns a hex value given a color name and ColorType."""
color = color.lower()
return _UI_COLORS.get(color).get(color_type)

View File

@@ -4,230 +4,208 @@
"""The core classes and methods of TagStudio."""
import os
from types import FunctionType
# from typing import Dict, Optional, TypedDict, List
import json
import os
from pathlib import Path
import traceback
import requests
# from bs4 import BeautifulSoup as bs
from src.core.library import *
from src.core.field_template import FieldTemplate
from enum import Enum
VERSION: str = '9.1.0' # Major.Minor.Patch
VERSION_BRANCH: str = 'Alpha' # 'Alpha', 'Beta', or '' for Full Release
# The folder & file names where TagStudio keeps its data relative to a library.
TS_FOLDER_NAME: str = '.TagStudio'
BACKUP_FOLDER_NAME: str = 'backups'
COLLAGE_FOLDER_NAME: str = 'collages'
LIBRARY_FILENAME: str = 'ts_library.json'
IMAGE_TYPES: list[str] = ['png', 'jpg', 'jpeg', 'jpg_large', 'jpeg_large',
'jfif', 'gif', 'tif', 'tiff', 'heic', 'heif', 'webp',
'bmp', 'svg', 'avif', 'apng', 'jp2', 'j2k', 'jpg2']
VIDEO_TYPES: list[str] = ['mp4', 'webm', 'mov', 'hevc', 'mkv', 'avi', 'wmv',
'flv', 'gifv', 'm4p', 'm4v', '3gp']
AUDIO_TYPES: list[str] = ['mp3', 'mp4', 'mpeg4', 'm4a', 'aac', 'wav', 'flac',
'alac', 'wma', 'ogg', 'aiff']
TEXT_TYPES: list[str] = ['txt', 'rtf', 'md',
'doc', 'docx', 'pdf', 'tex', 'odt', 'pages']
SPREADSHEET_TYPES: list[str] = ['csv', 'xls', 'xlsx', 'numbers', 'ods']
PRESENTATION_TYPES: list[str] = ['ppt', 'pptx', 'key', 'odp']
ARCHIVE_TYPES: list[str] = ['zip', 'rar', 'tar', 'tar.gz', 'tgz', '7z']
PROGRAM_TYPES: list[str] = ['exe', 'app']
SHORTCUT_TYPES: list[str] = ['lnk', 'desktop']
ALL_FILE_TYPES: list[str] = IMAGE_TYPES + VIDEO_TYPES
BOX_FIELDS = ['tag_box', 'text_box']
TEXT_FIELDS = ['text_line', 'text_box']
DATE_FIELDS = ['datetime']
TAG_COLORS = ['', 'black', 'dark gray', 'gray', 'light gray', 'white', 'light pink',
'pink', 'red', 'red orange', 'orange', 'yellow orange', 'yellow',
'lime', 'light green', 'mint', 'green','teal', 'cyan', 'light blue',
'blue', 'blue violet', 'violet', 'purple', 'lavender', 'berry',
'magenta', 'salmon', 'auburn', 'dark brown', 'brown', 'light brown',
'blonde', 'peach', 'warm gray', 'cool gray', 'olive']
from src.core.library import Entry, Library
from src.core.constants import TS_FOLDER_NAME, TEXT_FIELDS
class TagStudioCore:
"""
Instantiate this to establish a TagStudio session.
Holds all TagStudio session data and provides methods to manage it.
"""
"""
Instantiate this to establish a TagStudio session.
Holds all TagStudio session data and provides methods to manage it.
"""
def __init__(self):
self.lib: Library = Library()
def __init__(self):
self.lib: Library = Library()
def get_gdl_sidecar(self, filepath: str | Path, source: str = "") -> dict:
"""
Attempts to open and dump a Gallery-DL Sidecar sidecar file for
the filepath.\n Returns a formatted object with notable values or an
empty object if none is found.
"""
json_dump = {}
info = {}
_filepath: Path = Path(filepath)
_filepath = _filepath.parent / (_filepath.name + ".json")
def get_gdl_sidecar(self, filepath: str, source: str = '') -> dict:
"""
Attempts to open and dump a Gallery-DL Sidecar sidecar file for
the filepath.\n Returns a formatted object with notable values or an
empty object if none is found.
"""
json_dump = {}
info = {}
# 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":
if not _filepath.is_file():
newstem = _filepath.stem[:-16] + "1" + _filepath.stem[-15:]
_filepath = _filepath.parent / (newstem + ".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':
if not os.path.isfile(os.path.normpath(filepath + ".json")):
filepath = filepath[:-16] + '1' + filepath[-15:]
try:
with open(_filepath, "r", encoding="utf8") as f:
json_dump = json.load(f)
try:
with open(os.path.normpath(filepath + ".json"), "r", encoding="utf8") as f:
json_dump = json.load(f)
if json_dump:
if source == "twitter":
info["content"] = json_dump["content"].strip()
info["date_published"] = json_dump["date"]
elif source == "instagram":
info["description"] = json_dump["description"].strip()
info["date_published"] = json_dump["date"]
elif source == "artstation":
info["title"] = json_dump["title"].strip()
info["artist"] = json_dump["user"]["full_name"].strip()
info["description"] = json_dump["description"].strip()
info["tags"] = json_dump["tags"]
# info["tags"] = [x for x in json_dump["mediums"]["name"]]
info["date_published"] = json_dump["date"]
elif source == "newgrounds":
# info["title"] = json_dump["title"]
# info["artist"] = json_dump["artist"]
# info["description"] = json_dump["description"]
info["tags"] = json_dump["tags"]
info["date_published"] = json_dump["date"]
info["artist"] = json_dump["user"].strip()
info["description"] = json_dump["description"].strip()
info["source"] = json_dump["post_url"].strip()
# else:
# print(
# f'[INFO]: TagStudio does not currently support sidecar files for "{source}"')
if json_dump:
if source == "twitter":
info["content"] = json_dump["content"].strip()
info["date_published"] = json_dump["date"]
elif source == "instagram":
info["description"] = json_dump["description"].strip()
info["date_published"] = json_dump["date"]
elif source == "artstation":
info["title"] = json_dump["title"].strip()
info["artist"] = json_dump["user"]["full_name"].strip()
info["description"] = json_dump["description"].strip()
info["tags"] = json_dump["tags"]
# info["tags"] = [x for x in json_dump["mediums"]["name"]]
info["date_published"] = json_dump["date"]
elif source == "newgrounds":
# info["title"] = json_dump["title"]
# info["artist"] = json_dump["artist"]
# info["description"] = json_dump["description"]
info["tags"] = json_dump["tags"]
info["date_published"] = json_dump["date"]
info["artist"] = json_dump["user"].strip()
info["description"] = json_dump["description"].strip()
info["source"] = json_dump["post_url"].strip()
# else:
# print(
# f'[INFO]: TagStudio does not currently support sidecar files for "{source}"')
# except FileNotFoundError:
except:
# print(
# f'[INFO]: No sidecar file found at "{os.path.normpath(file_path + ".json")}"')
pass
# except FileNotFoundError:
except:
# print(
# f'[INFO]: No sidecar file found at "{os.path.normpath(file_path + ".json")}"')
pass
return info
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()
# 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
# # except:
# # # print("Could not resolve URL.")
# # pass
def match_conditions(self, entry_id: int) -> None:
"""Matches defined conditions against a file to add Entry data."""
def match_conditions(self, entry_id: int) -> str:
"""Matches defined conditions against a file to add Entry data."""
cond_file = self.lib.library_dir / TS_FOLDER_NAME / "conditions.json"
# TODO: Make this stored somewhere better instead of temporarily in this JSON file.
entry: Entry = self.lib.get_entry(entry_id)
try:
if cond_file.is_file():
with open(cond_file, "r", 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 str(Path(path_c).resolve()) in str(entry.path):
match = True
break
if match:
if fields := c.get("fields"):
for field in fields:
field_id = self.lib.get_field_attr(field, "id")
content = field[field_id]
cond_file = os.path.normpath(f'{self.lib.library_dir}/{TS_FOLDER_NAME}/conditions.json')
# TODO: Make this stored somewhere better instead of temporarily in this JSON file.
json_dump = {}
entry: Entry = self.lib.get_entry(entry_id)
try:
if os.path.isfile(cond_file):
with open(cond_file, "r", 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 os.path.normpath(path_c) in entry.path:
match = True
break
if match:
if 'fields' in c.keys() and c['fields']:
for field in c['fields']:
if (
self.lib.get_field_obj(int(field_id))["type"]
== "tag_box"
):
existing_fields: list[int] = (
self.lib.get_field_index_in_entry(
entry, field_id
)
)
if existing_fields:
self.lib.update_entry_field(
entry_id,
existing_fields[0],
content,
"append",
)
else:
self.lib.add_field_to_entry(
entry_id, field_id
)
self.lib.update_entry_field(
entry_id, -1, content, "append"
)
field_id = self.lib.get_field_attr(
field, 'id')
content = field[field_id]
if (
self.lib.get_field_obj(int(field_id))["type"]
in TEXT_FIELDS
):
if not self.lib.does_field_content_exist(
entry_id, field_id, content
):
self.lib.add_field_to_entry(
entry_id, field_id
)
self.lib.update_entry_field(
entry_id, -1, content, "replace"
)
except:
print("Error in match_conditions...")
# input()
pass
if self.lib.get_field_obj(int(field_id))['type'] == 'tag_box':
existing_fields: list[int] = self.lib.get_field_index_in_entry(
entry, field_id)
if existing_fields:
self.lib.update_entry_field(
entry_id, existing_fields[0], content, 'append')
else:
self.lib.add_field_to_entry(
entry_id, field_id)
self.lib.update_entry_field(
entry_id, -1, content, 'append')
def build_url(self, entry_id: int, source: str):
"""Tries to rebuild a source URL given a specific filename structure."""
if self.lib.get_field_obj(int(field_id))['type'] in TEXT_FIELDS:
if not self.lib.does_field_content_exist(entry_id, field_id, content):
self.lib.add_field_to_entry(
entry_id, field_id)
self.lib.update_entry_field(
entry_id, -1, content, 'replace')
except:
print('Error in match_conditions...')
# input()
pass
source = source.lower().replace("-", " ").replace("_", " ")
if "twitter" in source:
return self._build_twitter_url(entry_id)
elif "instagram" in source:
return self._build_instagram_url(entry_id)
def build_url(self, entry_id: int, source: str) -> str:
"""Tries to rebuild a source URL given a specific filename structure."""
def _build_twitter_url(self, entry_id: int):
"""
Builds an Twitter URL given a specific filename structure.
Method expects filename to be formatted as 'USERNAME_TWEET-ID_INDEX_YEAR-MM-DD'
"""
try:
entry = self.lib.get_entry(entry_id)
stubs = str(entry.filename).rsplit("_", 3)
# print(stubs)
# source, author = os.path.split(entry.path)
url = f"www.twitter.com/{stubs[0]}/status/{stubs[-3]}/photo/{stubs[-2]}"
return url
except:
return ""
source = source.lower().replace('-', ' ').replace('_', ' ')
if 'twitter' in source:
return self._build_twitter_url(entry_id)
elif 'instagram' in source:
return self._build_instagram_url(entry_id)
def _build_twitter_url(self, entry_id: int):
"""
Builds an Twitter URL given a specific filename structure.
Method expects filename to be formatted as 'USERNAME_TWEET-ID_INDEX_YEAR-MM-DD'
"""
try:
entry = self.lib.get_entry(entry_id)
stubs = entry.filename.rsplit('_', 3)
# print(stubs)
# source, author = os.path.split(entry.path)
url = f"www.twitter.com/{stubs[0]}/status/{stubs[-3]}/photo/{stubs[-2]}"
return url
except:
return ''
def _build_instagram_url(self, entry_id: int):
"""
Builds an Instagram URL given a specific filename structure.
Method expects filename to be formatted as 'USERNAME_POST-ID_INDEX_YEAR-MM-DD'
"""
try:
entry = self.lib.get_entry(entry_id)
stubs = entry.filename.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:
return ''
def _build_instagram_url(self, entry_id: int):
"""
Builds an Instagram URL given a specific filename structure.
Method expects filename to be formatted as 'USERNAME_POST-ID_INDEX_YEAR-MM-DD'
"""
try:
entry = self.lib.get_entry(entry_id)
stubs = str(entry.filename).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:
return ""

View File

@@ -0,0 +1,27 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
from chardet.universaldetector import UniversalDetector
from pathlib import Path
def detect_char_encoding(filepath: Path) -> str | None:
"""
Attempts to detect the character encoding of a text file.
Args:
filepath (Path): The path of the text file to analyze.
Returns:
str | None: The detected character encoding, if any.
"""
detector = UniversalDetector()
with open(filepath, "rb") as text_file:
for line in text_file.readlines():
detector.feed(line)
if detector.done:
break
detector.close()
return detector.result["encoding"]

View File

@@ -2,12 +2,10 @@
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
import os
def clean_folder_name(folder_name: str) -> str:
cleaned_name = folder_name
invalid_chars = "<>:\"/\\|?*."
invalid_chars = '<>:"/\\|?*.'
for char in invalid_chars:
cleaned_name = cleaned_name.replace(char, '_')
cleaned_name = cleaned_name.replace(char, "_")
return cleaned_name

View File

@@ -2,10 +2,25 @@
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
def strip_punctuation(string: str) -> str:
"""Returns a given string stripped of all punctuation characters."""
return string.replace('(', '').replace(')', '').replace('[', '') \
.replace(']', '').replace('{', '').replace('}', '').replace("'", '') \
.replace('`', '').replace('', '').replace('', '').replace('"', '') \
.replace('', '').replace('', '').replace('_', '').replace('-', '') \
.replace(' ', '').replace(' ', '')
return (
string.replace("(", "")
.replace(")", "")
.replace("[", "")
.replace("]", "")
.replace("{", "")
.replace("}", "")
.replace("'", "")
.replace("`", "")
.replace("", "")
.replace("", "")
.replace('"', "")
.replace("", "")
.replace("", "")
.replace("_", "")
.replace("-", "")
.replace(" ", "")
.replace(" ", "")
)

View File

@@ -2,11 +2,10 @@
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
def strip_web_protocol(string: str) -> str:
"""Strips a leading web protocol (ex. \"https://\") as well as \"www.\" from a string."""
new_str = string
new_str = new_str.removeprefix('https://')
new_str = new_str.removeprefix('http://')
new_str = new_str.removeprefix('www.')
new_str = new_str.removeprefix('www2.')
return new_str
prefixes = ["https://", "http://", "www.", "www2."]
for prefix in prefixes:
string = string.removeprefix(prefix)
return string

View File

@@ -4,9 +4,8 @@
"""PySide6 port of the widgets/layouts/flowlayout example from Qt v6.x"""
import sys
from PySide6.QtCore import Qt, QMargins, QPoint, QRect, QSize
from PySide6.QtWidgets import QApplication, QLayout, QPushButton, QSizePolicy, QWidget
from PySide6.QtWidgets import QLayout, QSizePolicy, QWidget
# class Window(QWidget):
@@ -22,143 +21,153 @@ from PySide6.QtWidgets import QApplication, QLayout, QPushButton, QSizePolicy, Q
# self.setWindowTitle("Flow Layout")
class FlowWidget(QWidget):
def __init__(self, parent=None) -> None:
super().__init__(parent)
self.ignore_size: bool = False
def __init__(self, parent=None) -> None:
super().__init__(parent)
self.ignore_size: bool = False
class FlowLayout(QLayout):
def __init__(self, parent=None):
super().__init__(parent)
def __init__(self, parent=None):
super().__init__(parent)
if parent is not None:
self.setContentsMargins(QMargins(0, 0, 0, 0))
if parent is not None:
self.setContentsMargins(QMargins(0, 0, 0, 0))
self._item_list = []
self.grid_efficiency = False
self._item_list = []
self.grid_efficiency = False
def __del__(self):
item = self.takeAt(0)
while item:
item = self.takeAt(0)
def __del__(self):
item = self.takeAt(0)
while item:
item = self.takeAt(0)
def addItem(self, item):
self._item_list.append(item)
def addItem(self, item):
self._item_list.append(item)
def count(self):
return len(self._item_list)
def count(self):
return len(self._item_list)
def itemAt(self, index):
if 0 <= index < len(self._item_list):
return self._item_list[index]
def itemAt(self, index):
if 0 <= index < len(self._item_list):
return self._item_list[index]
return None
return None
def takeAt(self, index):
if 0 <= index < len(self._item_list):
return self._item_list.pop(index)
def takeAt(self, index):
if 0 <= index < len(self._item_list):
return self._item_list.pop(index)
return None
return None
def expandingDirections(self):
return Qt.Orientation(0)
def expandingDirections(self):
return Qt.Orientation(0)
def hasHeightForWidth(self):
return True
def hasHeightForWidth(self):
return True
def heightForWidth(self, width):
height = self._do_layout(QRect(0, 0, width, 0), True)
return height
def heightForWidth(self, width):
height = self._do_layout(QRect(0, 0, width, 0), True)
return height
def setGeometry(self, rect):
super(FlowLayout, self).setGeometry(rect)
self._do_layout(rect, False)
def setGridEfficiency(self, bool):
"""
Enables or Disables efficiencies when all objects are equally sized.
"""
self.grid_efficiency = bool
def setGeometry(self, rect):
super(FlowLayout, self).setGeometry(rect)
self._do_layout(rect, False)
def sizeHint(self):
return self.minimumSize()
def setGridEfficiency(self, bool):
"""
Enables or Disables efficiencies when all objects are equally sized.
"""
self.grid_efficiency = bool
def minimumSize(self):
if self.grid_efficiency:
if self._item_list:
return self._item_list[0].minimumSize()
else:
return QSize()
else:
size = QSize()
def sizeHint(self):
return self.minimumSize()
for item in self._item_list:
size = size.expandedTo(item.minimumSize())
def minimumSize(self):
if self.grid_efficiency:
if self._item_list:
return self._item_list[0].minimumSize()
else:
return QSize()
else:
size = QSize()
size += QSize(2 * self.contentsMargins().top(), 2 * self.contentsMargins().top())
return size
for item in self._item_list:
size = size.expandedTo(item.minimumSize())
def _do_layout(self, rect, test_only):
x = rect.x()
y = rect.y()
line_height = 0
spacing = self.spacing()
item = None
style = None
layout_spacing_x = None
layout_spacing_y = None
size += QSize(
2 * self.contentsMargins().top(), 2 * self.contentsMargins().top()
)
return size
if self.grid_efficiency:
if self._item_list:
item = self._item_list[0]
style = item.widget().style()
layout_spacing_x = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Horizontal
)
layout_spacing_y = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Vertical
)
for i, item in enumerate(self._item_list):
# print(issubclass(type(item.widget()), FlowWidget))
# print(item.widget().ignore_size)
skip_count = 0
if (issubclass(type(item.widget()), FlowWidget) and item.widget().ignore_size):
skip_count += 1
def _do_layout(self, rect, test_only):
x = rect.x()
y = rect.y()
line_height = 0
spacing = self.spacing()
item = None
style = None
layout_spacing_x = None
layout_spacing_y = None
if (issubclass(type(item.widget()), FlowWidget) and not item.widget().ignore_size) or (not issubclass(type(item.widget()), FlowWidget)):
# print(f'Item {i}')
if not self.grid_efficiency:
style = item.widget().style()
layout_spacing_x = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Horizontal
)
layout_spacing_y = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Vertical
)
space_x = spacing + layout_spacing_x
space_y = spacing + layout_spacing_y
next_x = x + item.sizeHint().width() + space_x
if next_x - space_x > rect.right() and line_height > 0:
x = rect.x()
y = y + line_height + space_y
next_x = x + item.sizeHint().width() + space_x
line_height = 0
if self.grid_efficiency:
if self._item_list:
item = self._item_list[0]
style = item.widget().style()
layout_spacing_x = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Horizontal
)
layout_spacing_y = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Vertical
)
for i, item in enumerate(self._item_list):
# print(issubclass(type(item.widget()), FlowWidget))
# print(item.widget().ignore_size)
skip_count = 0
if (
issubclass(type(item.widget()), FlowWidget)
and item.widget().ignore_size
):
skip_count += 1
if not test_only:
item.setGeometry(QRect(QPoint(x, y), item.sizeHint()))
if (
issubclass(type(item.widget()), FlowWidget)
and not item.widget().ignore_size
) or (not issubclass(type(item.widget()), FlowWidget)):
# print(f'Item {i}')
if not self.grid_efficiency:
style = item.widget().style()
layout_spacing_x = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Horizontal
)
layout_spacing_y = style.layoutSpacing(
QSizePolicy.PushButton, QSizePolicy.PushButton, Qt.Vertical
)
space_x = spacing + layout_spacing_x
space_y = spacing + layout_spacing_y
next_x = x + item.sizeHint().width() + space_x
if next_x - space_x > rect.right() and line_height > 0:
x = rect.x()
y = y + line_height + space_y
next_x = x + item.sizeHint().width() + space_x
line_height = 0
x = next_x
line_height = max(line_height, item.sizeHint().height())
if not test_only:
item.setGeometry(QRect(QPoint(x, y), item.sizeHint()))
# print(y + line_height - rect.y() * ((len(self._item_list) - skip_count) / len(self._item_list)))
# print(y + line_height - rect.y()) * ((len(self._item_list) - skip_count) / len(self._item_list))
return y + line_height - rect.y() * ((len(self._item_list)) / len(self._item_list))
x = next_x
line_height = max(line_height, item.sizeHint().height())
# print(y + line_height - rect.y() * ((len(self._item_list) - skip_count) / len(self._item_list)))
# print(y + line_height - rect.y()) * ((len(self._item_list) - skip_count) / len(self._item_list))
return (
y + line_height - rect.y() * ((len(self._item_list)) / len(self._item_list))
)
# if __name__ == "__main__":
# app = QApplication(sys.argv)
# main_win = Window()
# main_win.show()
# sys.exit(app.exec())
# sys.exit(app.exec())

View File

@@ -0,0 +1,109 @@
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
## This file is a modified script that gets the thumbnail data stored in a blend file
import struct
from PIL import (
Image,
ImageOps,
)
import gzip
import os
def blend_extract_thumb(path):
REND = b"REND"
TEST = b"TEST"
blendfile = open(path, "rb")
head = blendfile.read(12)
if head[0:2] == b"\x1f\x8b": # gzip magic
blendfile.close()
blendfile = gzip.GzipFile("", "rb", 0, open(path, "rb"))
head = blendfile.read(12)
if not head.startswith(b"BLENDER"):
blendfile.close()
return None, 0, 0
is_64_bit = head[7] == b"-"[0]
# true for PPC, false for X86
is_big_endian = head[8] == b"V"[0]
# blender pre 2.5 had no thumbs
if head[9:11] <= b"24":
return None, 0, 0
sizeof_bhead = 24 if is_64_bit else 20
int_endian = ">i" if is_big_endian else "<i"
int_endian_pair = int_endian + "i"
while True:
bhead = blendfile.read(sizeof_bhead)
if len(bhead) < sizeof_bhead:
return None, 0, 0
code = bhead[:4]
length = struct.unpack(int_endian, bhead[4:8])[0] # 4 == sizeof(int)
if code == REND:
blendfile.seek(length, os.SEEK_CUR)
else:
break
if code != TEST:
return None, 0, 0
try:
x, y = struct.unpack(int_endian_pair, blendfile.read(8)) # 8 == sizeof(int) * 2
except struct.error:
return None, 0, 0
length -= 8 # sizeof(int) * 2
if length != x * y * 4:
return None, 0, 0
image_buffer = blendfile.read(length)
if len(image_buffer) != length:
return None, 0, 0
return image_buffer, x, y
def blend_thumb(file_in):
buf, width, height = blend_extract_thumb(file_in)
image = Image.frombuffer(
"RGBA",
(width, height),
buf,
)
image = ImageOps.flip(image)
return image

View File

@@ -0,0 +1,64 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
from PIL import Image
from PySide6.QtCore import Qt
from PySide6.QtGui import QGuiApplication
from src.qt.helpers.gradient import linear_gradient
# TODO: Consolidate the built-in QT theme values with the values
# here, in enums.py, and in palette.py.
_THEME_DARK_FG: str = "#FFFFFF77"
_THEME_LIGHT_FG: str = "#000000DD"
_THEME_DARK_BG: str = "#000000DD"
_THEME_LIGHT_BG: str = "#FFFFFF55"
def theme_fg_overlay(image: Image.Image, use_alpha: bool = True) -> Image.Image:
"""
Overlay the foreground theme color onto an image.
Args:
image (Image): The PIL Image object to apply an overlay to.
"""
dark_fg: str = _THEME_DARK_FG[:-2] if not use_alpha else _THEME_DARK_FG
light_fg: str = _THEME_LIGHT_FG[:-2] if not use_alpha else _THEME_LIGHT_FG
overlay_color = (
dark_fg
if QGuiApplication.styleHints().colorScheme() is Qt.ColorScheme.Dark
else light_fg
)
im = Image.new(mode="RGBA", size=image.size, color=overlay_color)
return _apply_overlay(image, im)
def gradient_overlay(image: Image.Image, gradient=list[str]) -> Image.Image:
"""
Overlay a color gradient onto an image.
Args:
image (Image): The PIL Image object to apply an overlay to.
gradient (list[str): A list of string hex color codes for use as
the colors of the gradient.
"""
im: Image.Image = _apply_overlay(image, linear_gradient(image.size, gradient))
return im
def _apply_overlay(image: Image.Image, overlay: Image.Image) -> Image.Image:
"""
Internal method to apply an overlay on top of an image, using
the image's alpha channel as a mask.
Args:
image (Image): The PIL Image object to apply an overlay to.
overlay (Image): The PIL Image object to act as the overlay contents.
"""
im: Image.Image = Image.new(mode="RGBA", size=image.size, color="#00000000")
im.paste(overlay, (0, 0), mask=image)
return im

View File

@@ -0,0 +1,19 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
from PySide6.QtCore import Signal, QRunnable, QObject
class CustomRunnable(QRunnable, QObject):
done = Signal()
def __init__(self, function) -> None:
QRunnable.__init__(self)
QObject.__init__(self)
self.function = function
def run(self):
self.function()
self.done.emit()

View File

@@ -0,0 +1,30 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
import logging
from pathlib import Path
from send2trash import send2trash
logging.basicConfig(format="%(message)s", level=logging.INFO)
def delete_file(path: str | Path) -> bool:
"""Sends a file to the system trash.
Args:
path (str | Path): The path of the file to delete.
"""
_path = Path(path)
try:
logging.info(f"[delete_file] Sending to Trash: {_path}")
send2trash(_path)
return True
except PermissionError as e:
logging.error(f"[delete_file][ERROR] PermissionError: {e}")
except FileNotFoundError:
logging.error(f"[delete_file][ERROR] File Not Found: {_path}")
except Exception as e:
logging.error(e)
return False

View File

@@ -0,0 +1,152 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
import logging
import os
import subprocess
import shutil
import sys
import traceback
from pathlib import Path
from PySide6.QtWidgets import QLabel
from PySide6.QtCore import Qt
ERROR = f"[ERROR]"
WARNING = f"[WARNING]"
INFO = f"[INFO]"
logging.basicConfig(format="%(message)s", level=logging.INFO)
def open_file(path: str | Path, file_manager: 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.
"""
_path = str(path)
logging.info(f"Opening file: {_path}")
if not os.path.exists(_path):
logging.error(f"File not found: {_path}")
return
try:
if sys.platform == "win32":
normpath = os.path.normpath(_path)
if file_manager:
command_name = "explorer"
command_args = '/select,"' + normpath + '"'
# For some reason, if the args are passed in a list, this will error when the path has spaces, even while surrounded in double quotes
subprocess.Popen(
command_name + command_args,
shell=True,
close_fds=True,
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP
| subprocess.CREATE_BREAKAWAY_FROM_JOB,
)
else:
command_name = "start"
# first parameter is for title, NOT filepath
command_args = ["", normpath]
subprocess.Popen(
[command_name] + command_args,
shell=True,
close_fds=True,
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP
| subprocess.CREATE_BREAKAWAY_FROM_JOB,
)
else:
if sys.platform == "darwin":
command_name = "open"
command_args = [_path]
if file_manager:
# will reveal in Finder
command_args.append("-R")
else:
if file_manager:
command_name = "dbus-send"
# might not be guaranteed to launch default?
command_args = [
"--session",
"--dest=org.freedesktop.FileManager1",
"--type=method_call",
"/org/freedesktop/FileManager1",
"org.freedesktop.FileManager1.ShowItems",
f"array:string:file://{_path}",
"string:",
]
else:
command_name = "xdg-open"
command_args = [_path]
command = shutil.which(command_name)
if command is not None:
subprocess.Popen([command] + command_args, close_fds=True)
else:
logging.info(f"Could not find {command_name} on system PATH")
except:
traceback.print_exc()
class FileOpenerHelper:
def __init__(self, filepath: str | Path):
"""Initialize the FileOpenerHelper.
Args:
filepath (str): The path to the file to open.
"""
self.filepath = str(filepath)
def set_filepath(self, filepath: str | Path):
"""Set the filepath to open.
Args:
filepath (str): The path to the file to open.
"""
self.filepath = str(filepath)
def open_file(self):
"""Open the file in the default application."""
open_file(self.filepath)
def open_explorer(self):
"""Open the file in the default file explorer."""
open_file(self.filepath, file_manager=True)
class FileOpenerLabel(QLabel):
def __init__(self, text, parent=None):
"""Initialize the FileOpenerLabel.
Args:
text (str): The text to display.
parent (QWidget, optional): The parent widget. Defaults to None.
"""
super().__init__(text, parent)
def setFilePath(self, filepath):
"""Set the filepath to open.
Args:
filepath (str): The path to the file to open.
"""
self.filepath = filepath
def mousePressEvent(self, event):
"""Handle mouse press events.
On a left click, open the file in the default file explorer. On a right click, show a context menu.
Args:
event (QMouseEvent): The mouse press event.
"""
super().mousePressEvent(event)
if event.button() == Qt.LeftButton:
opener = FileOpenerHelper(self.filepath)
opener.open_explorer()
elif event.button() == Qt.RightButton:
# Show context menu
pass

View File

@@ -0,0 +1,31 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
import ffmpeg
from pathlib import Path
from src.qt.helpers.vendored.ffmpeg import _probe
def is_readable_video(filepath: Path | str):
"""Test if a video is in a readable format. Examples of unreadable videos
include files with undetermined codecs and DRM-protected content.
Args:
filepath (Path | str):
"""
try:
probe = _probe(Path(filepath))
for stream in probe["streams"]:
# DRM check
if stream.get("codec_tag_string") in [
"drma",
"drms",
"drmi",
]:
return False
except ffmpeg.Error:
return False
return True

View File

@@ -0,0 +1,21 @@
# Copyright (C) 2024 Travis Abendshien (CyanVoxel).
# Licensed under the GPL-3.0 License.
# Created for TagStudio: https://github.com/CyanVoxel/TagStudio
from PySide6.QtCore import Signal, QObject
from typing import Callable
class FunctionIterator(QObject):
"""Iterates over a yielding function and emits progress as the 'value' signal.\n\nThread-Safe Guarantee™"""
value = Signal(object)
def __init__(self, function: Callable):
super().__init__()
self.iterable = function
def run(self):
for i in self.iterable():
self.value.emit(i)

Some files were not shown because too many files have changed in this diff Show More