Skip to content

Commit

Permalink
Fix url's from gallery scrapers (#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 Oct 16, 2023
1 parent 479e716 commit 40bcb4b
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 40bcb4b

Please sign in to comment.