mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Multiple scene URLs (#3852)
* Add URLs scene relationship * Update unit tests * Update scene edit and details pages * Update scrapers to use urls * Post-process scenes during query scrape * Update UI for URLs * Change urls label
This commit is contained in:
@@ -684,6 +684,7 @@ func getFingerprints(scene *graphql.SceneFragment) []*models.StashBoxFingerprint
|
||||
|
||||
func (c Client) sceneFragmentToScrapedScene(ctx context.Context, s *graphql.SceneFragment) (*scraper.ScrapedScene, error) {
|
||||
stashID := s.ID
|
||||
|
||||
ss := &scraper.ScrapedScene{
|
||||
Title: s.Title,
|
||||
Code: s.Code,
|
||||
@@ -698,6 +699,14 @@ func (c Client) sceneFragmentToScrapedScene(ctx context.Context, s *graphql.Scen
|
||||
// stash_id
|
||||
}
|
||||
|
||||
for _, u := range s.Urls {
|
||||
ss.URLs = append(ss.URLs, u.URL)
|
||||
}
|
||||
|
||||
if len(ss.URLs) > 0 {
|
||||
ss.URL = &ss.URLs[0]
|
||||
}
|
||||
|
||||
if len(s.Images) > 0 {
|
||||
// TODO - #454 code sorts images by aspect ratio according to a wanted
|
||||
// orientation. I'm just grabbing the first for now
|
||||
@@ -823,8 +832,9 @@ func (c Client) SubmitSceneDraft(ctx context.Context, scene *models.Scene, endpo
|
||||
if scene.Director != "" {
|
||||
draft.Director = &scene.Director
|
||||
}
|
||||
if scene.URL != "" && len(strings.TrimSpace(scene.URL)) > 0 {
|
||||
url := strings.TrimSpace(scene.URL)
|
||||
// TODO - draft does not accept multiple URLs. Use single URL for now.
|
||||
if len(scene.URLs.List()) > 0 {
|
||||
url := strings.TrimSpace(scene.URLs.List()[0])
|
||||
draft.URL = &url
|
||||
}
|
||||
if scene.Date != nil {
|
||||
|
||||
Reference in New Issue
Block a user