mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Support file-less scenes. Add scene split, merge and reassign file (#3006)
* Reassign scene file functionality * Implement scene create * Add scene create UI * Add sceneMerge backend support * Add merge scene to UI * Populate split create with scene details * Add merge button to duplicate checker * Handle file-less scenes in marker preview generate * Make unique file name for file-less scene exports * Add o-counter to scene update input * Hide rescan for file-less scenes * Generate heatmap if no speed set on file * Fix count in scene/image queries
This commit is contained in:
@@ -507,6 +507,63 @@ export const mutateSceneSetPrimaryFile = (id: string, fileID: string) =>
|
||||
update: deleteCache(sceneMutationImpactedQueries),
|
||||
});
|
||||
|
||||
export const mutateSceneAssignFile = (sceneID: string, fileID: string) =>
|
||||
client.mutate<GQL.SceneAssignFileMutation>({
|
||||
mutation: GQL.SceneAssignFileDocument,
|
||||
variables: {
|
||||
input: {
|
||||
scene_id: sceneID,
|
||||
file_id: fileID,
|
||||
},
|
||||
},
|
||||
update: deleteCache([
|
||||
...sceneMutationImpactedQueries,
|
||||
GQL.FindSceneDocument,
|
||||
]),
|
||||
refetchQueries: getQueryNames([GQL.FindSceneDocument]),
|
||||
});
|
||||
|
||||
export const mutateSceneMerge = (
|
||||
destination: string,
|
||||
source: string[],
|
||||
values: GQL.SceneUpdateInput
|
||||
) =>
|
||||
client.mutate<GQL.SceneMergeMutation>({
|
||||
mutation: GQL.SceneMergeDocument,
|
||||
variables: {
|
||||
input: {
|
||||
source,
|
||||
destination,
|
||||
values,
|
||||
},
|
||||
},
|
||||
update: (cache) => {
|
||||
// evict the merged scenes from the cache so that they are reloaded
|
||||
cache.evict({
|
||||
id: cache.identify({ __typename: "Scene", id: destination }),
|
||||
});
|
||||
source.forEach((id) =>
|
||||
cache.evict({ id: cache.identify({ __typename: "Scene", id }) })
|
||||
);
|
||||
cache.gc();
|
||||
|
||||
deleteCache([...sceneMutationImpactedQueries, GQL.FindSceneDocument])(
|
||||
cache
|
||||
);
|
||||
},
|
||||
refetchQueries: getQueryNames([GQL.FindSceneDocument]),
|
||||
});
|
||||
|
||||
export const mutateCreateScene = (input: GQL.SceneCreateInput) =>
|
||||
client.mutate<GQL.SceneCreateMutation>({
|
||||
mutation: GQL.SceneCreateDocument,
|
||||
variables: {
|
||||
input,
|
||||
},
|
||||
update: deleteCache(sceneMutationImpactedQueries),
|
||||
refetchQueries: getQueryNames([GQL.FindSceneDocument]),
|
||||
});
|
||||
|
||||
const imageMutationImpactedQueries = [
|
||||
GQL.FindPerformerDocument,
|
||||
GQL.FindPerformersDocument,
|
||||
|
||||
Reference in New Issue
Block a user