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

Edit Modal extra fields if only one scene #4150

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions graphql/documents/queries/misc.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ query MarkerStrings($q: String, $sort: String) {
}
}

query AllGalleriesForFilter {
allGalleries {
id
title
}
}

query AllPerformersForFilter {
allPerformers {
id
name
disambiguation
alias_list
}
}

query AllStudiosForFilter {
allStudios {
id
Expand Down
3 changes: 3 additions & 0 deletions graphql/schema/types/scene.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ input BulkSceneUpdateInput {
performer_ids: BulkUpdateIds
tag_ids: BulkUpdateIds
movie_ids: BulkUpdateIds
"This should be a URL or a base64 encoded data URL"
cover_image: String
stash_ids: [StashIDInput!]
}

input SceneDestroyInput {
Expand Down
13 changes: 13 additions & 0 deletions internal/api/resolver_mutation_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ func (r *mutationResolver) BulkSceneUpdate(ctx context.Context, input BulkSceneU
return nil, fmt.Errorf("converting movie ids: %w", err)
}

var coverImageData []byte
if input.CoverImage != nil {
var err error
coverImageData, err = utils.ProcessImageInput(ctx, *input.CoverImage)
if err != nil {
return nil, err
}
}

ret := []*models.Scene{}

// Start the transaction and save the scenes
Expand All @@ -365,6 +374,10 @@ func (r *mutationResolver) BulkSceneUpdate(ctx context.Context, input BulkSceneU
return err
}

if err := r.sceneUpdateCoverImage(ctx, scene, coverImageData); err != nil {
return err
}

ret = append(ret, scene)
}

Expand Down
Loading