From 324d6134b233ea4393c4a119d8b87422218e7c44 Mon Sep 17 00:00:00 2001 From: spaceyuck Date: Fri, 6 Mar 2026 19:44:11 +0100 Subject: [PATCH 1/2] add Auto-Tag scraper to image details edit scrape menu it was already available for galleries and scenes, images just seem to have slipped through --- pkg/scraper/autotag.go | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/pkg/scraper/autotag.go b/pkg/scraper/autotag.go index 672c0b90b..7e6ba5c36 100644 --- a/pkg/scraper/autotag.go +++ b/pkg/scraper/autotag.go @@ -89,6 +89,47 @@ func autotagMatchTags(ctx context.Context, path string, tagReader models.TagAuto return ret, nil } +func (s autotagScraper) viaImage(ctx context.Context, client *http.Client, image *models.Image) (*models.ScrapedImage, error) { + var ret *models.ScrapedImage + const trimExt = false + + // populate performers, studio and tags based on scene path + if err := txn.WithReadTxn(ctx, s.txnManager, func(ctx context.Context) error { + path := image.Path + if path == "" { + return nil + } + + performers, err := autotagMatchPerformers(ctx, path, s.performerReader, trimExt) + if err != nil { + return fmt.Errorf("autotag scraper viaImage: %w", err) + } + studio, err := autotagMatchStudio(ctx, path, s.studioReader, trimExt) + if err != nil { + return fmt.Errorf("autotag scraper viaImage: %w", err) + } + + tags, err := autotagMatchTags(ctx, path, s.tagReader, trimExt) + if err != nil { + return fmt.Errorf("autotag scraper viaImage: %w", err) + } + + if len(performers) > 0 || studio != nil || len(tags) > 0 { + ret = &models.ScrapedImage{ + Performers: performers, + Studio: studio, + Tags: tags, + } + } + + return nil + }); err != nil { + return nil, err + } + + return ret, nil +} + func (s autotagScraper) viaScene(ctx context.Context, _client *http.Client, scene *models.Scene) (*models.ScrapedScene, error) { var ret *models.ScrapedScene const trimExt = false @@ -181,6 +222,8 @@ func (s autotagScraper) supports(ty ScrapeContentType) bool { return true case ScrapeContentTypeGallery: return true + case ScrapeContentTypeImage: + return true } return false @@ -204,6 +247,9 @@ func (s autotagScraper) spec() Scraper { Gallery: &ScraperSpec{ SupportedScrapes: supportedScrapes, }, + Image: &ScraperSpec{ + SupportedScrapes: supportedScrapes, + }, } } From 85460b4e21e04cf578a83fd5a1d14c0d003571a4 Mon Sep 17 00:00:00 2001 From: spaceyuck Date: Sat, 14 Mar 2026 08:38:38 +0100 Subject: [PATCH 2/2] image details Auto-Tag scraper requested changes --- pkg/scraper/autotag.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/scraper/autotag.go b/pkg/scraper/autotag.go index 7e6ba5c36..84fa598d4 100644 --- a/pkg/scraper/autotag.go +++ b/pkg/scraper/autotag.go @@ -89,11 +89,13 @@ func autotagMatchTags(ctx context.Context, path string, tagReader models.TagAuto return ret, nil } -func (s autotagScraper) viaImage(ctx context.Context, client *http.Client, image *models.Image) (*models.ScrapedImage, error) { +func (s autotagScraper) viaImage(ctx context.Context, _client *http.Client, image *models.Image) (*models.ScrapedImage, error) { var ret *models.ScrapedImage - const trimExt = false - // populate performers, studio and tags based on scene path + // only trim extension if image is file-based + trimExt := image.PrimaryFileID != nil + + // populate performers, studio and tags based on image path if err := txn.WithReadTxn(ctx, s.txnManager, func(ctx context.Context) error { path := image.Path if path == "" {