stash/pkg/sqlite
gitgiggety 9d641c64e3
Actually implement TagFilter.marker_count (#1603)
* Actually implement TagFilter.marker_count

The marker_count filter/criterion as defined in TagFilterType isn't
actually implemented. This adds an implementation for it.

Do note this implementation _might_ have performance issues because of
using OR (in the join). Another implentation would be to remove both
joins and use:
```SQL
COUNT(
    SELECT id FROM scene_markers WHERE primary_tag_id = tags.id
  UNION
    SELECT scene_marker_id FROM scene_markers_tags WHERE tag_id = tags.id
)
```
Note this doesn't require a DISTINCT as UNION already removes any
duplicate records.

* Restore marker count filter and sorting

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-08-04 13:39:24 +10:00
..
filter.go Always wrap filter conditions in parentheses (#1577) 2021-07-14 18:29:59 +10:00
filter_internal_test.go Always wrap filter conditions in parentheses (#1577) 2021-07-14 18:29:59 +10:00
gallery.go [Feature] Better resolution search (#1568) 2021-08-02 13:22:39 +10:00
gallery_test.go [Feature] Better resolution search (#1568) 2021-08-02 13:22:39 +10:00
image.go Add various filter criteria (#1505) 2021-06-23 09:10:20 +10:00
image_test.go [Feature] Better resolution search (#1568) 2021-08-02 13:22:39 +10:00
movies.go Add various filter criteria (#1505) 2021-06-23 09:10:20 +10:00
movies_test.go Fix movies sorting, scene studio editing (#1478) 2021-06-04 09:21:17 +10:00
performer.go Add various filter criteria (#1505) 2021-06-23 09:10:20 +10:00
performer_test.go Fix Performer Studio filtering (#1483) 2021-06-06 15:05:05 +10:00
query.go Filter studio hierarchy (#1397) 2021-06-03 20:52:19 +10:00
repository.go Filter studio hierarchy (#1397) 2021-06-03 20:52:19 +10:00
saved_filter.go Saved filters (#1474) 2021-06-16 14:53:32 +10:00
saved_filter_test.go Saved filters (#1474) 2021-06-16 14:53:32 +10:00
scene.go [Feature] Better resolution search (#1568) 2021-08-02 13:22:39 +10:00
scene_marker.go Filter studio hierarchy (#1397) 2021-06-03 20:52:19 +10:00
scene_marker_test.go Data layer restructuring (#997) 2021-01-18 12:23:20 +11:00
scene_test.go [Feature] Better resolution search (#1568) 2021-08-02 13:22:39 +10:00
scraped_item.go Data layer restructuring (#997) 2021-01-18 12:23:20 +11:00
setup_test.go [Feature] Better resolution search (#1568) 2021-08-02 13:22:39 +10:00
sql.go Whitespace is not trimmed from the end of query strings (#1263) 2021-04-13 10:32:52 +10:00
stash_id_test.go Query bug fixes (#1510) 2021-06-21 15:48:28 +10:00
studio.go Add various filter criteria (#1505) 2021-06-23 09:10:20 +10:00
studio_test.go Filter studio hierarchy (#1397) 2021-06-03 20:52:19 +10:00
tag.go Actually implement TagFilter.marker_count (#1603) 2021-08-04 13:39:24 +10:00
tag_test.go Actually implement TagFilter.marker_count (#1603) 2021-08-04 13:39:24 +10:00
transaction.go Saved filters (#1474) 2021-06-16 14:53:32 +10:00