From 3a63f1f9b7e0a2cc504c143221fb2fb9ee2858f7 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 17 Nov 2022 08:23:08 +1100 Subject: [PATCH] Fire hook when gallery created from image (#3134) --- pkg/image/scan.go | 4 ++++ ui/v2.5/src/docs/en/Changelog/v0180.md | 1 + 2 files changed, 5 insertions(+) diff --git a/pkg/image/scan.go b/pkg/image/scan.go index 3b96d400e..628a33d50 100644 --- a/pkg/image/scan.go +++ b/pkg/image/scan.go @@ -255,6 +255,8 @@ func (h *ScanHandler) getOrCreateFolderBasedGallery(ctx context.Context, f file. return nil, fmt.Errorf("creating folder based gallery: %w", err) } + h.PluginCache.RegisterPostHooks(ctx, newGallery.ID, plugin.GalleryCreatePost, nil, nil) + // it's possible that there are other images in the folder that // need to be added to the new gallery. Find and add them now. if err := h.associateFolderImages(ctx, newGallery); err != nil { @@ -311,6 +313,8 @@ func (h *ScanHandler) getOrCreateZipBasedGallery(ctx context.Context, zipFile fi return nil, fmt.Errorf("creating zip-based gallery: %w", err) } + h.PluginCache.RegisterPostHooks(ctx, newGallery.ID, plugin.GalleryCreatePost, nil, nil) + return newGallery, nil } diff --git a/ui/v2.5/src/docs/en/Changelog/v0180.md b/ui/v2.5/src/docs/en/Changelog/v0180.md index df1a10214..334d6509b 100644 --- a/ui/v2.5/src/docs/en/Changelog/v0180.md +++ b/ui/v2.5/src/docs/en/Changelog/v0180.md @@ -14,6 +14,7 @@ * Changed Performer height to be numeric, and changed filtering accordingly. ([#3060](https://github.com/stashapp/stash/pull/3060)) ### 🐛 Bug fixes +* Fixed gallery create post hook not being fired during gallery creation. ([#3134](https://github.com/stashapp/stash/pull/3134)) * Fixed autotag error when tagging a large amount of objects. ([#3106](https://github.com/stashapp/stash/pull/3106)) * Fixed Gallery title being incorrectly marked as mandatory for file- and folder-based galleries. ([#3110](https://github.com/stashapp/stash/pull/3110)) * Fixed Saved Filters not ordered by name. ([#3101](https://github.com/stashapp/stash/pull/3101))