Fire hook when gallery created from image (#3134)

This commit is contained in:
WithoutPants
2022-11-17 08:23:08 +11:00
committed by GitHub
parent ffca8f0c0f
commit 3a63f1f9b7
2 changed files with 5 additions and 0 deletions

View File

@@ -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
}