Commit graph

3194 commits

Author SHA1 Message Date
notsafeforgit
faef431513 fix: remove unused goimagehash import in phash utility 2026-03-29 23:47:36 -07:00
notsafeforgit
b9752723b6 perf: massive optimization for image and scene duplicate detection
This update provides significant performance improvements for both image and scene duplicate searching:

1. Optimized the core Hamming distance algorithm in pkg/utils/phash.go:
   - Uses native CPU popcount instructions (math/bits) for bit counting.
   - Pre-calculates hash values to eliminate object allocations in the hot loop.
   - Halves the number of comparisons by leveraging the symmetry of the Hamming distance.
   - The loop is now several orders of magnitude faster and allocation-free.

2. Solved the N+1 database query bottleneck:
   - Replaced individual database lookups for each duplicate group with a single batched query for all duplicate IDs.
   - This optimization was applied to both Image and Scene repositories.

3. Simplified the SQL fast path for exact image matches to remove redundant table joins.
2026-03-29 23:47:36 -07:00
notsafeforgit
3444c21263 perf(sqlite): implement SQL-based fast path for exact image duplicate detection
This change adds a specialized SQL query to find exact image duplicate matches (distance 0) directly in the database.

Previously, the image duplicate checker always used an O(N^2) Go-based comparison loop, which caused indefinite loading and timeouts on libraries with a large number of images. The new SQL fast path reduces the time to find exact duplicates from minutes/hours to milliseconds.
2026-03-29 23:47:36 -07:00
notsafeforgit
fcc5b51bfd fix(sqlite): fix image duplicate detection by scanning phash as integer
This fixes a bug where identical image duplicates were not being detected.

The implementation was incorrectly scanning the phash BLOB into a string and then attempting to parse it as a hex string. Since phashes are stored as 64-bit integers, they were being converted to decimal strings. For phashes with the MSB set (negative when treated as int64), the resulting decimal string started with a '-', which caused the hex parser to fail and skip the image entirely.

Additionally, even for non-negative phashes, parsing a decimal string as hex yielded incorrect hash values.

Scanning directly into the utils.Phash struct (which uses int64) matches how Scene phashes are handled and ensures the hash values are correct.
2026-03-29 23:47:36 -07:00
DogmaDragon
b087b6b62a Update capitalization in localization strings 2026-03-29 23:47:36 -07:00
notsafeforgit
1b093e244d fix: update image duplicate checker UI and API handling
- Fixes 400 error in ImageDuplicateChecker

- Updates UI and frontend types

- Fixes tools casing
2026-03-29 23:47:36 -07:00
notsafeforgit
6c6f02131d chore: revert changes to en-US.json 2026-03-29 23:47:36 -07:00
notsafeforgit
9e54daef97 fix: resolve image duplicate finder issues
- Wrap FindDuplicateImages query in r.withReadTxn() to ensure a database transaction in context.
- Use queryFunc instead of queryStruct for fetching multiple hashes, preventing runtime errors.
- Fix N+1 query issue in duplicate grouping by using qb.FindMany() instead of qb.Find() for each duplicate image.
- Revert searchColumns array to exclude "images.details" which was from another PR and remove related failing test.
2026-03-29 23:47:36 -07:00
notsafeforgit
cc5be78489 fix: resolve unused import and undefined reference in sqlite image repository
- Removed unused `strconv` import from `pkg/sqlite/image.go`.
- Added missing `github.com/stashapp/stash/pkg/utils` import to resolve the undefined `utils` reference.
- Fixed pagination prop in ImageDuplicateChecker component.
- Formatted modified go files using gofmt.
- Ran prettier over the UI codebase to resolve the formatting check CI failure.
2026-03-29 23:47:36 -07:00
notsafeforgit
b6eaeaad8a feat: add edit and delete actions to image duplicate checker
This adds checkboxes to select duplicate images and integrates the existing EditImagesDialog and DeleteImagesDialog, allowing users to resolve duplicates directly from the tool.
2026-03-29 23:47:36 -07:00
notsafeforgit
0d05dd3e2c feat: improve Image Duplicate Checker implementation
This change unifies the duplicate detection logic by leveraging the shared phash utility. It also enhances the UI with:
- Pagination for large result sets.
- Sorting duplicate groups by total file size.
- A more detailed table view with image thumbnails, paths, and dimensions.
- Consistency with the existing Scene Duplicate Checker tool.
2026-03-29 23:47:36 -07:00
notsafeforgit
2fb31cfff2 feat: Implement Image Duplicate Checker
This change introduces a new tool to identify duplicate images based on their perceptual hash (phash). It includes:
- Backend implementation for phash distance comparison and grouping.
- GraphQL schema updates and API resolvers.
- Frontend UI for the Image Duplicate Checker tool.
- Unit tests for the image search and duplicate detection logic.
2026-03-29 23:47:36 -07:00
WithoutPants
2da8074316
Codeberg weblate translation update (#6767)
* Translated using Weblate (French)

Currently translated at 100.0% (1341 of 1341 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/fr/

* Translated using Weblate (Turkish)

Currently translated at 75.3% (1010 of 1341 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/tr/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (1341 of 1341 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/uk/

* Translated using Weblate (French)

Currently translated at 99.9% (1345 of 1346 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/fr/

* Translated using Weblate (Korean)

Currently translated at 100.0% (1346 of 1346 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/ko/

* Translated using Weblate (French)

Currently translated at 100.0% (1346 of 1346 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/fr/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (1346 of 1346 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/uk/

* Translated using Weblate (Chinese (Simplified Han script))

Currently translated at 100.0% (1346 of 1346 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/zh_Hans/

* Translated using Weblate (Portuguese (Brazil))

Currently translated at 67.3% (906 of 1346 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/pt_BR/

* Update translation files

Updated by "Cleanup translation files" add-on in Weblate.

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/

* Translated using Weblate (French)

Currently translated at 100.0% (1348 of 1348 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/fr/

* Translated using Weblate (Czech)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/cs/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/es/

* Translated using Weblate (Korean)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/ko/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/uk/

* Translated using Weblate (French)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/fr/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/es/

* Translated using Weblate (Arabic)

Currently translated at 56.9% (769 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/ar/

* Translated using Weblate (Polish)

Currently translated at 80.1% (1083 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/pl/

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (1351 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/uk/

* Translated using Weblate (Arabic)

Currently translated at 58.0% (784 of 1351 strings)

Translation: stash/stash
Translate-URL: https://translate.codeberg.org/projects/stash/stash/ar/

---------

Co-authored-by: doodoo <doodoo@noreply.codeberg.org>
Co-authored-by: slickdaddy <slickdaddy@noreply.codeberg.org>
Co-authored-by: Saenko <saenko@noreply.codeberg.org>
Co-authored-by: lugged9922 <lugged9922@noreply.codeberg.org>
Co-authored-by: wql219 <wql219@noreply.codeberg.org>
Co-authored-by: tiagodamian <tiagodamian@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: NymeriaCZ <nymeriacz@noreply.codeberg.org>
Co-authored-by: donlothario <donlothario@noreply.codeberg.org>
Co-authored-by: gallegonovato <gallegonovato@noreply.codeberg.org>
Co-authored-by: interj4 <interj4@noreply.codeberg.org>
Co-authored-by: brnd <brnd@noreply.codeberg.org>
2026-03-30 12:26:04 +11:00
WithoutPants
b70922488b Update changelog 2026-03-30 11:57:28 +11:00
WithoutPants
0d9ad38bfe
Clear search results and states from taggers when source changes (#6766) 2026-03-30 11:43:39 +11:00
WithoutPants
a4b0a7a194
Exclude source objects from destination select and vice versa in merge dialogs (#6764)
* Add excludeIDs to PerformerSelect
* Exclude src from dest select and vice versa in merge dialogs
2026-03-30 11:43:06 +11:00
(Moai Emoji)
e755b2c24c
guard heatmap display on interactive_speed (#6746) 2026-03-30 11:38:46 +11:00
(Moai Emoji)
48ba26e17b
Allow unicode characters when stripping filenames for json export (#6748) 2026-03-30 11:38:20 +11:00
(Moai Emoji)
1e0b9902a3
Fix lightbox not reading scale-up setting from config (#6743) 2026-03-30 11:18:45 +11:00
smith113-p
0a4b427e1d
Show stash-box name in studio/performer tagger (#6759) 2026-03-30 11:09:17 +11:00
smith113-p
86188e5ff7
Use StashIDPill for displaying the scraped stash ID (#6761)
This is more consistent with other places that stash IDs are shown,
simplifies the code a bit, and lets you see at a glance which stash
box is being used.
2026-03-30 11:07:04 +11:00
eb2292
fe2a8eb0fd
Add keyboard shortcut "d d" to delete scene (#6755)
Co-authored-by: DogmaDragon <103123951+DogmaDragon@users.noreply.github.com>
2026-03-30 11:04:10 +11:00
feederbox826
af07fea289
[CI] add vips-heif (#6765) 2026-03-30 10:57:16 +11:00
(Moai Emoji)
8af2cfe525
Add mutex to repositoryCache for thread safety (#6741)
* Add mutex to package cache to prevent concurrent map write crash
* use sync.Once for cache init
2026-03-30 09:09:28 +11:00
Gykes
020c242ea6
Fix: Remove padFuzzyDate From Performer (#6757) 2026-03-30 09:07:54 +11:00
(Moai Emoji)
c861d3991a
Fix 'not equals' custom field to include unset objects (#6742)
* Fix custom field 'not equals' to include unset objects
* also fix Excludes and NotBetween null handling
2026-03-26 09:01:43 +11:00
DogmaDragon
eeee081eb7
Refactor README.md for better clarity and structure 2026-03-25 13:36:31 +02:00
WithoutPants
fd480c5a3e
Exclude zip folders when browsing scenes and galleries (#6740)
* Add short cuts when only getting zip/folder ids
* Don't show zip folders when viewing scenes and galleries.

Zip folders have no results for scenes and galleries, but will for images.
2026-03-24 15:03:58 +11:00
WithoutPants
2e48dbfc63 Update changelog 2026-03-23 17:32:30 +11:00
WithoutPants
87eabf0871
Show studio name if studio image not set on detail pages (#6716)
* Add StudioLogo component

If no studio image is set, shows the studio icon with the studio name.

* Add option to always show studio text
* Implement studio as text option
* Add studio logo to image
* Clarify existing show studio as text option
2026-03-23 17:13:34 +11:00
WithoutPants
b4c7ad4b81
Match exact tag names for batch tagger and show exact matches first for query (#6739)
* Enforce exact name matching for tag batch tagger
* Sort exact matches first for tag stashbox query
2026-03-23 16:29:49 +11:00
Gykes
e0f2c8e96d
FR: Auto Tag Confirmation Modal (#6735)
* Improve folder list styling
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2026-03-23 16:16:59 +11:00
WithoutPants
c5034422cb
Expand folder select hierarchy based on initial selected folder (#6738)
* Add sub_folders field to Folder type
* Expand folder select for the initial value
2026-03-23 16:15:23 +11:00
WithoutPants
c9d0afee56
Fix tagger modal issues (#6736)
* Make modal field/value styling consistent

Fixes URL list in studio list styling

* Add stash id pill to studio and tag modals

* Fix create parent check box

* Allow excluding parent studio

Disabled the create checkbox if parent studio is not excluded and does not exist.

* Don't render modal on every studio

* Show dialog when refreshing tags
2026-03-23 16:14:25 +11:00
feederbox826
3dbb0fcfc9
[hwaccel] add envvar for /dev/dri device (#6728) 2026-03-23 16:10:22 +11:00
WithoutPants
2bb1df8443
Fix incorrect where clause for gallery parent folder filter (#6737) 2026-03-23 13:45:31 +11:00
WithoutPants
feb4346e13 Maintain sub-folders selection when reselecting folder in filter 2026-03-23 12:31:48 +11:00
feederbox826
11f9e7ac51
[ci] add macos bundle (#6727) 2026-03-23 09:07:47 +11:00
feederbox826
b11be4807a
fetch full depth of git history for compiler (#6726)
[ci] run generate with fetch depth
2026-03-23 09:07:13 +11:00
DogmaDragon
7a18b5310b
Add GitHub Sponsors and forum links to about section (#6718)
* Add GitHub sponsors link to about section
* Add forum link to about section
* Fix casing in 'latest_version_build_hash' string in localization file
2026-03-23 09:06:20 +11:00
feederbox826
865c50d615
[ui] Fix Tag Modal cutting off (#6734) 2026-03-23 09:02:38 +11:00
feederbox826
c832e1a8a2
remove phasher target from bundle (#6717) [skip ci] 2026-03-19 18:31:14 +11:00
WithoutPants
ee9a852ec9 Remove phasher from build target [skip ci] 2026-03-19 16:35:12 +11:00
feederbox826
640d62cf59
[CI] ensure artifacts have +x bit set (#6715) 2026-03-19 15:10:04 +11:00
WithoutPants
58cf6307cb Update changelog 2026-03-19 13:59:42 +11:00
feederbox826
79b6cb6fd2
Lint + build update and retooling (#6638)
* update compiler and build process

- assemble cross-builds in multi-build steps
- clean up unnecessary dependences
- use node docker image instead of nodesource (unsupported)
- downgrade to freebsd12 to match compiler

Co-authored-by: Gykes <Gykes@pm.me>

* [compiler] use new image instead of placeholder

removes .gitignore, update README

* [CI] lock pnpm action-setup to SHA hash

* bump @actions/upload-artifact
---------
Co-authored-by: feederbox826 <feederbox826@users.noreply.github.com>
Co-authored-by: Gykes <Gykes@pm.me>
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2026-03-19 13:36:58 +11:00
WithoutPants
18eda31933
Make tagger views consistent (#6713)
* Show performer/studio tagger when no results
* Separate stash-box selector and config buttons
2026-03-19 13:35:18 +11:00
WithoutPants
5fd0d7bd68
Make hover volume configurable (#6712) 2026-03-19 13:16:20 +11:00
WithoutPants
c583e88caf
Replace "Source" with "Combined" in merge dialogs (#6711) 2026-03-19 12:10:42 +11:00
Stash-KennyG
4167224107
Feature: Add StashID guid consideration into select boxes (#6709)
* Add GUID search for performers in PerformerSelect component
* Refactor and apply to all objects with stash ids
---------
Co-authored-by: KennyG <kennyg@kennyg.com>
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2026-03-19 11:03:36 +11:00