Separate graphql API from rest of the system (#2503)

* Move graphql generated files to api
* Refactor identify options
* Remove models.StashBoxes
* Move ScraperSource to scraper package
* Rename field strategy enums
* Rename identify.TaskOptions to Options
This commit is contained in:
WithoutPants
2022-04-25 15:55:05 +10:00
parent 9dcf03eb70
commit 7b5bd80515
109 changed files with 2684 additions and 791 deletions

View File

@@ -54,12 +54,28 @@ type ExportTask struct {
DownloadHash string
}
type ExportObjectTypeInput struct {
Ids []string `json:"ids"`
All *bool `json:"all"`
}
type ExportObjectsInput struct {
Scenes *ExportObjectTypeInput `json:"scenes"`
Images *ExportObjectTypeInput `json:"images"`
Studios *ExportObjectTypeInput `json:"studios"`
Performers *ExportObjectTypeInput `json:"performers"`
Tags *ExportObjectTypeInput `json:"tags"`
Movies *ExportObjectTypeInput `json:"movies"`
Galleries *ExportObjectTypeInput `json:"galleries"`
IncludeDependencies *bool `json:"includeDependencies"`
}
type exportSpec struct {
IDs []int
all bool
}
func newExportSpec(input *models.ExportObjectTypeInput) *exportSpec {
func newExportSpec(input *ExportObjectTypeInput) *exportSpec {
if input == nil {
return &exportSpec{}
}
@@ -77,7 +93,7 @@ func newExportSpec(input *models.ExportObjectTypeInput) *exportSpec {
return ret
}
func CreateExportTask(a models.HashAlgorithm, input models.ExportObjectsInput) *ExportTask {
func CreateExportTask(a models.HashAlgorithm, input ExportObjectsInput) *ExportTask {
includeDeps := false
if input.IncludeDependencies != nil {
includeDeps = *input.IncludeDependencies