mirror of
https://github.com/stashapp/stash.git
synced 2026-05-09 05:05:29 +02:00
Update mapped.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
820f354ed2
commit
c371dbb717
1 changed files with 5 additions and 3 deletions
|
|
@ -184,12 +184,14 @@ func (s mappedScraper) scrapeScene(ctx context.Context, q mappedQuery) (*models.
|
|||
logger.Debug(`Processing scene:`)
|
||||
results := sceneMap.process(ctx, q, s.Common, urlsIsMulti)
|
||||
|
||||
// Initialize ret to a non-nil empty scene so that processSceneRelationships
|
||||
// can safely populate relationship fields even when no direct results were found.
|
||||
// Ensure ret is non-nil before calling processSceneRelationships so it can
|
||||
// safely populate relationship fields even when no direct results were found.
|
||||
// This preserves the intent of #3953: returning a scene with only relationships.
|
||||
ret := &models.ScrapedScene{}
|
||||
var ret *models.ScrapedScene
|
||||
if len(results) > 0 {
|
||||
ret = results[0].scrapedScene()
|
||||
} else {
|
||||
ret = &models.ScrapedScene{}
|
||||
}
|
||||
hasRelationships := s.processSceneRelationships(ctx, q, 0, ret)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue