Commit Graph

538 Commits

Author SHA1 Message Date
Jann Stute
c3c7d7546d add performance logging 2024-12-02 22:28:47 +01:00
Jann Stute
bb7196e43f simplify structure of parsed AST 2024-12-02 21:45:45 +01:00
Jann Stute
1e8c72c74c fix: AND now works correctly with tags 2024-12-02 20:34:16 +01:00
Jann Stute
2d778cebd4 Merge branch 'main' into query-lang 2024-11-30 22:15:26 +01:00
Theasacraft
dffa3635b0 fix: remove qt disconnect warning (#613)
* fix: cannot disconnect from None Warning

* fix: cannot disconnect from None Warning mypy compliant
2024-11-30 13:03:57 -08:00
Travis Abendshien
ef68603322 feat(parity): migrate json libraries to sqlite (#604)
* feat(ui): add PagedPanel widget

* feat(ui): add MigrationModal widget

* feat: add basic json to sql conversion

* fix: chose `poolclass` based on file or memory db

* feat: migrate tag colors from json to sql

* feat: migrate entry fields from json to sql

- fix: tag name column no longer has unique constraint
- fix: tags are referenced by id in db queries
- fix: tag_search_panel no longer queries db on initialization; does not regress to empty search window when shown
- fix: tag name search no longer uses library grid FilterState object
- fix: tag name search now respects tag limit

* set default `is_new` case

* fix: limit correct tag query

* feat: migrate tag aliases and subtags from json to sql

* add migration timer

* fix(tests): fix broken tests

* rename methods, add docstrings

* revert tag id search, split tag name search

* fix: use correct type in sidecar macro

* tests: add json migration tests

* fix: drop leading dot from json extensions

* add special characters to json db test

* tests: add file path and entry field parity checks

* fix(ui): tag manager no longer starts empty

* fix: read old windows paths as posix

Addresses #298

* tests: add posix + windows paths to json library

* tests: add subtag, alias, and shorthand parity tests

* tests: ensure no none values in parity checks

* tests: add tag color test, use tag id in tag tests

* tests: fix and optimize tests

* tests: add discrepancy tracker

* refactor: reduce duplicate UI code

* fix: load non-sequential entry ids

* fix(ui): sort tags in the preview panel

* tests(fix): prioritize `None` check over equality

* fix(tests): fix multi "same tag field type" tests

* ui: increase height of migration modal

* feat: add progress bar to migration ui

* fix(ui): sql values update earlier

* refactor: use `get_color_from_str` in test

* refactor: migrate tags before aliases and subtags

* remove unused assertion

* refactor: use `json_migration_req` flag
2024-11-30 13:00:08 -08:00
Jann Stute
4dfd7e350e fix: remove unused dataclass 2024-11-30 12:26:58 +01:00
Jann Stute
8602f2f68a fix: remove unneccessary import 2024-11-30 12:25:02 +01:00
Jann Stute
05c7d9425d fix: also port test changes 2024-11-30 12:23:14 +01:00
Jann Stute
d9da558458 Revert changes to search_tags in favor of changes from #604 2024-11-30 12:07:08 +01:00
Travis Abendshien
b7e652ad8d docs: remove db_migration 2024-11-29 15:40:04 -08:00
csponge
bc366fc34d feat: audio playback (#576)
* feat: Audio Playback

Add the ability to play audio files.

Add a slider to seek through an audio file.

Add play/pause and mute/unmute buttons for audio files.

Note: This is a continuation of a mistakenly closed PR:
Ref: https://github.com/TagStudioDev/TagStudio/pull/529

While redoing the changes, I made a couple of improvements.
When the end of the track is reached, the pause button will
swap to the play button and allow the track to be replayed.

Here is the original feature request:
Ref: https://github.com/TagStudioDev/TagStudio/issues/450

* fix: prevent autoplay on new track when paused

* refactor: Add MediaPlayer base class.

Added a MediaPlayer base class per some suggestions
in the PR comments. Hopefully this reduces duplicate code
between the audio/video player in the future.

* refactor: add controls to base MediaPlayer class

Move media controls from the AudioPlayer widget
to the MediaPlayer base class. This removes the need
for a separate AudioPlayer class, and allows the
video player to reuse the media controls.

* fix: position_label update with slider

Update the position_label when the slider is moving.

* fix: replace platform dependent time formatting

Replace the use of `-` in the time format since this
is not availabile on all platforms.

Update initial `position_label` value to '0:00'.
2024-11-29 14:47:27 -08:00
Travis Abendshien
1fb1a80d53 fix: ui/ux parity fixes for thumbnails and files (#608)
* fix(ui): display loading icon before rendered thumb

* fix: skip out of range thumbs

* fix: optimize library refreshing

* fix(ui): tag colors show correct names

* fix(ui): ensure inner field containers are deleted

* fix(ui): don't show default preview label text

* fix: catch all missing file thumbs; clean up logs
2024-11-29 12:35:18 -08:00
Kiril Bourakov
d152cd75d8 fix: "open in explorer" opens correct folder (#603)
* replaced as_posix with str

* replaced addition with f string

---------

Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
2024-11-29 09:34:28 -08:00
Jann Stute
6fb1d4bff7 fix: make mypy happy 2024-11-28 23:58:27 +01:00
Jann Stute
a784fe68e6 implement special:untagged 2024-11-28 23:28:15 +01:00
Jann Stute
83e156f69b finish refactoring of FilterState 2024-11-28 22:54:35 +01:00
Jann Stute
ea175800be remove summary as it is not applicable anymore 2024-11-28 22:54:35 +01:00
Jann Stute
3ab8d6a871 remove obsolete filename search 2024-11-28 22:54:35 +01:00
Jann Stute
3d4b649903 implement NOT 2024-11-28 22:54:34 +01:00
Jann Stute
1f5a4dcc7e make mypy happy 2024-11-28 22:54:34 +01:00
Jann Stute
cdf2f09d60 fix: search_library now correctly returns the number of *unique* entries 2024-11-28 22:51:02 +01:00
Jann Stute
d74743565d fix: item_thumb didn't query entries correctly 2024-11-28 22:51:02 +01:00
Jann Stute
7a3679d730 remove obsolete tests 2024-11-28 22:51:02 +01:00
Jann Stute
2f9133754a ruff fixes 2024-11-28 22:51:02 +01:00
Jann Stute
db6284f5bd remove obsolete Search Mode UI and related code 2024-11-28 22:51:02 +01:00
Jann Stute
f9bf7a7eae fix: use default value notation instead of if None statement in __post_init__ 2024-11-28 22:51:02 +01:00
Jann Stute
7c43686823 refactoring: remove FilterState.id and implement Library.get_entry_full as replacement 2024-11-28 22:51:02 +01:00
Jann Stute
27fac24da3 fix: path now uses GLOB operator for proper GLOBs 2024-11-28 22:51:02 +01:00
Jann Stute
eda7f5200f refactoring 2024-11-28 22:51:02 +01:00
Jann Stute
0d4afd47c8 fix tag search 2024-11-28 22:51:02 +01:00
Jann Stute
6eab426183 fix: remove uncecessary line that broke search when searching for exact name 2024-11-28 22:51:02 +01:00
Jann Stute
9681bfcf78 add todos 2024-11-28 22:51:02 +01:00
Jann Stute
cb8437b0a3 use query lang instead of tag_id FIlterState 2024-11-28 22:51:01 +01:00
Jann Stute
927beed5f9 fix: changed joins to outerjoins and added missing outerjoin 2024-11-28 22:51:01 +01:00
Jann Stute
e2e378f19b Revert "fix: Entries without Tags are now searchable"
This reverts commit 19b40af7480b0c068b81b642b51536a9ec96d030.
2024-11-28 22:51:01 +01:00
Jann Stute
a636864ed0 make mypy happy 2024-11-28 22:51:01 +01:00
Jann Stute
06761a594b fix: Entries without Tags are now searchable 2024-11-28 22:51:01 +01:00
Jann Stute
de08849faa fix: check for None properly 2024-11-28 22:51:01 +01:00
Jann Stute
958ba86ef7 rudimentary search field integration 2024-11-28 22:51:01 +01:00
Jann Stute
fc3db94c40 refactoring and fixes 2024-11-28 22:51:01 +01:00
Jann Stute
f592f070aa Revert "make mypy happy"
This reverts commit 926d0dd2e79d06203e84e2f83c06c7fe5b33de23.
2024-11-28 22:51:01 +01:00
Jann Stute
e0c404a1a6 add __init__.py 2024-11-28 22:51:01 +01:00
Jann Stute
1507c5c9d7 make mypy happy 2024-11-28 22:51:01 +01:00
Jann Stute
47a3b968ce add BaseVisitor class 2024-11-28 22:51:01 +01:00
Jann Stute
6f3586448b add parent property to AST 2024-11-28 22:51:01 +01:00
Jann Stute
581b7acd43 add more constraint types 2024-11-28 22:51:01 +01:00
Jann Stute
e9afa42848 add missing todo 2024-11-28 22:51:01 +01:00
Jann Stute
25a64d941f ruff format 2024-11-28 22:51:01 +01:00
Jann Stute
2bbad4a5d1 make mypy happy 2024-11-28 22:51:01 +01:00