Include database cover in draft submission if filesystem version not present (#3465)

* Fix styling of stash-box dropdown
* Use cover blob in draft submission if present
This commit is contained in:
WithoutPants
2023-02-27 10:28:00 +11:00
committed by GitHub
parent dc934d73fa
commit 967a25f64a
6 changed files with 31 additions and 14 deletions

View File

@@ -58,9 +58,16 @@ func (r *mutationResolver) SubmitStashBoxSceneDraft(ctx context.Context, input S
return err
}
filepath := manager.GetInstance().Paths.Scene.GetScreenshotPath(scene.GetHash(config.GetInstance().GetVideoFileNamingAlgorithm()))
if scene == nil {
return fmt.Errorf("scene with id %d not found", id)
}
res, err = client.SubmitSceneDraft(ctx, scene, boxes[input.StashBoxIndex].Endpoint, filepath)
cover, err := r.sceneService.GetCover(ctx, scene)
if err != nil {
return fmt.Errorf("getting scene cover: %w", err)
}
res, err = client.SubmitSceneDraft(ctx, scene, boxes[input.StashBoxIndex].Endpoint, cover)
return err
})