Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit fields director and (studio) code to scene drafts #544

Merged
2 commits merged into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/src/graphql/mutations/AddScene.gql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ mutation AddScene($sceneData: SceneCreateInput!) {
id
release_date
title
code
details
director
urls {
url
site {
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/graphql/queries/Draft.gql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ query Draft($id: ID!) {
... on SceneDraft {
id
title
code
details
director
date
url {
...URLFragment
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1291,8 +1291,10 @@ export type SceneDestroyInput = {

export type SceneDraft = {
__typename: "SceneDraft";
code?: Maybe<Scalars["String"]>;
date?: Maybe<Scalars["String"]>;
details?: Maybe<Scalars["String"]>;
director?: Maybe<Scalars["String"]>;
fingerprints: Array<DraftFingerprint>;
id?: Maybe<Scalars["ID"]>;
image?: Maybe<Image>;
Expand All @@ -1304,8 +1306,10 @@ export type SceneDraft = {
};

export type SceneDraftInput = {
code?: InputMaybe<Scalars["String"]>;
date?: InputMaybe<Scalars["String"]>;
details?: InputMaybe<Scalars["String"]>;
director?: InputMaybe<Scalars["String"]>;
fingerprints: Array<FingerprintInput>;
id?: InputMaybe<Scalars["ID"]>;
image?: InputMaybe<Scalars["Upload"]>;
Expand Down Expand Up @@ -3044,7 +3048,9 @@ export type AddSceneMutation = {
id: string;
release_date?: string | null;
title?: string | null;
code?: string | null;
details?: string | null;
director?: string | null;
urls: Array<{
__typename: "URL";
url: string;
Expand Down Expand Up @@ -13859,7 +13865,9 @@ export type DraftQuery = {
__typename: "SceneDraft";
id?: string | null;
title?: string | null;
code?: string | null;
details?: string | null;
director?: string | null;
date?: string | null;
url?: {
__typename: "URL";
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/drafts/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export const parseSceneDraft = (
details: draft.details,
urls: joinURLs(draft.url, existingScene?.urls),
studio: draft.studio?.__typename === "Studio" ? draft.studio : null,
director: null,
code: null,
director: draft.director,
code: draft.code,
duration: draft.fingerprints?.[0]?.duration ?? null,
images: draft.image ? [draft.image] : existingScene?.images,
tags: joinTags(
Expand Down
4 changes: 4 additions & 0 deletions graphql/schema/types/scene.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ union SceneDraftTag = Tag | DraftEntity
type SceneDraft {
id: ID
title: String
code: String
details: String
director: String
url: URL
date: String
studio: SceneDraftStudio
Expand All @@ -236,7 +238,9 @@ type SceneDraft {
input SceneDraftInput {
id: ID
title: String
code: String
details: String
director: String
url: String
date: String
studio: DraftEntityInput
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
"github.com/stashapp/stash-box/pkg/user"
)

//nolint
// nolint
//
//go:embed frontend/build
var ui embed.FS

Expand Down
2 changes: 2 additions & 0 deletions pkg/api/resolver_mutation_draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ func (r *mutationResolver) SubmitSceneDraft(ctx context.Context, input models.Sc
data := models.SceneDraft{
ID: input.ID,
Title: input.Title,
Code: input.Code,
Details: input.Details,
Director: input.Director,
URL: input.URL,
Date: input.Date,
Studio: translateDraftEntity(input.Studio),
Expand Down
128 changes: 127 additions & 1 deletion pkg/models/generated_exec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/models/generated_models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/models/model_draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ func (DraftEntity) IsSceneDraftStudio() {}
type SceneDraft struct {
ID *uuid.UUID `json:"id,omitempty"`
Title *string `json:"title,omitempty"`
Code *string `json:"code,omitempty"`
Details *string `json:"details,omitempty"`
Director *string `json:"director,omitempty"`
URL *string `json:"url,omitempty"`
Date *string `json:"date,omitempty"`
Studio *DraftEntity `json:"studio,omitempty"`
Expand Down