Fix outstanding tagger issues (#912)

* Fix potential image errors
* Fix issue preventing favoriting of tagged performers
* Add error handling in case of network issues
* Show individual search errors
* Unset scene results if query fails
* Don't abort scene submission if scene id isn't found
This commit is contained in:
InfiniteTF
2020-11-04 22:28:58 +01:00
committed by GitHub
parent 66c7af62f6
commit 9ec762ae9a
9 changed files with 131 additions and 54 deletions

View File

@@ -93,21 +93,27 @@ func (c Client) FindStashBoxScenesByFingerprints(sceneIDs []string) ([]*models.S
}
func (c Client) findStashBoxScenesByFingerprints(fingerprints []string) ([]*models.ScrapedScene, error) {
scenes, err := c.client.FindScenesByFingerprints(context.TODO(), fingerprints)
if err != nil {
return nil, err
}
sceneFragments := scenes.FindScenesByFingerprints
var ret []*models.ScrapedScene
for _, s := range sceneFragments {
ss, err := sceneFragmentToScrapedScene(s)
for i := 0; i < len(fingerprints); i += 100 {
end := i + 100
if end > len(fingerprints) {
end = len(fingerprints)
}
scenes, err := c.client.FindScenesByFingerprints(context.TODO(), fingerprints[i:end])
if err != nil {
return nil, err
}
ret = append(ret, ss)
sceneFragments := scenes.FindScenesByFingerprints
for _, s := range sceneFragments {
ss, err := sceneFragmentToScrapedScene(s)
if err != nil {
return nil, err
}
ret = append(ret, ss)
}
}
return ret, nil
@@ -127,7 +133,7 @@ func (c Client) SubmitStashBoxFingerprints(sceneIDs []string, endpoint string) (
}
if scene == nil {
return false, fmt.Errorf("scene with id %d not found", idInt)
continue
}
stashIDs, err := jqb.GetSceneStashIDs(idInt)