Ignore non-existing scenes in fingerprint submits (#3039)

This commit is contained in:
WithoutPants 2022-10-24 10:26:21 +11:00 committed by GitHub
parent 4db0e48f73
commit 091950615e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,9 @@ package stashbox
import ( import (
"bytes" "bytes"
"context" "context"
"database/sql"
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"io" "io"
"mime/multipart" "mime/multipart"
@ -227,8 +229,9 @@ func (c Client) SubmitStashBoxFingerprints(ctx context.Context, sceneIDs []strin
qb := c.repository.Scene qb := c.repository.Scene
for _, sceneID := range ids { for _, sceneID := range ids {
// TODO - Find should return an appropriate not found error
scene, err := qb.Find(ctx, sceneID) scene, err := qb.Find(ctx, sceneID)
if err != nil { if err != nil && !errors.Is(err, sql.ErrNoRows) {
return err return err
} }