feat: add gallery support to identify task - #6927
Open
slick-daddy wants to merge 20 commits into
Open
Conversation
… to identify options and GraphQL schema
… gallery job routing
…Identify button, i18n keys
…rror, nil ret check, i18n gallery placeholder
1. Fix dead identifyAllGalleries in Execute: when GalleryIDs and SceneIDs are both empty, fall through to identifyAllGalleries (mirroring the scene pattern with identifyAllScenes). 2. Add post-update hooks to modifyGallery: - Define GalleryUpdatePostHookExecutor interface in identify package - Add PostHookExecutor field to GalleryIdentifier struct - Invoke ExecuteGalleryUpdatePostHooks after successful gallery update - Add ExecuteGalleryUpdatePostHooks method to plugin Cache - Wire the executor in task_identify.go 3. Disable 'Set as default' button in gallery mode to prevent gallery sources from overwriting the shared scene identify defaults slot.
…rType and StashIds resolver The generated exec file references stash_id fields on ImageFilterType that did not exist, and requires a StashIds method on imageResolver. Add the missing fields to the model type and a stub resolver returning nil.
…alleryRelationships.stashIDs method
…s scene/gallery fields
- In getGalleryPartial, replace sliceutil.Exclude check in FieldStrategyOverwrite with sliceutil.SliceSame to also detect when gallery URLs should be removed (not just added). - Add explanatory comment to imageResolver.StashIds documenting it is a pre-existing stub since the Image model and repository layer do not support stash IDs.
The earlier exclusive branching silently dropped scenes when: 1. Both galleryIDs and sceneIDs were provided 2. Identify-all mode with both scene + gallery scrapers configured Now galleries and scenes run sequentially within a single job, and redundant getGallerySources() call is avoided when GalleryIDs > 0.
- Add repository field and overridable source/identify function fields - Replace instance.Repository with j.repository - Add nil-guard to Progress.updated() to prevent panic in tests - 13 table-driven tests covering all Execute() orchestration paths: no sources, scene IDs, gallery IDs, both IDs, not found, invalid IDs, identify-all (scenes/galleries/both), cancellation
slick-daddy
force-pushed
the
gallery-identify
branch
from
June 19, 2026 03:36
5195e4b to
77aec28
Compare
…ers check, dead code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds gallery support to the Identify feature, mirroring the existing scene identify pipeline. Galleries can now be identified individually (by selecting them in the gallery list) or in bulk (identify-all mode for unorganized galleries).
Architecture
The gallery identify implementation is a faithful parallel of the scene identify system:
SceneIdentifierGalleryIdentifier(internal/identify/gallery.go)sceneRelationships{studio, performers, tags}galleryRelationships{studio, performers, tags}SceneUpdatePostHookExecutorGalleryUpdatePostHookExecutor(internal/identify/identify.go)scraperSource.ScrapeScenes()galleryScraperSource.ScrapeGalleries()(internal/manager/task_identify.go)SceneIdentifier.Identify()→ scrape → getUpdater → modifyGalleryIdentifier.Identify()→ same 3-step pipelineidentifyAllScenes()(batch query viaScene.Query())identifyAllGalleries()(batch query viaGallery.Query())getScenePartial()getGalleryPartial()SceneUpdateSet/ScenePartialgallery.UpdateSet/GalleryPartial(pkg/gallery/update.go)Key differences:
stash_box_endpointare logged as warnings and skippedgetGalleryPartial()mapsScrapedGalleryfields toGalleryPartial:title,code,details,photographer,date,urls,organizedFrontend
IdentifyDialogaccepts atypeprop ("scene"|"gallery")galleryIDsinstead ofsceneIDsin the identify inputtype="gallery")Control Flow (
IdentifyJob.Execute())GalleryIDsare explicitly provided → identify those galleriesSceneIDs→ identify all unorganized galleries (only if gallery sources exist)SceneIDsprovided, or if noGalleryIDs— preserving the legacy scene-only path)This ensures scenes are never silently dropped when gallery sources are present.
Test Coverage
13 table-driven tests in
internal/manager/task_identify_test.gocoveringIdentifyJob.Execute()orchestration:[1, 2][1, 2][1][2][999][999]["bad"]["bad"][1, 2, 3][1, 2, 3]The test job uses overridable
sourcesFn/gallerySourcesFn/identifySceneFn/identifyGalleryFnfields to avoid globalinstancedependencies (same pattern used byScanJob).Notes
ScrapedGalleryhas noImagefieldPersonal Testing
I am not familiar with galleries and don't use them personally. It would be great to hear some feedback from users who use it. Test coverage has been added logically but user testing is still needed.