From 2f312ac651af91a8fcf208658d03debcd8b5ee55 Mon Sep 17 00:00:00 2001 From: Flashy78 <90150289+Flashy78@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:17:20 -0800 Subject: [PATCH] Use first url available if no studio url (#3439) --- pkg/scraper/stashbox/stash_box.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/scraper/stashbox/stash_box.go b/pkg/scraper/stashbox/stash_box.go index a1f756766..69b200614 100644 --- a/pkg/scraper/stashbox/stash_box.go +++ b/pkg/scraper/stashbox/stash_box.go @@ -707,6 +707,13 @@ func (c Client) sceneFragmentToScrapedScene(ctx context.Context, s *graphql.Scen ss.Image = getFirstImage(ctx, c.getHTTPClient(), s.Images) } + if ss.URL == nil && len(s.Urls) > 0 { + // The scene in Stash-box may not have a Studio URL but it does have another URL. + // For example it has a www.manyvids.com URL, which is auto set as type ManyVids. + // This should be re-visited once Stashapp can support more than one URL. + ss.URL = &s.Urls[0].URL + } + if err := txn.WithReadTxn(ctx, c.txnManager, func(ctx context.Context) error { pqb := c.repository.Performer tqb := c.repository.Tag