mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix update duplicate ids (#2965)
This commit is contained in:
@@ -739,6 +739,22 @@ func Test_sceneQueryBuilder_UpdatePartialRelationships(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"add identical galleries",
|
||||
sceneIDs[sceneIdxWithGallery],
|
||||
models.ScenePartial{
|
||||
GalleryIDs: &models.UpdateIDs{
|
||||
IDs: []int{galleryIDs[galleryIdx1WithImage], galleryIDs[galleryIdx1WithImage]},
|
||||
Mode: models.RelationshipUpdateModeAdd,
|
||||
},
|
||||
},
|
||||
models.Scene{
|
||||
GalleryIDs: models.NewRelatedIDs(append(indexesToIDs(galleryIDs, sceneGalleries[sceneIdxWithGallery]),
|
||||
galleryIDs[galleryIdx1WithImage],
|
||||
)),
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"add tags",
|
||||
sceneIDs[sceneIdxWithTwoTags],
|
||||
@@ -759,6 +775,25 @@ func Test_sceneQueryBuilder_UpdatePartialRelationships(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"add identical tags",
|
||||
sceneIDs[sceneIdxWithTwoTags],
|
||||
models.ScenePartial{
|
||||
TagIDs: &models.UpdateIDs{
|
||||
IDs: []int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithDupName]},
|
||||
Mode: models.RelationshipUpdateModeAdd,
|
||||
},
|
||||
},
|
||||
models.Scene{
|
||||
TagIDs: models.NewRelatedIDs(append(
|
||||
[]int{
|
||||
tagIDs[tagIdx1WithDupName],
|
||||
},
|
||||
indexesToIDs(tagIDs, sceneTags[sceneIdxWithTwoTags])...,
|
||||
)),
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"add performers",
|
||||
sceneIDs[sceneIdxWithTwoPerformers],
|
||||
@@ -776,6 +811,22 @@ func Test_sceneQueryBuilder_UpdatePartialRelationships(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"add identical performers",
|
||||
sceneIDs[sceneIdxWithTwoPerformers],
|
||||
models.ScenePartial{
|
||||
PerformerIDs: &models.UpdateIDs{
|
||||
IDs: []int{performerIDs[performerIdx1WithDupName], performerIDs[performerIdx1WithDupName]},
|
||||
Mode: models.RelationshipUpdateModeAdd,
|
||||
},
|
||||
},
|
||||
models.Scene{
|
||||
PerformerIDs: models.NewRelatedIDs(append(indexesToIDs(performerIDs, scenePerformers[sceneIdxWithTwoPerformers]),
|
||||
performerIDs[performerIdx1WithDupName],
|
||||
)),
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"add movies",
|
||||
sceneIDs[sceneIdxWithMovie],
|
||||
|
||||
Reference in New Issue
Block a user