diff --git a/README.md b/README.md index 5bfe46c4a..65af2d6fa 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,10 @@ Simply run the executable (double click the exe on windows or run `./stash-osx` *Note for Windows users:* Running the app might present a security prompt since the binary isn't signed yet. Just click more info and then the run anyway button. +## Slack + +I created a Slack channel to discuss the project. [Click here to join.](https://join.slack.com/stash-project/shared_invite/MTc2Nzg0NjAyNzg4LTE0OTM1ODU4MTgtNDcwODRiMGIwYQ) + #### FFMPEG If stash is unable to find or download FFMPEG then download it yourself from the link for your platform: @@ -27,9 +31,7 @@ The `ffmpeg(.exe)` and `ffprobe(.exe)` files should be placed in `~/.stash` on m # FAQ -> Does stash support multiple folders? - -Not yet, but this will come in the future. +TODO # Development @@ -66,7 +68,7 @@ TODO ## Cross compiling -This project makes use of [this](https://github.com/bep/dockerfiles/tree/master/ci-goreleaser) docker container to create an environment +This project uses a modification of [this](https://github.com/bep/dockerfiles/tree/master/ci-goreleaser) docker container to create an environment where the app can be cross compiled. This process is kicked off by CI via the `scripts/cross-compile.sh` script. Run the following command to open a bash shell to the container to poke around: diff --git a/pkg/api/resolver_query_configure.go b/pkg/api/resolver_mutation_configure.go similarity index 69% rename from pkg/api/resolver_query_configure.go rename to pkg/api/resolver_mutation_configure.go index 66c51f5e8..4ef0c161e 100644 --- a/pkg/api/resolver_query_configure.go +++ b/pkg/api/resolver_mutation_configure.go @@ -8,7 +8,7 @@ import ( "github.com/stashapp/stash/pkg/utils" ) -func (r *queryResolver) ConfigureGeneral(ctx context.Context, input *models.ConfigGeneralInput) (models.ConfigGeneralResult, error) { +func (r *mutationResolver) ConfigureGeneral(ctx context.Context, input *models.ConfigGeneralInput) (models.ConfigGeneralResult, error) { if input == nil { return makeConfigGeneralResult(), fmt.Errorf("nil input") } @@ -29,9 +29,3 @@ func (r *queryResolver) ConfigureGeneral(ctx context.Context, input *models.Conf return makeConfigGeneralResult(), nil } - -func makeConfigGeneralResult() models.ConfigGeneralResult { - return models.ConfigGeneralResult{ - Stashes: config.GetStashPaths(), - } -} diff --git a/pkg/api/resolver_query_configuration.go b/pkg/api/resolver_query_configuration.go new file mode 100644 index 000000000..781c82d4b --- /dev/null +++ b/pkg/api/resolver_query_configuration.go @@ -0,0 +1,32 @@ +package api + +import ( + "context" + "github.com/stashapp/stash/pkg/manager/config" + "github.com/stashapp/stash/pkg/models" + "github.com/stashapp/stash/pkg/utils" +) + +func (r *queryResolver) Configuration(ctx context.Context) (models.ConfigResult, error) { + return makeConfigResult(), nil +} + +func (r *queryResolver) Directories(ctx context.Context, path *string) ([]string, error) { + var dirPath = "" + if path != nil { + dirPath = *path + } + return utils.ListDir(dirPath), nil +} + +func makeConfigResult() models.ConfigResult { + return models.ConfigResult{ + General: makeConfigGeneralResult(), + } +} + +func makeConfigGeneralResult() models.ConfigGeneralResult { + return models.ConfigGeneralResult{ + Stashes: config.GetStashPaths(), + } +} \ No newline at end of file diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 9b3a8787c..69a3232da 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -54,13 +54,6 @@ func initConfig() { viper.AddConfigPath("$HOME/.stash") // Look for the config in the home directory viper.AddConfigPath(".") // Look for config in the working directory - viper.SetDefault(config.Database, paths.GetDefaultDatabaseFilePath()) - - // Set generated to the metadata path for backwards compat - if !viper.IsSet(config.Generated) { - viper.SetDefault(config.Generated, viper.GetString(config.Metadata)) - } - err := viper.ReadInConfig() // Find and read the config file if err != nil { // Handle errors reading the config file _ = utils.Touch(paths.GetDefaultConfigFilePath()) @@ -69,6 +62,11 @@ func initConfig() { } } + viper.SetDefault(config.Database, paths.GetDefaultDatabaseFilePath()) + + // Set generated to the metadata path for backwards compat + viper.SetDefault(config.Generated, viper.GetString(config.Metadata)) + // Watch for changes viper.WatchConfig() viper.OnConfigChange(func(e fsnotify.Event) { diff --git a/pkg/manager/paths/paths.go b/pkg/manager/paths/paths.go index 52b2d508d..023bc2bc7 100644 --- a/pkg/manager/paths/paths.go +++ b/pkg/manager/paths/paths.go @@ -1,7 +1,7 @@ package paths import ( - "os/user" + "github.com/stashapp/stash/pkg/utils" "path/filepath" ) @@ -25,16 +25,8 @@ func NewPaths() *Paths { return &p } -func GetHomeDirectory() string { - currentUser, err := user.Current() - if err != nil { - panic(err) - } - return currentUser.HomeDir -} - func GetConfigDirectory() string { - return filepath.Join(GetHomeDirectory(), ".stash") + return filepath.Join(utils.GetHomeDirectory(), ".stash") } func GetDefaultDatabaseFilePath() string { diff --git a/pkg/models/generated_exec.go b/pkg/models/generated_exec.go index 89b551e6a..ea9f1e8f7 100644 --- a/pkg/models/generated_exec.go +++ b/pkg/models/generated_exec.go @@ -51,6 +51,10 @@ type ComplexityRoot struct { Stashes func(childComplexity int) int } + ConfigResult struct { + General func(childComplexity int) int + } + FindGalleriesResultType struct { Count func(childComplexity int) int Galleries func(childComplexity int) int @@ -108,6 +112,7 @@ type ComplexityRoot struct { TagCreate func(childComplexity int, input TagCreateInput) int TagUpdate func(childComplexity int, input TagUpdateInput) int TagDestroy func(childComplexity int, input TagDestroyInput) int + ConfigureGeneral func(childComplexity int, input *ConfigGeneralInput) int } Performer struct { @@ -153,7 +158,8 @@ type ComplexityRoot struct { SceneMarkerTags func(childComplexity int, scene_id string) int ScrapeFreeones func(childComplexity int, performer_name string) int ScrapeFreeonesPerformerList func(childComplexity int, query string) int - ConfigureGeneral func(childComplexity int, input *ConfigGeneralInput) int + Configuration func(childComplexity int) int + Directories func(childComplexity int, path *string) int MetadataImport func(childComplexity int) int MetadataExport func(childComplexity int) int MetadataScan func(childComplexity int) int @@ -284,6 +290,7 @@ type MutationResolver interface { TagCreate(ctx context.Context, input TagCreateInput) (*Tag, error) TagUpdate(ctx context.Context, input TagUpdateInput) (*Tag, error) TagDestroy(ctx context.Context, input TagDestroyInput) (bool, error) + ConfigureGeneral(ctx context.Context, input *ConfigGeneralInput) (ConfigGeneralResult, error) } type PerformerResolver interface { ID(ctx context.Context, obj *Performer) (string, error) @@ -327,7 +334,8 @@ type QueryResolver interface { SceneMarkerTags(ctx context.Context, scene_id string) ([]SceneMarkerTag, error) ScrapeFreeones(ctx context.Context, performer_name string) (*ScrapedPerformer, error) ScrapeFreeonesPerformerList(ctx context.Context, query string) ([]string, error) - ConfigureGeneral(ctx context.Context, input *ConfigGeneralInput) (ConfigGeneralResult, error) + Configuration(ctx context.Context) (ConfigResult, error) + Directories(ctx context.Context, path *string) ([]string, error) MetadataImport(ctx context.Context) (string, error) MetadataExport(ctx context.Context) (string, error) MetadataScan(ctx context.Context) (string, error) @@ -607,6 +615,34 @@ func (e *executableSchema) field_Mutation_tagDestroy_args(ctx context.Context, r } +func (e *executableSchema) field_Mutation_configureGeneral_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + args := map[string]interface{}{} + var arg0 *ConfigGeneralInput + if tmp, ok := rawArgs["input"]; ok { + var err error + var ptr1 ConfigGeneralInput + if tmp != nil { + ptr1, err = UnmarshalConfigGeneralInput(tmp) + arg0 = &ptr1 + } + + if err != nil { + return nil, err + } + + if arg0 != nil { + var err error + arg0, err = e.ConfigGeneralInputMiddleware(ctx, arg0) + if err != nil { + return nil, err + } + } + } + args["input"] = arg0 + return args, nil + +} + func (e *executableSchema) field_Query_findScene_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { args := map[string]interface{}{} var arg0 *string @@ -1066,30 +1102,22 @@ func (e *executableSchema) field_Query_scrapeFreeonesPerformerList_args(ctx cont } -func (e *executableSchema) field_Query_configureGeneral_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { +func (e *executableSchema) field_Query_directories_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { args := map[string]interface{}{} - var arg0 *ConfigGeneralInput - if tmp, ok := rawArgs["input"]; ok { + var arg0 *string + if tmp, ok := rawArgs["path"]; ok { var err error - var ptr1 ConfigGeneralInput + var ptr1 string if tmp != nil { - ptr1, err = UnmarshalConfigGeneralInput(tmp) + ptr1, err = graphql.UnmarshalString(tmp) arg0 = &ptr1 } if err != nil { return nil, err } - - if arg0 != nil { - var err error - arg0, err = e.ConfigGeneralInputMiddleware(ctx, arg0) - if err != nil { - return nil, err - } - } } - args["input"] = arg0 + args["path"] = arg0 return args, nil } @@ -1159,6 +1187,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ConfigGeneralResult.Stashes(childComplexity), true + case "ConfigResult.general": + if e.complexity.ConfigResult.General == nil { + break + } + + return e.complexity.ConfigResult.General(childComplexity), true + case "FindGalleriesResultType.count": if e.complexity.FindGalleriesResultType.Count == nil { break @@ -1438,6 +1473,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.TagDestroy(childComplexity, args["input"].(TagDestroyInput)), true + case "Mutation.configureGeneral": + if e.complexity.Mutation.ConfigureGeneral == nil { + break + } + + args, err := e.field_Mutation_configureGeneral_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConfigureGeneral(childComplexity, args["input"].(*ConfigGeneralInput)), true + case "Performer.id": if e.complexity.Performer.Id == nil { break @@ -1796,17 +1843,24 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.ScrapeFreeonesPerformerList(childComplexity, args["query"].(string)), true - case "Query.configureGeneral": - if e.complexity.Query.ConfigureGeneral == nil { + case "Query.configuration": + if e.complexity.Query.Configuration == nil { break } - args, err := e.field_Query_configureGeneral_args(context.TODO(), rawArgs) + return e.complexity.Query.Configuration(childComplexity), true + + case "Query.directories": + if e.complexity.Query.Directories == nil { + break + } + + args, err := e.field_Query_directories_args(context.TODO(), rawArgs) if err != nil { return 0, false } - return e.complexity.Query.ConfigureGeneral(childComplexity, args["input"].(*ConfigGeneralInput)), true + return e.complexity.Query.Directories(childComplexity, args["path"].(*string)), true case "Query.metadataImport": if e.complexity.Query.MetadataImport == nil { @@ -2494,6 +2548,62 @@ func (ec *executionContext) _ConfigGeneralResult_stashes(ctx context.Context, fi return arr1 } +var configResultImplementors = []string{"ConfigResult"} + +// nolint: gocyclo, errcheck, gas, goconst +func (ec *executionContext) _ConfigResult(ctx context.Context, sel ast.SelectionSet, obj *ConfigResult) graphql.Marshaler { + fields := graphql.CollectFields(ctx, sel, configResultImplementors) + + out := graphql.NewFieldSet(fields) + invalid := false + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ConfigResult") + case "general": + out.Values[i] = ec._ConfigResult_general(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalid = true + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalid { + return graphql.Null + } + return out +} + +// nolint: vetshadow +func (ec *executionContext) _ConfigResult_general(ctx context.Context, field graphql.CollectedField, obj *ConfigResult) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "ConfigResult", + Field: field, + Args: nil, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, obj, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.General, nil + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(ConfigGeneralResult) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + + return ec._ConfigGeneralResult(ctx, field.Selections, &res) +} + var findGalleriesResultTypeImplementors = []string{"FindGalleriesResultType"} // nolint: gocyclo, errcheck, gas, goconst @@ -3598,6 +3708,11 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { invalid = true } + case "configureGeneral": + out.Values[i] = ec._Mutation_configureGeneral(ctx, field) + if out.Values[i] == graphql.Null { + invalid = true + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -4001,6 +4116,41 @@ func (ec *executionContext) _Mutation_tagDestroy(ctx context.Context, field grap return graphql.MarshalBoolean(res) } +// nolint: vetshadow +func (ec *executionContext) _Mutation_configureGeneral(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Mutation", + Field: field, + Args: nil, + } + ctx = graphql.WithResolverContext(ctx, rctx) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_configureGeneral_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + rctx.Args = args + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConfigureGeneral(rctx, args["input"].(*ConfigGeneralInput)) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(ConfigGeneralResult) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + + return ec._ConfigGeneralResult(ctx, field.Selections, &res) +} + var performerImplementors = []string{"Performer"} // nolint: gocyclo, errcheck, gas, goconst @@ -4935,10 +5085,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr } return res }) - case "configureGeneral": + case "configuration": field := field out.Concurrently(i, func() (res graphql.Marshaler) { - res = ec._Query_configureGeneral(ctx, field) + res = ec._Query_configuration(ctx, field) + if res == graphql.Null { + invalid = true + } + return res + }) + case "directories": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + res = ec._Query_directories(ctx, field) if res == graphql.Null { invalid = true } @@ -5833,7 +5992,35 @@ func (ec *executionContext) _Query_scrapeFreeonesPerformerList(ctx context.Conte } // nolint: vetshadow -func (ec *executionContext) _Query_configureGeneral(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { +func (ec *executionContext) _Query_configuration(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { + ctx = ec.Tracer.StartFieldExecution(ctx, field) + defer func() { ec.Tracer.EndFieldExecution(ctx) }() + rctx := &graphql.ResolverContext{ + Object: "Query", + Field: field, + Args: nil, + } + ctx = graphql.WithResolverContext(ctx, rctx) + ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) + resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Configuration(rctx) + }) + if resTmp == nil { + if !ec.HasError(rctx) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(ConfigResult) + rctx.Result = res + ctx = ec.Tracer.StartFieldChildExecution(ctx) + + return ec._ConfigResult(ctx, field.Selections, &res) +} + +// nolint: vetshadow +func (ec *executionContext) _Query_directories(ctx context.Context, field graphql.CollectedField) graphql.Marshaler { ctx = ec.Tracer.StartFieldExecution(ctx, field) defer func() { ec.Tracer.EndFieldExecution(ctx) }() rctx := &graphql.ResolverContext{ @@ -5843,7 +6030,7 @@ func (ec *executionContext) _Query_configureGeneral(ctx context.Context, field g } ctx = graphql.WithResolverContext(ctx, rctx) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_configureGeneral_args(ctx, rawArgs) + args, err := ec.field_Query_directories_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null @@ -5852,7 +6039,7 @@ func (ec *executionContext) _Query_configureGeneral(ctx context.Context, field g ctx = ec.Tracer.StartFieldResolverExecution(ctx, rctx) resTmp := ec.FieldMiddleware(ctx, nil, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ConfigureGeneral(rctx, args["input"].(*ConfigGeneralInput)) + return ec.resolvers.Query().Directories(rctx, args["path"].(*string)) }) if resTmp == nil { if !ec.HasError(rctx) { @@ -5860,11 +6047,19 @@ func (ec *executionContext) _Query_configureGeneral(ctx context.Context, field g } return graphql.Null } - res := resTmp.(ConfigGeneralResult) + res := resTmp.([]string) rctx.Result = res ctx = ec.Tracer.StartFieldChildExecution(ctx) - return ec._ConfigGeneralResult(ctx, field.Selections, &res) + arr1 := make(graphql.Array, len(res)) + + for idx1 := range res { + arr1[idx1] = func() graphql.Marshaler { + return graphql.MarshalString(res[idx1]) + }() + } + + return arr1 } // nolint: vetshadow @@ -11960,6 +12155,11 @@ type ConfigGeneralResult { stashes: [String!] } +"""All configuration settings""" +type ConfigResult { + general: ConfigGeneralResult! +} + ############# # Root Schema ############# @@ -12011,7 +12211,10 @@ type Query { scrapeFreeonesPerformerList(query: String!): [String!]! # Config - configureGeneral(input: ConfigGeneralInput): ConfigGeneralResult! + """Returns the current, complete configuration""" + configuration: ConfigResult! + """Returns an array of paths for the given path""" + directories(path: String): [String!]! # Metadata @@ -12049,10 +12252,13 @@ type Mutation { tagCreate(input: TagCreateInput!): Tag tagUpdate(input: TagUpdateInput!): Tag tagDestroy(input: TagDestroyInput!): Boolean! + + """Change general configuration options""" + configureGeneral(input: ConfigGeneralInput): ConfigGeneralResult! } type Subscription { - """Update from the meatadata manager""" + """Update from the metadata manager""" metadataUpdate: String! } diff --git a/pkg/models/generated_models.go b/pkg/models/generated_models.go index 76e51cbef..17ec6eb07 100644 --- a/pkg/models/generated_models.go +++ b/pkg/models/generated_models.go @@ -18,6 +18,11 @@ type ConfigGeneralResult struct { Stashes []string `json:"stashes"` } +// All configuration settings +type ConfigResult struct { + General ConfigGeneralResult `json:"general"` +} + type FindFilterType struct { Q *string `json:"q"` Page *int `json:"page"` diff --git a/pkg/utils/file.go b/pkg/utils/file.go index aee057f39..29dde14f5 100644 --- a/pkg/utils/file.go +++ b/pkg/utils/file.go @@ -4,7 +4,9 @@ import ( "fmt" "github.com/h2non/filetype" "github.com/h2non/filetype/types" + "io/ioutil" "os" + "os/user" "path/filepath" ) @@ -84,3 +86,41 @@ func EmptyDir(path string) error { return nil } + +func ListDir(path string) []string { + if path == "" { + path = GetHomeDirectory() + } + + absolutePath, err := filepath.Abs(path) + if err == nil { + path = absolutePath + } + + files, err := ioutil.ReadDir(path) + if err != nil { + path = filepath.Dir(path) + files, err = ioutil.ReadDir(path) + } + + var dirPaths []string + for _, file := range files { + if !file.IsDir() { + continue + } + abs, err := filepath.Abs(path) + if err != nil { + continue + } + dirPaths = append(dirPaths, filepath.Join(abs, file.Name())) + } + return dirPaths +} + +func GetHomeDirectory() string { + currentUser, err := user.Current() + if err != nil { + panic(err) + } + return currentUser.HomeDir +} diff --git a/schema/documents/data/config.graphql b/schema/documents/data/config.graphql new file mode 100644 index 000000000..566c1e3a8 --- /dev/null +++ b/schema/documents/data/config.graphql @@ -0,0 +1,9 @@ +fragment ConfigGeneralData on ConfigGeneralResult { + stashes +} + +fragment ConfigData on ConfigResult { + general { + ...ConfigGeneralData + } +} \ No newline at end of file diff --git a/schema/documents/mutations/config.graphql b/schema/documents/mutations/config.graphql new file mode 100644 index 000000000..9081cb8a2 --- /dev/null +++ b/schema/documents/mutations/config.graphql @@ -0,0 +1,5 @@ +mutation ConfigureGeneral($input: ConfigGeneralInput!) { + configureGeneral(input: $input) { + ...ConfigGeneralData + } +} \ No newline at end of file diff --git a/schema/documents/queries/settings/config.graphql b/schema/documents/queries/settings/config.graphql new file mode 100644 index 000000000..f92b14b7a --- /dev/null +++ b/schema/documents/queries/settings/config.graphql @@ -0,0 +1,9 @@ +query Configuration { + configuration { + ...ConfigData + } +} + +query Directories($path: String) { + directories(path: $path) +} \ No newline at end of file diff --git a/schema/documents/queries/settings/configure-general.graphql b/schema/documents/queries/settings/configure-general.graphql deleted file mode 100644 index 574c37e99..000000000 --- a/schema/documents/queries/settings/configure-general.graphql +++ /dev/null @@ -1,3 +0,0 @@ -query ConfigureGeneral($input: ConfigGeneralInput!) { - configureGeneral(input: $input) -} \ No newline at end of file diff --git a/schema/schema.graphql b/schema/schema.graphql index 673a2ceb6..c31be7825 100644 --- a/schema/schema.graphql +++ b/schema/schema.graphql @@ -386,6 +386,11 @@ type ConfigGeneralResult { stashes: [String!] } +"""All configuration settings""" +type ConfigResult { + general: ConfigGeneralResult! +} + ############# # Root Schema ############# @@ -437,7 +442,10 @@ type Query { scrapeFreeonesPerformerList(query: String!): [String!]! # Config - configureGeneral(input: ConfigGeneralInput): ConfigGeneralResult! + """Returns the current, complete configuration""" + configuration: ConfigResult! + """Returns an array of paths for the given path""" + directories(path: String): [String!]! # Metadata @@ -475,10 +483,13 @@ type Mutation { tagCreate(input: TagCreateInput!): Tag tagUpdate(input: TagUpdateInput!): Tag tagDestroy(input: TagDestroyInput!): Boolean! + + """Change general configuration options""" + configureGeneral(input: ConfigGeneralInput): ConfigGeneralResult! } type Subscription { - """Update from the meatadata manager""" + """Update from the metadata manager""" metadataUpdate: String! } diff --git a/ui/v2/src/components/Settings/SettingsConfigurationPanel.tsx b/ui/v2/src/components/Settings/SettingsConfigurationPanel.tsx index 54e7ef427..e274357ce 100644 --- a/ui/v2/src/components/Settings/SettingsConfigurationPanel.tsx +++ b/ui/v2/src/components/Settings/SettingsConfigurationPanel.tsx @@ -1,19 +1,73 @@ import { + Button, + Divider, + FormGroup, H1, H4, H6, + Spinner, Tag, } from "@blueprintjs/core"; -import React, { FunctionComponent } from "react"; +import React, { FunctionComponent, useEffect, useState } from "react"; import * as GQL from "../../core/generated-graphql"; +import { StashService } from "../../core/StashService"; +import { ErrorUtils } from "../../utils/errors"; import { TextUtils } from "../../utils/text"; +import { ToastUtils } from "../../utils/toasts"; +import { FolderSelect } from "../Shared/FolderSelect/FolderSelect"; interface IProps {} export const SettingsConfigurationPanel: FunctionComponent = (props: IProps) => { + // Editing config state + const [stashes, setStashes] = useState([]); + + // const [config, setConfig] = useState>({}); + const { data, error, loading } = StashService.useConfiguration(); + + const updateGeneralConfig = StashService.useConfigureGeneral({ + stashes, + }); + + useEffect(() => { + if (!data || !data.configuration || !!error) { return; } + const conf = StashService.nullToUndefined(data.configuration) as GQL.ConfigDataFragment; + if (!!conf.general) { + setStashes(conf.general.stashes || []); + } + // setConfig(conf); + }, [data]); + + function onStashesChanged(directories: string[]) { + setStashes(directories); + } + + async function onSave() { + try { + const result = await updateGeneralConfig(); + console.log(result); + ToastUtils.success("Updated config"); + } catch (e) { + ErrorUtils.handle(e); + } + } + return ( <> - Configuration + {!!error ? error : undefined} + {(!data || !data.configuration || loading) ? : undefined} +

Library

+ + + + + ); }; diff --git a/ui/v2/src/components/Shared/FolderSelect/FolderSelect.tsx b/ui/v2/src/components/Shared/FolderSelect/FolderSelect.tsx new file mode 100644 index 000000000..178a6cbcd --- /dev/null +++ b/ui/v2/src/components/Shared/FolderSelect/FolderSelect.tsx @@ -0,0 +1,85 @@ +import { + Button, + Classes, + Dialog, + InputGroup, + Spinner, +} from "@blueprintjs/core"; +import _ from "lodash"; +import React, { FunctionComponent, useEffect, useState } from "react"; +import { StashService } from "../../../core/StashService"; + +interface IProps { + directories: string[]; + onDirectoriesChanged: (directories: string[]) => void; +} + +export const FolderSelect: FunctionComponent = (props: IProps) => { + const [currentDirectory, setCurrentDirectory] = useState(""); + const [isDisplayingDialog, setIsDisplayingDialog] = useState(false); + const [selectableDirectories, setSelectableDirectories] = useState([]); + const [selectedDirectories, setSelectedDirectories] = useState([]); + const { data, error, loading } = StashService.useDirectories(currentDirectory); + + useEffect(() => { + setSelectedDirectories(props.directories); + }, [props.directories]); + + useEffect(() => { + if (!data || !data.directories || !!error) { return; } + setSelectableDirectories(StashService.nullToUndefined(data.directories)); + }, [data]); + + function onSelectDirectory() { + selectedDirectories.push(currentDirectory); + setSelectedDirectories(selectedDirectories); + setCurrentDirectory(""); + setIsDisplayingDialog(false); + props.onDirectoriesChanged(selectedDirectories); + } + + function onRemoveDirectory(directory: string) { + const newSelectedDirectories = selectedDirectories.filter((dir) => dir !== directory); + setSelectedDirectories(newSelectedDirectories); + props.onDirectoriesChanged(newSelectedDirectories); + } + + function renderDialog() { + return ( + setIsDisplayingDialog(false)} + title="Select Directory" + > +
+ setCurrentDirectory(e.target.value)} + value={currentDirectory} + rightElement={(!data || !data.directories || loading) ? : undefined} + /> + {selectableDirectories.map((path) => { + return
setCurrentDirectory(path)}>{path}
; + })} +
+
+
+ +
+
+
+ ); + } + + return ( + <> + {!!error ? error : undefined} + {renderDialog()} + {selectedDirectories.map((path) => { + return ; + })} + + + ); +}; diff --git a/ui/v2/src/core/StashService.ts b/ui/v2/src/core/StashService.ts index 9d93f637c..8d5d9699b 100644 --- a/ui/v2/src/core/StashService.ts +++ b/ui/v2/src/core/StashService.ts @@ -118,6 +118,9 @@ export class StashService { } public static useStats() { return GQL.useStats(); } + public static useConfiguration() { return GQL.useConfiguration(); } + public static useDirectories(path?: string) { return GQL.useDirectories({ variables: { path }}); } + public static usePerformerCreate(input: GQL.PerformerCreateInput) { return GQL.usePerformerCreate({ variables: input }); } @@ -143,6 +146,10 @@ export class StashService { return GQL.useTagUpdate({ variables: input, refetchQueries: ["AllTags"] }); } + public static useConfigureGeneral(input: GQL.ConfigGeneralInput) { + return GQL.useConfigureGeneral({ variables: { input }, refetchQueries: ["Configuration"] }); + } + public static queryScrapeFreeones(performerName: string) { return StashService.client.query({ query: GQL.ScrapeFreeonesDocument, diff --git a/ui/v2/src/core/generated-graphql.tsx b/ui/v2/src/core/generated-graphql.tsx index 15bf7b5fc..8cd7347f6 100644 --- a/ui/v2/src/core/generated-graphql.tsx +++ b/ui/v2/src/core/generated-graphql.tsx @@ -1,5 +1,5 @@ /* tslint:disable */ -// Generated in 2019-03-14T15:27:20-07:00 +// Generated in 2019-03-23T12:23:40-07:00 export type Maybe = T | undefined; export interface SceneFilterType { @@ -203,6 +203,11 @@ export interface TagDestroyInput { id: string; } +export interface ConfigGeneralInput { + /** Array of file paths to content */ + stashes?: Maybe; +} + export enum ResolutionEnum { Low = "LOW", Standard = "STANDARD", @@ -220,170 +225,202 @@ export enum SortDirectionEnum { // Documents // ==================================================== -export type FindScenesVariables = { - filter?: Maybe; - scene_filter?: Maybe; - scene_ids?: Maybe; +export type ConfigureGeneralVariables = { + input: ConfigGeneralInput; }; -export type FindScenesQuery = { - __typename?: "Query"; +export type ConfigureGeneralMutation = { + __typename?: "Mutation"; - findScenes: FindScenesFindScenes; + configureGeneral: ConfigureGeneralConfigureGeneral; }; -export type FindScenesFindScenes = { - __typename?: "FindScenesResultType"; +export type ConfigureGeneralConfigureGeneral = ConfigGeneralDataFragment; - count: number; - - scenes: FindScenesScenes[]; +export type PerformerCreateVariables = { + name?: Maybe; + url?: Maybe; + birthdate?: Maybe; + ethnicity?: Maybe; + country?: Maybe; + eye_color?: Maybe; + height?: Maybe; + measurements?: Maybe; + fake_tits?: Maybe; + career_length?: Maybe; + tattoos?: Maybe; + piercings?: Maybe; + aliases?: Maybe; + twitter?: Maybe; + instagram?: Maybe; + favorite?: Maybe; + image: string; }; -export type FindScenesScenes = SlimSceneDataFragment; +export type PerformerCreateMutation = { + __typename?: "Mutation"; -export type FindSceneVariables = { + performerCreate: Maybe; +}; + +export type PerformerCreatePerformerCreate = PerformerDataFragment; + +export type PerformerUpdateVariables = { id: string; - checksum?: Maybe; + name?: Maybe; + url?: Maybe; + birthdate?: Maybe; + ethnicity?: Maybe; + country?: Maybe; + eye_color?: Maybe; + height?: Maybe; + measurements?: Maybe; + fake_tits?: Maybe; + career_length?: Maybe; + tattoos?: Maybe; + piercings?: Maybe; + aliases?: Maybe; + twitter?: Maybe; + instagram?: Maybe; + favorite?: Maybe; + image?: Maybe; }; -export type FindSceneQuery = { - __typename?: "Query"; +export type PerformerUpdateMutation = { + __typename?: "Mutation"; - findScene: Maybe; - - sceneMarkerTags: FindSceneSceneMarkerTags[]; + performerUpdate: Maybe; }; -export type FindSceneFindScene = SceneDataFragment; +export type PerformerUpdatePerformerUpdate = PerformerDataFragment; -export type FindSceneSceneMarkerTags = { - __typename?: "SceneMarkerTag"; - - tag: FindSceneTag; - - scene_markers: FindSceneSceneMarkers[]; +export type SceneMarkerCreateVariables = { + title: string; + seconds: number; + scene_id: string; + primary_tag_id: string; + tag_ids?: Maybe; }; -export type FindSceneTag = { - __typename?: "Tag"; +export type SceneMarkerCreateMutation = { + __typename?: "Mutation"; + sceneMarkerCreate: Maybe; +}; + +export type SceneMarkerCreateSceneMarkerCreate = SceneMarkerDataFragment; + +export type SceneMarkerUpdateVariables = { id: string; + title: string; + seconds: number; + scene_id: string; + primary_tag_id: string; + tag_ids?: Maybe; +}; +export type SceneMarkerUpdateMutation = { + __typename?: "Mutation"; + + sceneMarkerUpdate: Maybe; +}; + +export type SceneMarkerUpdateSceneMarkerUpdate = SceneMarkerDataFragment; + +export type SceneMarkerDestroyVariables = { + id: string; +}; + +export type SceneMarkerDestroyMutation = { + __typename?: "Mutation"; + + sceneMarkerDestroy: boolean; +}; + +export type SceneUpdateVariables = { + id: string; + title?: Maybe; + details?: Maybe; + url?: Maybe; + date?: Maybe; + rating?: Maybe; + studio_id?: Maybe; + gallery_id?: Maybe; + performer_ids?: Maybe; + tag_ids?: Maybe; +}; + +export type SceneUpdateMutation = { + __typename?: "Mutation"; + + sceneUpdate: Maybe; +}; + +export type SceneUpdateSceneUpdate = SceneDataFragment; + +export type StudioCreateVariables = { + name: string; + url?: Maybe; + image: string; +}; + +export type StudioCreateMutation = { + __typename?: "Mutation"; + + studioCreate: Maybe; +}; + +export type StudioCreateStudioCreate = StudioDataFragment; + +export type StudioUpdateVariables = { + id: string; + name?: Maybe; + url?: Maybe; + image?: Maybe; +}; + +export type StudioUpdateMutation = { + __typename?: "Mutation"; + + studioUpdate: Maybe; +}; + +export type StudioUpdateStudioUpdate = StudioDataFragment; + +export type TagCreateVariables = { name: string; }; -export type FindSceneSceneMarkers = SceneMarkerDataFragment; +export type TagCreateMutation = { + __typename?: "Mutation"; -export type FindSceneMarkersVariables = { - filter?: Maybe; - scene_marker_filter?: Maybe; + tagCreate: Maybe; }; -export type FindSceneMarkersQuery = { - __typename?: "Query"; +export type TagCreateTagCreate = TagDataFragment; - findSceneMarkers: FindSceneMarkersFindSceneMarkers; -}; - -export type FindSceneMarkersFindSceneMarkers = { - __typename?: "FindSceneMarkersResultType"; - - count: number; - - scene_markers: FindSceneMarkersSceneMarkers[]; -}; - -export type FindSceneMarkersSceneMarkers = SceneMarkerDataFragment; - -export type SceneWallVariables = { - q?: Maybe; -}; - -export type SceneWallQuery = { - __typename?: "Query"; - - sceneWall: SceneWallSceneWall[]; -}; - -export type SceneWallSceneWall = SceneDataFragment; - -export type MarkerWallVariables = { - q?: Maybe; -}; - -export type MarkerWallQuery = { - __typename?: "Query"; - - markerWall: MarkerWallMarkerWall[]; -}; - -export type MarkerWallMarkerWall = SceneMarkerDataFragment; - -export type FindPerformersVariables = { - filter?: Maybe; - performer_filter?: Maybe; -}; - -export type FindPerformersQuery = { - __typename?: "Query"; - - findPerformers: FindPerformersFindPerformers; -}; - -export type FindPerformersFindPerformers = { - __typename?: "FindPerformersResultType"; - - count: number; - - performers: FindPerformersPerformers[]; -}; - -export type FindPerformersPerformers = PerformerDataFragment; - -export type FindPerformerVariables = { +export type TagDestroyVariables = { id: string; }; -export type FindPerformerQuery = { - __typename?: "Query"; +export type TagDestroyMutation = { + __typename?: "Mutation"; - findPerformer: Maybe; + tagDestroy: boolean; }; -export type FindPerformerFindPerformer = PerformerDataFragment; - -export type FindStudiosVariables = { - filter?: Maybe; -}; - -export type FindStudiosQuery = { - __typename?: "Query"; - - findStudios: FindStudiosFindStudios; -}; - -export type FindStudiosFindStudios = { - __typename?: "FindStudiosResultType"; - - count: number; - - studios: FindStudiosStudios[]; -}; - -export type FindStudiosStudios = StudioDataFragment; - -export type FindStudioVariables = { +export type TagUpdateVariables = { id: string; + name: string; }; -export type FindStudioQuery = { - __typename?: "Query"; +export type TagUpdateMutation = { + __typename?: "Mutation"; - findStudio: Maybe; + tagUpdate: Maybe; }; -export type FindStudioFindStudio = StudioDataFragment; +export type TagUpdateTagUpdate = TagDataFragment; export type FindGalleriesVariables = { filter?: Maybe; @@ -417,6 +454,30 @@ export type FindGalleryQuery = { export type FindGalleryFindGallery = GalleryDataFragment; +export type SceneWallVariables = { + q?: Maybe; +}; + +export type SceneWallQuery = { + __typename?: "Query"; + + sceneWall: SceneWallSceneWall[]; +}; + +export type SceneWallSceneWall = SceneDataFragment; + +export type MarkerWallVariables = { + q?: Maybe; +}; + +export type MarkerWallQuery = { + __typename?: "Query"; + + markerWall: MarkerWallMarkerWall[]; +}; + +export type MarkerWallMarkerWall = SceneMarkerDataFragment; + export type FindTagVariables = { id: string; }; @@ -450,60 +511,6 @@ export type MarkerStringsMarkerStrings = { title: string; }; -export type ScrapeFreeonesVariables = { - performer_name: string; -}; - -export type ScrapeFreeonesQuery = { - __typename?: "Query"; - - scrapeFreeones: Maybe; -}; - -export type ScrapeFreeonesScrapeFreeones = { - __typename?: "ScrapedPerformer"; - - name: Maybe; - - url: Maybe; - - twitter: Maybe; - - instagram: Maybe; - - birthdate: Maybe; - - ethnicity: Maybe; - - country: Maybe; - - eye_color: Maybe; - - height: Maybe; - - measurements: Maybe; - - fake_tits: Maybe; - - career_length: Maybe; - - tattoos: Maybe; - - piercings: Maybe; - - aliases: Maybe; -}; - -export type ScrapeFreeonesPerformersVariables = { - q: string; -}; - -export type ScrapeFreeonesPerformersQuery = { - __typename?: "Query"; - - scrapeFreeonesPerformerList: string[]; -}; - export type AllTagsVariables = {}; export type AllTagsQuery = { @@ -590,189 +597,187 @@ export type StatsStats = { tag_count: number; }; -export type SceneUpdateVariables = { +export type FindPerformersVariables = { + filter?: Maybe; + performer_filter?: Maybe; +}; + +export type FindPerformersQuery = { + __typename?: "Query"; + + findPerformers: FindPerformersFindPerformers; +}; + +export type FindPerformersFindPerformers = { + __typename?: "FindPerformersResultType"; + + count: number; + + performers: FindPerformersPerformers[]; +}; + +export type FindPerformersPerformers = PerformerDataFragment; + +export type FindPerformerVariables = { id: string; - title?: Maybe; - details?: Maybe; - url?: Maybe; - date?: Maybe; - rating?: Maybe; - studio_id?: Maybe; - gallery_id?: Maybe; - performer_ids?: Maybe; - tag_ids?: Maybe; }; -export type SceneUpdateMutation = { - __typename?: "Mutation"; +export type FindPerformerQuery = { + __typename?: "Query"; - sceneUpdate: Maybe; + findPerformer: Maybe; }; -export type SceneUpdateSceneUpdate = SceneDataFragment; +export type FindPerformerFindPerformer = PerformerDataFragment; -export type PerformerCreateVariables = { - name?: Maybe; - url?: Maybe; - birthdate?: Maybe; - ethnicity?: Maybe; - country?: Maybe; - eye_color?: Maybe; - height?: Maybe; - measurements?: Maybe; - fake_tits?: Maybe; - career_length?: Maybe; - tattoos?: Maybe; - piercings?: Maybe; - aliases?: Maybe; - twitter?: Maybe; - instagram?: Maybe; - favorite?: Maybe; - image: string; +export type FindSceneMarkersVariables = { + filter?: Maybe; + scene_marker_filter?: Maybe; }; -export type PerformerCreateMutation = { - __typename?: "Mutation"; +export type FindSceneMarkersQuery = { + __typename?: "Query"; - performerCreate: Maybe; + findSceneMarkers: FindSceneMarkersFindSceneMarkers; }; -export type PerformerCreatePerformerCreate = PerformerDataFragment; +export type FindSceneMarkersFindSceneMarkers = { + __typename?: "FindSceneMarkersResultType"; -export type PerformerUpdateVariables = { + count: number; + + scene_markers: FindSceneMarkersSceneMarkers[]; +}; + +export type FindSceneMarkersSceneMarkers = SceneMarkerDataFragment; + +export type FindScenesVariables = { + filter?: Maybe; + scene_filter?: Maybe; + scene_ids?: Maybe; +}; + +export type FindScenesQuery = { + __typename?: "Query"; + + findScenes: FindScenesFindScenes; +}; + +export type FindScenesFindScenes = { + __typename?: "FindScenesResultType"; + + count: number; + + scenes: FindScenesScenes[]; +}; + +export type FindScenesScenes = SlimSceneDataFragment; + +export type FindSceneVariables = { id: string; - name?: Maybe; - url?: Maybe; - birthdate?: Maybe; - ethnicity?: Maybe; - country?: Maybe; - eye_color?: Maybe; - height?: Maybe; - measurements?: Maybe; - fake_tits?: Maybe; - career_length?: Maybe; - tattoos?: Maybe; - piercings?: Maybe; - aliases?: Maybe; - twitter?: Maybe; - instagram?: Maybe; - favorite?: Maybe; - image?: Maybe; + checksum?: Maybe; }; -export type PerformerUpdateMutation = { - __typename?: "Mutation"; +export type FindSceneQuery = { + __typename?: "Query"; - performerUpdate: Maybe; + findScene: Maybe; + + sceneMarkerTags: FindSceneSceneMarkerTags[]; }; -export type PerformerUpdatePerformerUpdate = PerformerDataFragment; +export type FindSceneFindScene = SceneDataFragment; -export type StudioCreateVariables = { - name: string; - url?: Maybe; - image: string; +export type FindSceneSceneMarkerTags = { + __typename?: "SceneMarkerTag"; + + tag: FindSceneTag; + + scene_markers: FindSceneSceneMarkers[]; }; -export type StudioCreateMutation = { - __typename?: "Mutation"; +export type FindSceneTag = { + __typename?: "Tag"; - studioCreate: Maybe; -}; - -export type StudioCreateStudioCreate = StudioDataFragment; - -export type StudioUpdateVariables = { id: string; - name?: Maybe; - url?: Maybe; - image?: Maybe; -}; -export type StudioUpdateMutation = { - __typename?: "Mutation"; - - studioUpdate: Maybe; -}; - -export type StudioUpdateStudioUpdate = StudioDataFragment; - -export type TagCreateVariables = { name: string; }; -export type TagCreateMutation = { - __typename?: "Mutation"; +export type FindSceneSceneMarkers = SceneMarkerDataFragment; - tagCreate: Maybe; +export type ScrapeFreeonesVariables = { + performer_name: string; }; -export type TagCreateTagCreate = TagDataFragment; +export type ScrapeFreeonesQuery = { + __typename?: "Query"; -export type TagDestroyVariables = { - id: string; + scrapeFreeones: Maybe; }; -export type TagDestroyMutation = { - __typename?: "Mutation"; +export type ScrapeFreeonesScrapeFreeones = { + __typename?: "ScrapedPerformer"; - tagDestroy: boolean; + name: Maybe; + + url: Maybe; + + twitter: Maybe; + + instagram: Maybe; + + birthdate: Maybe; + + ethnicity: Maybe; + + country: Maybe; + + eye_color: Maybe; + + height: Maybe; + + measurements: Maybe; + + fake_tits: Maybe; + + career_length: Maybe; + + tattoos: Maybe; + + piercings: Maybe; + + aliases: Maybe; }; -export type TagUpdateVariables = { - id: string; - name: string; +export type ScrapeFreeonesPerformersVariables = { + q: string; }; -export type TagUpdateMutation = { - __typename?: "Mutation"; +export type ScrapeFreeonesPerformersQuery = { + __typename?: "Query"; - tagUpdate: Maybe; + scrapeFreeonesPerformerList: string[]; }; -export type TagUpdateTagUpdate = TagDataFragment; +export type ConfigurationVariables = {}; -export type SceneMarkerCreateVariables = { - title: string; - seconds: number; - scene_id: string; - primary_tag_id: string; - tag_ids?: Maybe; +export type ConfigurationQuery = { + __typename?: "Query"; + + configuration: ConfigurationConfiguration; }; -export type SceneMarkerCreateMutation = { - __typename?: "Mutation"; +export type ConfigurationConfiguration = ConfigDataFragment; - sceneMarkerCreate: Maybe; +export type DirectoriesVariables = { + path?: Maybe; }; -export type SceneMarkerCreateSceneMarkerCreate = SceneMarkerDataFragment; +export type DirectoriesQuery = { + __typename?: "Query"; -export type SceneMarkerUpdateVariables = { - id: string; - title: string; - seconds: number; - scene_id: string; - primary_tag_id: string; - tag_ids?: Maybe; -}; - -export type SceneMarkerUpdateMutation = { - __typename?: "Mutation"; - - sceneMarkerUpdate: Maybe; -}; - -export type SceneMarkerUpdateSceneMarkerUpdate = SceneMarkerDataFragment; - -export type SceneMarkerDestroyVariables = { - id: string; -}; - -export type SceneMarkerDestroyMutation = { - __typename?: "Mutation"; - - sceneMarkerDestroy: boolean; + directories: string[]; }; export type MetadataImportVariables = {}; @@ -815,6 +820,38 @@ export type MetadataCleanQuery = { metadataClean: string; }; +export type FindStudiosVariables = { + filter?: Maybe; +}; + +export type FindStudiosQuery = { + __typename?: "Query"; + + findStudios: FindStudiosFindStudios; +}; + +export type FindStudiosFindStudios = { + __typename?: "FindStudiosResultType"; + + count: number; + + studios: FindStudiosStudios[]; +}; + +export type FindStudiosStudios = StudioDataFragment; + +export type FindStudioVariables = { + id: string; +}; + +export type FindStudioQuery = { + __typename?: "Query"; + + findStudio: Maybe; +}; + +export type FindStudioFindStudio = StudioDataFragment; + export type MetadataUpdateVariables = {}; export type MetadataUpdateSubscription = { @@ -823,6 +860,20 @@ export type MetadataUpdateSubscription = { metadataUpdate: string; }; +export type ConfigGeneralDataFragment = { + __typename?: "ConfigGeneralResult"; + + stashes: Maybe; +}; + +export type ConfigDataFragment = { + __typename?: "ConfigResult"; + + general: ConfigDataGeneral; +}; + +export type ConfigDataGeneral = ConfigGeneralDataFragment; + export type GalleryDataFragment = { __typename?: "Gallery"; @@ -1190,6 +1241,22 @@ import * as ReactApolloHooks from "react-apollo-hooks"; // Fragments // ==================================================== +export const ConfigGeneralDataFragmentDoc = gql` + fragment ConfigGeneralData on ConfigGeneralResult { + stashes + } +`; + +export const ConfigDataFragmentDoc = gql` + fragment ConfigData on ConfigResult { + general { + ...ConfigGeneralData + } + } + + ${ConfigGeneralDataFragmentDoc} +`; + export const SlimPerformerDataFragmentDoc = gql` fragment SlimPerformerData on Performer { id @@ -1399,462 +1466,25 @@ export const SlimStudioDataFragmentDoc = gql` // Components // ==================================================== -export const FindScenesDocument = gql` - query FindScenes( - $filter: FindFilterType - $scene_filter: SceneFilterType - $scene_ids: [Int!] - ) { - findScenes( - filter: $filter - scene_filter: $scene_filter - scene_ids: $scene_ids - ) { - count - scenes { - ...SlimSceneData - } +export const ConfigureGeneralDocument = gql` + mutation ConfigureGeneral($input: ConfigGeneralInput!) { + configureGeneral(input: $input) { + ...ConfigGeneralData } } - ${SlimSceneDataFragmentDoc} + ${ConfigGeneralDataFragmentDoc} `; -export function useFindScenes( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindScenesDocument, - baseOptions - ); -} -export const FindSceneDocument = gql` - query FindScene($id: ID!, $checksum: String) { - findScene(id: $id, checksum: $checksum) { - ...SceneData - } - sceneMarkerTags(scene_id: $id) { - tag { - id - name - } - scene_markers { - ...SceneMarkerData - } - } - } - - ${SceneDataFragmentDoc} - ${SceneMarkerDataFragmentDoc} -`; -export function useFindScene( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindSceneDocument, - baseOptions - ); -} -export const FindSceneMarkersDocument = gql` - query FindSceneMarkers( - $filter: FindFilterType - $scene_marker_filter: SceneMarkerFilterType - ) { - findSceneMarkers( - filter: $filter - scene_marker_filter: $scene_marker_filter - ) { - count - scene_markers { - ...SceneMarkerData - } - } - } - - ${SceneMarkerDataFragmentDoc} -`; -export function useFindSceneMarkers( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery< - FindSceneMarkersQuery, - FindSceneMarkersVariables - >(FindSceneMarkersDocument, baseOptions); -} -export const SceneWallDocument = gql` - query SceneWall($q: String) { - sceneWall(q: $q) { - ...SceneData - } - } - - ${SceneDataFragmentDoc} -`; -export function useSceneWall( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - SceneWallDocument, - baseOptions - ); -} -export const MarkerWallDocument = gql` - query MarkerWall($q: String) { - markerWall(q: $q) { - ...SceneMarkerData - } - } - - ${SceneMarkerDataFragmentDoc} -`; -export function useMarkerWall( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - MarkerWallDocument, - baseOptions - ); -} -export const FindPerformersDocument = gql` - query FindPerformers( - $filter: FindFilterType - $performer_filter: PerformerFilterType - ) { - findPerformers(filter: $filter, performer_filter: $performer_filter) { - count - performers { - ...PerformerData - } - } - } - - ${PerformerDataFragmentDoc} -`; -export function useFindPerformers( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery< - FindPerformersQuery, - FindPerformersVariables - >(FindPerformersDocument, baseOptions); -} -export const FindPerformerDocument = gql` - query FindPerformer($id: ID!) { - findPerformer(id: $id) { - ...PerformerData - } - } - - ${PerformerDataFragmentDoc} -`; -export function useFindPerformer( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindPerformerDocument, - baseOptions - ); -} -export const FindStudiosDocument = gql` - query FindStudios($filter: FindFilterType) { - findStudios(filter: $filter) { - count - studios { - ...StudioData - } - } - } - - ${StudioDataFragmentDoc} -`; -export function useFindStudios( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindStudiosDocument, - baseOptions - ); -} -export const FindStudioDocument = gql` - query FindStudio($id: ID!) { - findStudio(id: $id) { - ...StudioData - } - } - - ${StudioDataFragmentDoc} -`; -export function useFindStudio( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindStudioDocument, - baseOptions - ); -} -export const FindGalleriesDocument = gql` - query FindGalleries($filter: FindFilterType) { - findGalleries(filter: $filter) { - count - galleries { - ...GalleryData - } - } - } - - ${GalleryDataFragmentDoc} -`; -export function useFindGalleries( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindGalleriesDocument, - baseOptions - ); -} -export const FindGalleryDocument = gql` - query FindGallery($id: ID!) { - findGallery(id: $id) { - ...GalleryData - } - } - - ${GalleryDataFragmentDoc} -`; -export function useFindGallery( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindGalleryDocument, - baseOptions - ); -} -export const FindTagDocument = gql` - query FindTag($id: ID!) { - findTag(id: $id) { - ...TagData - } - } - - ${TagDataFragmentDoc} -`; -export function useFindTag( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - FindTagDocument, - baseOptions - ); -} -export const MarkerStringsDocument = gql` - query MarkerStrings($q: String, $sort: String) { - markerStrings(q: $q, sort: $sort) { - id - count - title - } - } -`; -export function useMarkerStrings( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - MarkerStringsDocument, - baseOptions - ); -} -export const ScrapeFreeonesDocument = gql` - query ScrapeFreeones($performer_name: String!) { - scrapeFreeones(performer_name: $performer_name) { - name - url - twitter - instagram - birthdate - ethnicity - country - eye_color - height - measurements - fake_tits - career_length - tattoos - piercings - aliases - } - } -`; -export function useScrapeFreeones( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery< - ScrapeFreeonesQuery, - ScrapeFreeonesVariables - >(ScrapeFreeonesDocument, baseOptions); -} -export const ScrapeFreeonesPerformersDocument = gql` - query ScrapeFreeonesPerformers($q: String!) { - scrapeFreeonesPerformerList(query: $q) - } -`; -export function useScrapeFreeonesPerformers( - baseOptions?: ReactApolloHooks.QueryHookOptions< - ScrapeFreeonesPerformersVariables - > -) { - return ReactApolloHooks.useQuery< - ScrapeFreeonesPerformersQuery, - ScrapeFreeonesPerformersVariables - >(ScrapeFreeonesPerformersDocument, baseOptions); -} -export const AllTagsDocument = gql` - query AllTags { - allTags { - ...TagData - } - } - - ${TagDataFragmentDoc} -`; -export function useAllTags( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - AllTagsDocument, - baseOptions - ); -} -export const AllPerformersForFilterDocument = gql` - query AllPerformersForFilter { - allPerformers { - ...SlimPerformerData - } - } - - ${SlimPerformerDataFragmentDoc} -`; -export function useAllPerformersForFilter( - baseOptions?: ReactApolloHooks.QueryHookOptions< - AllPerformersForFilterVariables - > -) { - return ReactApolloHooks.useQuery< - AllPerformersForFilterQuery, - AllPerformersForFilterVariables - >(AllPerformersForFilterDocument, baseOptions); -} -export const AllStudiosForFilterDocument = gql` - query AllStudiosForFilter { - allStudios { - ...SlimStudioData - } - } - - ${SlimStudioDataFragmentDoc} -`; -export function useAllStudiosForFilter( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery< - AllStudiosForFilterQuery, - AllStudiosForFilterVariables - >(AllStudiosForFilterDocument, baseOptions); -} -export const AllTagsForFilterDocument = gql` - query AllTagsForFilter { - allTags { - id - name - } - } -`; -export function useAllTagsForFilter( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery< - AllTagsForFilterQuery, - AllTagsForFilterVariables - >(AllTagsForFilterDocument, baseOptions); -} -export const ValidGalleriesForSceneDocument = gql` - query ValidGalleriesForScene($scene_id: ID!) { - validGalleriesForScene(scene_id: $scene_id) { - id - path - } - } -`; -export function useValidGalleriesForScene( - baseOptions?: ReactApolloHooks.QueryHookOptions< - ValidGalleriesForSceneVariables - > -) { - return ReactApolloHooks.useQuery< - ValidGalleriesForSceneQuery, - ValidGalleriesForSceneVariables - >(ValidGalleriesForSceneDocument, baseOptions); -} -export const StatsDocument = gql` - query Stats { - stats { - scene_count - gallery_count - performer_count - studio_count - tag_count - } - } -`; -export function useStats( - baseOptions?: ReactApolloHooks.QueryHookOptions -) { - return ReactApolloHooks.useQuery( - StatsDocument, - baseOptions - ); -} -export const SceneUpdateDocument = gql` - mutation SceneUpdate( - $id: ID! - $title: String - $details: String - $url: String - $date: String - $rating: Int - $studio_id: ID - $gallery_id: ID - $performer_ids: [ID!] = [] - $tag_ids: [ID!] = [] - ) { - sceneUpdate( - input: { - id: $id - title: $title - details: $details - url: $url - date: $date - rating: $rating - studio_id: $studio_id - gallery_id: $gallery_id - performer_ids: $performer_ids - tag_ids: $tag_ids - } - ) { - ...SceneData - } - } - - ${SceneDataFragmentDoc} -`; -export function useSceneUpdate( +export function useConfigureGeneral( baseOptions?: ReactApolloHooks.MutationHookOptions< - SceneUpdateMutation, - SceneUpdateVariables + ConfigureGeneralMutation, + ConfigureGeneralVariables > ) { return ReactApolloHooks.useMutation< - SceneUpdateMutation, - SceneUpdateVariables - >(SceneUpdateDocument, baseOptions); + ConfigureGeneralMutation, + ConfigureGeneralVariables + >(ConfigureGeneralDocument, baseOptions); } export const PerformerCreateDocument = gql` mutation PerformerCreate( @@ -1974,6 +1604,136 @@ export function usePerformerUpdate( PerformerUpdateVariables >(PerformerUpdateDocument, baseOptions); } +export const SceneMarkerCreateDocument = gql` + mutation SceneMarkerCreate( + $title: String! + $seconds: Float! + $scene_id: ID! + $primary_tag_id: ID! + $tag_ids: [ID!] = [] + ) { + sceneMarkerCreate( + input: { + title: $title + seconds: $seconds + scene_id: $scene_id + primary_tag_id: $primary_tag_id + tag_ids: $tag_ids + } + ) { + ...SceneMarkerData + } + } + + ${SceneMarkerDataFragmentDoc} +`; +export function useSceneMarkerCreate( + baseOptions?: ReactApolloHooks.MutationHookOptions< + SceneMarkerCreateMutation, + SceneMarkerCreateVariables + > +) { + return ReactApolloHooks.useMutation< + SceneMarkerCreateMutation, + SceneMarkerCreateVariables + >(SceneMarkerCreateDocument, baseOptions); +} +export const SceneMarkerUpdateDocument = gql` + mutation SceneMarkerUpdate( + $id: ID! + $title: String! + $seconds: Float! + $scene_id: ID! + $primary_tag_id: ID! + $tag_ids: [ID!] = [] + ) { + sceneMarkerUpdate( + input: { + id: $id + title: $title + seconds: $seconds + scene_id: $scene_id + primary_tag_id: $primary_tag_id + tag_ids: $tag_ids + } + ) { + ...SceneMarkerData + } + } + + ${SceneMarkerDataFragmentDoc} +`; +export function useSceneMarkerUpdate( + baseOptions?: ReactApolloHooks.MutationHookOptions< + SceneMarkerUpdateMutation, + SceneMarkerUpdateVariables + > +) { + return ReactApolloHooks.useMutation< + SceneMarkerUpdateMutation, + SceneMarkerUpdateVariables + >(SceneMarkerUpdateDocument, baseOptions); +} +export const SceneMarkerDestroyDocument = gql` + mutation SceneMarkerDestroy($id: ID!) { + sceneMarkerDestroy(id: $id) + } +`; +export function useSceneMarkerDestroy( + baseOptions?: ReactApolloHooks.MutationHookOptions< + SceneMarkerDestroyMutation, + SceneMarkerDestroyVariables + > +) { + return ReactApolloHooks.useMutation< + SceneMarkerDestroyMutation, + SceneMarkerDestroyVariables + >(SceneMarkerDestroyDocument, baseOptions); +} +export const SceneUpdateDocument = gql` + mutation SceneUpdate( + $id: ID! + $title: String + $details: String + $url: String + $date: String + $rating: Int + $studio_id: ID + $gallery_id: ID + $performer_ids: [ID!] = [] + $tag_ids: [ID!] = [] + ) { + sceneUpdate( + input: { + id: $id + title: $title + details: $details + url: $url + date: $date + rating: $rating + studio_id: $studio_id + gallery_id: $gallery_id + performer_ids: $performer_ids + tag_ids: $tag_ids + } + ) { + ...SceneData + } + } + + ${SceneDataFragmentDoc} +`; +export function useSceneUpdate( + baseOptions?: ReactApolloHooks.MutationHookOptions< + SceneUpdateMutation, + SceneUpdateVariables + > +) { + return ReactApolloHooks.useMutation< + SceneUpdateMutation, + SceneUpdateVariables + >(SceneUpdateDocument, baseOptions); +} export const StudioCreateDocument = gql` mutation StudioCreate($name: String!, $url: String, $image: String!) { studioCreate(input: { name: $name, url: $url, image: $image }) { @@ -2070,91 +1830,411 @@ export function useTagUpdate( baseOptions ); } -export const SceneMarkerCreateDocument = gql` - mutation SceneMarkerCreate( - $title: String! - $seconds: Float! - $scene_id: ID! - $primary_tag_id: ID! - $tag_ids: [ID!] = [] - ) { - sceneMarkerCreate( - input: { - title: $title - seconds: $seconds - scene_id: $scene_id - primary_tag_id: $primary_tag_id - tag_ids: $tag_ids +export const FindGalleriesDocument = gql` + query FindGalleries($filter: FindFilterType) { + findGalleries(filter: $filter) { + count + galleries { + ...GalleryData } - ) { + } + } + + ${GalleryDataFragmentDoc} +`; +export function useFindGalleries( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindGalleriesDocument, + baseOptions + ); +} +export const FindGalleryDocument = gql` + query FindGallery($id: ID!) { + findGallery(id: $id) { + ...GalleryData + } + } + + ${GalleryDataFragmentDoc} +`; +export function useFindGallery( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindGalleryDocument, + baseOptions + ); +} +export const SceneWallDocument = gql` + query SceneWall($q: String) { + sceneWall(q: $q) { + ...SceneData + } + } + + ${SceneDataFragmentDoc} +`; +export function useSceneWall( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + SceneWallDocument, + baseOptions + ); +} +export const MarkerWallDocument = gql` + query MarkerWall($q: String) { + markerWall(q: $q) { ...SceneMarkerData } } ${SceneMarkerDataFragmentDoc} `; -export function useSceneMarkerCreate( - baseOptions?: ReactApolloHooks.MutationHookOptions< - SceneMarkerCreateMutation, - SceneMarkerCreateVariables +export function useMarkerWall( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + MarkerWallDocument, + baseOptions + ); +} +export const FindTagDocument = gql` + query FindTag($id: ID!) { + findTag(id: $id) { + ...TagData + } + } + + ${TagDataFragmentDoc} +`; +export function useFindTag( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindTagDocument, + baseOptions + ); +} +export const MarkerStringsDocument = gql` + query MarkerStrings($q: String, $sort: String) { + markerStrings(q: $q, sort: $sort) { + id + count + title + } + } +`; +export function useMarkerStrings( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + MarkerStringsDocument, + baseOptions + ); +} +export const AllTagsDocument = gql` + query AllTags { + allTags { + ...TagData + } + } + + ${TagDataFragmentDoc} +`; +export function useAllTags( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + AllTagsDocument, + baseOptions + ); +} +export const AllPerformersForFilterDocument = gql` + query AllPerformersForFilter { + allPerformers { + ...SlimPerformerData + } + } + + ${SlimPerformerDataFragmentDoc} +`; +export function useAllPerformersForFilter( + baseOptions?: ReactApolloHooks.QueryHookOptions< + AllPerformersForFilterVariables > ) { - return ReactApolloHooks.useMutation< - SceneMarkerCreateMutation, - SceneMarkerCreateVariables - >(SceneMarkerCreateDocument, baseOptions); + return ReactApolloHooks.useQuery< + AllPerformersForFilterQuery, + AllPerformersForFilterVariables + >(AllPerformersForFilterDocument, baseOptions); } -export const SceneMarkerUpdateDocument = gql` - mutation SceneMarkerUpdate( - $id: ID! - $title: String! - $seconds: Float! - $scene_id: ID! - $primary_tag_id: ID! - $tag_ids: [ID!] = [] +export const AllStudiosForFilterDocument = gql` + query AllStudiosForFilter { + allStudios { + ...SlimStudioData + } + } + + ${SlimStudioDataFragmentDoc} +`; +export function useAllStudiosForFilter( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery< + AllStudiosForFilterQuery, + AllStudiosForFilterVariables + >(AllStudiosForFilterDocument, baseOptions); +} +export const AllTagsForFilterDocument = gql` + query AllTagsForFilter { + allTags { + id + name + } + } +`; +export function useAllTagsForFilter( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery< + AllTagsForFilterQuery, + AllTagsForFilterVariables + >(AllTagsForFilterDocument, baseOptions); +} +export const ValidGalleriesForSceneDocument = gql` + query ValidGalleriesForScene($scene_id: ID!) { + validGalleriesForScene(scene_id: $scene_id) { + id + path + } + } +`; +export function useValidGalleriesForScene( + baseOptions?: ReactApolloHooks.QueryHookOptions< + ValidGalleriesForSceneVariables + > +) { + return ReactApolloHooks.useQuery< + ValidGalleriesForSceneQuery, + ValidGalleriesForSceneVariables + >(ValidGalleriesForSceneDocument, baseOptions); +} +export const StatsDocument = gql` + query Stats { + stats { + scene_count + gallery_count + performer_count + studio_count + tag_count + } + } +`; +export function useStats( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + StatsDocument, + baseOptions + ); +} +export const FindPerformersDocument = gql` + query FindPerformers( + $filter: FindFilterType + $performer_filter: PerformerFilterType ) { - sceneMarkerUpdate( - input: { - id: $id - title: $title - seconds: $seconds - scene_id: $scene_id - primary_tag_id: $primary_tag_id - tag_ids: $tag_ids + findPerformers(filter: $filter, performer_filter: $performer_filter) { + count + performers { + ...PerformerData } + } + } + + ${PerformerDataFragmentDoc} +`; +export function useFindPerformers( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery< + FindPerformersQuery, + FindPerformersVariables + >(FindPerformersDocument, baseOptions); +} +export const FindPerformerDocument = gql` + query FindPerformer($id: ID!) { + findPerformer(id: $id) { + ...PerformerData + } + } + + ${PerformerDataFragmentDoc} +`; +export function useFindPerformer( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindPerformerDocument, + baseOptions + ); +} +export const FindSceneMarkersDocument = gql` + query FindSceneMarkers( + $filter: FindFilterType + $scene_marker_filter: SceneMarkerFilterType + ) { + findSceneMarkers( + filter: $filter + scene_marker_filter: $scene_marker_filter ) { - ...SceneMarkerData + count + scene_markers { + ...SceneMarkerData + } } } ${SceneMarkerDataFragmentDoc} `; -export function useSceneMarkerUpdate( - baseOptions?: ReactApolloHooks.MutationHookOptions< - SceneMarkerUpdateMutation, - SceneMarkerUpdateVariables - > +export function useFindSceneMarkers( + baseOptions?: ReactApolloHooks.QueryHookOptions ) { - return ReactApolloHooks.useMutation< - SceneMarkerUpdateMutation, - SceneMarkerUpdateVariables - >(SceneMarkerUpdateDocument, baseOptions); + return ReactApolloHooks.useQuery< + FindSceneMarkersQuery, + FindSceneMarkersVariables + >(FindSceneMarkersDocument, baseOptions); } -export const SceneMarkerDestroyDocument = gql` - mutation SceneMarkerDestroy($id: ID!) { - sceneMarkerDestroy(id: $id) +export const FindScenesDocument = gql` + query FindScenes( + $filter: FindFilterType + $scene_filter: SceneFilterType + $scene_ids: [Int!] + ) { + findScenes( + filter: $filter + scene_filter: $scene_filter + scene_ids: $scene_ids + ) { + count + scenes { + ...SlimSceneData + } + } + } + + ${SlimSceneDataFragmentDoc} +`; +export function useFindScenes( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindScenesDocument, + baseOptions + ); +} +export const FindSceneDocument = gql` + query FindScene($id: ID!, $checksum: String) { + findScene(id: $id, checksum: $checksum) { + ...SceneData + } + sceneMarkerTags(scene_id: $id) { + tag { + id + name + } + scene_markers { + ...SceneMarkerData + } + } + } + + ${SceneDataFragmentDoc} + ${SceneMarkerDataFragmentDoc} +`; +export function useFindScene( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindSceneDocument, + baseOptions + ); +} +export const ScrapeFreeonesDocument = gql` + query ScrapeFreeones($performer_name: String!) { + scrapeFreeones(performer_name: $performer_name) { + name + url + twitter + instagram + birthdate + ethnicity + country + eye_color + height + measurements + fake_tits + career_length + tattoos + piercings + aliases + } } `; -export function useSceneMarkerDestroy( - baseOptions?: ReactApolloHooks.MutationHookOptions< - SceneMarkerDestroyMutation, - SceneMarkerDestroyVariables +export function useScrapeFreeones( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery< + ScrapeFreeonesQuery, + ScrapeFreeonesVariables + >(ScrapeFreeonesDocument, baseOptions); +} +export const ScrapeFreeonesPerformersDocument = gql` + query ScrapeFreeonesPerformers($q: String!) { + scrapeFreeonesPerformerList(query: $q) + } +`; +export function useScrapeFreeonesPerformers( + baseOptions?: ReactApolloHooks.QueryHookOptions< + ScrapeFreeonesPerformersVariables > ) { - return ReactApolloHooks.useMutation< - SceneMarkerDestroyMutation, - SceneMarkerDestroyVariables - >(SceneMarkerDestroyDocument, baseOptions); + return ReactApolloHooks.useQuery< + ScrapeFreeonesPerformersQuery, + ScrapeFreeonesPerformersVariables + >(ScrapeFreeonesPerformersDocument, baseOptions); +} +export const ConfigurationDocument = gql` + query Configuration { + configuration { + ...ConfigData + } + } + + ${ConfigDataFragmentDoc} +`; +export function useConfiguration( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + ConfigurationDocument, + baseOptions + ); +} +export const DirectoriesDocument = gql` + query Directories($path: String) { + directories(path: $path) + } +`; +export function useDirectories( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + DirectoriesDocument, + baseOptions + ); } export const MetadataImportDocument = gql` query MetadataImport { @@ -2221,6 +2301,43 @@ export function useMetadataClean( baseOptions ); } +export const FindStudiosDocument = gql` + query FindStudios($filter: FindFilterType) { + findStudios(filter: $filter) { + count + studios { + ...StudioData + } + } + } + + ${StudioDataFragmentDoc} +`; +export function useFindStudios( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindStudiosDocument, + baseOptions + ); +} +export const FindStudioDocument = gql` + query FindStudio($id: ID!) { + findStudio(id: $id) { + ...StudioData + } + } + + ${StudioDataFragmentDoc} +`; +export function useFindStudio( + baseOptions?: ReactApolloHooks.QueryHookOptions +) { + return ReactApolloHooks.useQuery( + FindStudioDocument, + baseOptions + ); +} export const MetadataUpdateDocument = gql` subscription MetadataUpdate { metadataUpdate