Skip to content

Commit

Permalink
Fix url's from gallery scrapers (stashapp#4206)
Browse files Browse the repository at this point in the history
* Fill in urls array when gallery scraper provides only single url
  • Loading branch information
Emilo2 authored and halkeye committed Sep 1, 2024
1 parent d457be6 commit 1939edc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/scraper/postprocessing.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ func (c Cache) postScrapeScene(ctx context.Context, scene ScrapedScene) (Scraped
}

func (c Cache) postScrapeGallery(ctx context.Context, g ScrapedGallery) (ScrapedContent, error) {
// set the URL/URLs field
if g.URL == nil && len(g.URLs) > 0 {
g.URL = &g.URLs[0]
}
if g.URL != nil && len(g.URLs) == 0 {
g.URLs = []string{*g.URL}
}

if err := txn.WithReadTxn(ctx, c.txnManager, func(ctx context.Context) error {
pqb := c.repository.PerformerFinder
tqb := c.repository.TagFinder
Expand Down

0 comments on commit 1939edc

Please sign in to comment.