mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Various bug fixes (#2935)
* Sort scene/image/gallery tags by name * Calculate md5 if missing * Prevent multiple folder create logs
This commit is contained in:
@@ -78,7 +78,7 @@ func Test_imageQueryBuilder_Create(t *testing.T) {
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
GalleryIDs: models.NewRelatedIDs([]int{galleryIDs[galleryIdxWithImage]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithImage], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithImage]}),
|
||||
PerformerIDs: models.NewRelatedIDs([]int{performerIDs[performerIdx1WithImage], performerIDs[performerIdx1WithDupName]}),
|
||||
},
|
||||
false,
|
||||
@@ -99,7 +99,7 @@ func Test_imageQueryBuilder_Create(t *testing.T) {
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
GalleryIDs: models.NewRelatedIDs([]int{galleryIDs[galleryIdxWithImage]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithImage], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithImage]}),
|
||||
PerformerIDs: models.NewRelatedIDs([]int{performerIDs[performerIdx1WithImage], performerIDs[performerIdx1WithDupName]}),
|
||||
},
|
||||
false,
|
||||
@@ -231,7 +231,7 @@ func Test_imageQueryBuilder_Update(t *testing.T) {
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
GalleryIDs: models.NewRelatedIDs([]int{galleryIDs[galleryIdxWithImage]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithImage], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithImage]}),
|
||||
PerformerIDs: models.NewRelatedIDs([]int{performerIDs[performerIdx1WithImage], performerIDs[performerIdx1WithDupName]}),
|
||||
},
|
||||
false,
|
||||
@@ -432,7 +432,7 @@ func Test_imageQueryBuilder_UpdatePartial(t *testing.T) {
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
GalleryIDs: models.NewRelatedIDs([]int{galleryIDs[galleryIdxWithImage]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithImage], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithImage]}),
|
||||
PerformerIDs: models.NewRelatedIDs([]int{performerIDs[performerIdx1WithImage], performerIDs[performerIdx1WithDupName]}),
|
||||
},
|
||||
false,
|
||||
@@ -537,9 +537,12 @@ func Test_imageQueryBuilder_UpdatePartialRelationships(t *testing.T) {
|
||||
},
|
||||
},
|
||||
models.Image{
|
||||
TagIDs: models.NewRelatedIDs(append(indexesToIDs(tagIDs, imageTags[imageIdxWithTwoTags]),
|
||||
tagIDs[tagIdx1WithDupName],
|
||||
tagIDs[tagIdx1WithGallery],
|
||||
TagIDs: models.NewRelatedIDs(append(
|
||||
[]int{
|
||||
tagIDs[tagIdx1WithGallery],
|
||||
tagIDs[tagIdx1WithDupName],
|
||||
},
|
||||
indexesToIDs(tagIDs, imageTags[imageIdxWithTwoTags])...,
|
||||
)),
|
||||
},
|
||||
false,
|
||||
@@ -587,8 +590,9 @@ func Test_imageQueryBuilder_UpdatePartialRelationships(t *testing.T) {
|
||||
},
|
||||
},
|
||||
models.Image{
|
||||
TagIDs: models.NewRelatedIDs(append(indexesToIDs(tagIDs, imageTags[imageIdxWithTwoTags]),
|
||||
tagIDs[tagIdx1WithGallery],
|
||||
TagIDs: models.NewRelatedIDs(append(
|
||||
[]int{tagIDs[tagIdx1WithGallery]},
|
||||
indexesToIDs(tagIDs, imageTags[imageIdxWithTwoTags])...,
|
||||
)),
|
||||
},
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user