mirror of
https://github.com/stashapp/stash.git
synced 2025-12-08 01:13:09 +01:00
* Make config instance-based * Remove config dependency in paths * Refactor config init * Allow startup without database * Get system status at UI initialise * Add setup wizard * Cache and Metadata optional. Database mandatory * Handle metadata not set during full import/export * Add links * Remove config check middleware * Stash not mandatory * Panic on missing mandatory config fields * Redirect setup to main page if setup not required * Add migration UI * Remove unused stuff * Move UI initialisation into App * Don't create metadata paths on RefreshConfig * Add folder selector for generated in setup * Env variable to set and create config file. Make docker images use a fixed config file. * Set config file during setup
22 lines
690 B
Go
22 lines
690 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/stashapp/stash/pkg/manager/config"
|
|
"github.com/stashapp/stash/pkg/models"
|
|
"github.com/stashapp/stash/pkg/scraper/stashbox"
|
|
)
|
|
|
|
func (r *mutationResolver) SubmitStashBoxFingerprints(ctx context.Context, input models.StashBoxFingerprintSubmissionInput) (bool, error) {
|
|
boxes := config.GetInstance().GetStashBoxes()
|
|
|
|
if input.StashBoxIndex < 0 || input.StashBoxIndex >= len(boxes) {
|
|
return false, fmt.Errorf("invalid stash_box_index %d", input.StashBoxIndex)
|
|
}
|
|
|
|
client := stashbox.NewClient(*boxes[input.StashBoxIndex], r.txnManager)
|
|
|
|
return client.SubmitStashBoxFingerprints(input.SceneIds, boxes[input.StashBoxIndex].Endpoint)
|
|
}
|