mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Fix tag order on details pages (#6143)
* Fix related tag order * Fix unit tests
This commit is contained in:
parent
0c5285c949
commit
ce4b86daf5
9 changed files with 12 additions and 11 deletions
|
|
@ -155,7 +155,7 @@ var (
|
|||
},
|
||||
fkColumn: "tag_id",
|
||||
foreignTable: tagTable,
|
||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
||||
orderBy: tagTableSortSQL,
|
||||
},
|
||||
images: joinRepository{
|
||||
repository: repository{
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ func Test_galleryQueryBuilder_UpdatePartial(t *testing.T) {
|
|||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
SceneIDs: models.NewRelatedIDs([]int{sceneIDs[sceneIdxWithGallery]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithGallery], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithGallery]}),
|
||||
PerformerIDs: models.NewRelatedIDs([]int{performerIDs[performerIdx1WithGallery], performerIDs[performerIdx1WithDupName]}),
|
||||
},
|
||||
false,
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ var (
|
|||
},
|
||||
fkColumn: tagIDColumn,
|
||||
foreignTable: tagTable,
|
||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
||||
orderBy: tagTableSortSQL,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ var (
|
|||
},
|
||||
fkColumn: tagIDColumn,
|
||||
foreignTable: tagTable,
|
||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
||||
orderBy: tagTableSortSQL,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ var (
|
|||
},
|
||||
fkColumn: tagIDColumn,
|
||||
foreignTable: tagTable,
|
||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
||||
orderBy: tagTableSortSQL,
|
||||
},
|
||||
stashIDs: stashIDRepository{
|
||||
repository{
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ func Test_PerformerStore_Update(t *testing.T) {
|
|||
Weight: &weight,
|
||||
IgnoreAutoTag: ignoreAutoTag,
|
||||
Aliases: models.NewRelatedStrings(aliases),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithPerformer], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithPerformer]}),
|
||||
StashIDs: models.NewRelatedStashIDs([]models.StashID{
|
||||
{
|
||||
StashID: stashID1,
|
||||
|
|
@ -516,7 +516,7 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
|
|||
Weight: models.NewOptionalInt(weight),
|
||||
IgnoreAutoTag: models.NewOptionalBool(ignoreAutoTag),
|
||||
TagIDs: &models.UpdateIDs{
|
||||
IDs: []int{tagIDs[tagIdx1WithPerformer], tagIDs[tagIdx1WithDupName]},
|
||||
IDs: []int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithPerformer]},
|
||||
Mode: models.RelationshipUpdateModeSet,
|
||||
},
|
||||
StashIDs: &models.UpdateStashIDs{
|
||||
|
|
@ -563,7 +563,7 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
|
|||
HairColor: hairColor,
|
||||
Weight: &weight,
|
||||
IgnoreAutoTag: ignoreAutoTag,
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithPerformer], tagIDs[tagIdx1WithDupName]}),
|
||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithPerformer]}),
|
||||
StashIDs: models.NewRelatedStashIDs([]models.StashID{
|
||||
{
|
||||
StashID: stashID1,
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ var (
|
|||
},
|
||||
fkColumn: tagIDColumn,
|
||||
foreignTable: tagTable,
|
||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
||||
orderBy: tagTableSortSQL,
|
||||
},
|
||||
performers: joinRepository{
|
||||
repository: repository{
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ var (
|
|||
},
|
||||
fkColumn: tagIDColumn,
|
||||
foreignTable: tagTable,
|
||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
||||
orderBy: tagTableSortSQL,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -333,6 +333,7 @@ var (
|
|||
|
||||
// formerly: goqu.COALESCE(tagTableMgr.table.Col("sort_name"), tagTableMgr.table.Col("name")).Asc()
|
||||
tagTableSort = goqu.L("COALESCE(tags.sort_name, tags.name) COLLATE NATURAL_CI").Asc()
|
||||
tagTableSortSQL = "COALESCE(tags.sort_name, tags.name) COLLATE NATURAL_CI ASC"
|
||||
|
||||
tagsAliasesTableMgr = &stringTable{
|
||||
table: table{
|
||||
|
|
|
|||
Loading…
Reference in a new issue