mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +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",
|
fkColumn: "tag_id",
|
||||||
foreignTable: tagTable,
|
foreignTable: tagTable,
|
||||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
orderBy: tagTableSortSQL,
|
||||||
},
|
},
|
||||||
images: joinRepository{
|
images: joinRepository{
|
||||||
repository: repository{
|
repository: repository{
|
||||||
|
|
|
||||||
|
|
@ -481,7 +481,7 @@ func Test_galleryQueryBuilder_UpdatePartial(t *testing.T) {
|
||||||
CreatedAt: createdAt,
|
CreatedAt: createdAt,
|
||||||
UpdatedAt: updatedAt,
|
UpdatedAt: updatedAt,
|
||||||
SceneIDs: models.NewRelatedIDs([]int{sceneIDs[sceneIdxWithGallery]}),
|
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]}),
|
PerformerIDs: models.NewRelatedIDs([]int{performerIDs[performerIdx1WithGallery], performerIDs[performerIdx1WithDupName]}),
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ var (
|
||||||
},
|
},
|
||||||
fkColumn: tagIDColumn,
|
fkColumn: tagIDColumn,
|
||||||
foreignTable: tagTable,
|
foreignTable: tagTable,
|
||||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
orderBy: tagTableSortSQL,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ var (
|
||||||
},
|
},
|
||||||
fkColumn: tagIDColumn,
|
fkColumn: tagIDColumn,
|
||||||
foreignTable: tagTable,
|
foreignTable: tagTable,
|
||||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
orderBy: tagTableSortSQL,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ var (
|
||||||
},
|
},
|
||||||
fkColumn: tagIDColumn,
|
fkColumn: tagIDColumn,
|
||||||
foreignTable: tagTable,
|
foreignTable: tagTable,
|
||||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
orderBy: tagTableSortSQL,
|
||||||
},
|
},
|
||||||
stashIDs: stashIDRepository{
|
stashIDs: stashIDRepository{
|
||||||
repository{
|
repository{
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,7 @@ func Test_PerformerStore_Update(t *testing.T) {
|
||||||
Weight: &weight,
|
Weight: &weight,
|
||||||
IgnoreAutoTag: ignoreAutoTag,
|
IgnoreAutoTag: ignoreAutoTag,
|
||||||
Aliases: models.NewRelatedStrings(aliases),
|
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{
|
StashIDs: models.NewRelatedStashIDs([]models.StashID{
|
||||||
{
|
{
|
||||||
StashID: stashID1,
|
StashID: stashID1,
|
||||||
|
|
@ -516,7 +516,7 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
|
||||||
Weight: models.NewOptionalInt(weight),
|
Weight: models.NewOptionalInt(weight),
|
||||||
IgnoreAutoTag: models.NewOptionalBool(ignoreAutoTag),
|
IgnoreAutoTag: models.NewOptionalBool(ignoreAutoTag),
|
||||||
TagIDs: &models.UpdateIDs{
|
TagIDs: &models.UpdateIDs{
|
||||||
IDs: []int{tagIDs[tagIdx1WithPerformer], tagIDs[tagIdx1WithDupName]},
|
IDs: []int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithPerformer]},
|
||||||
Mode: models.RelationshipUpdateModeSet,
|
Mode: models.RelationshipUpdateModeSet,
|
||||||
},
|
},
|
||||||
StashIDs: &models.UpdateStashIDs{
|
StashIDs: &models.UpdateStashIDs{
|
||||||
|
|
@ -563,7 +563,7 @@ func Test_PerformerStore_UpdatePartial(t *testing.T) {
|
||||||
HairColor: hairColor,
|
HairColor: hairColor,
|
||||||
Weight: &weight,
|
Weight: &weight,
|
||||||
IgnoreAutoTag: ignoreAutoTag,
|
IgnoreAutoTag: ignoreAutoTag,
|
||||||
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithPerformer], tagIDs[tagIdx1WithDupName]}),
|
TagIDs: models.NewRelatedIDs([]int{tagIDs[tagIdx1WithDupName], tagIDs[tagIdx1WithPerformer]}),
|
||||||
StashIDs: models.NewRelatedStashIDs([]models.StashID{
|
StashIDs: models.NewRelatedStashIDs([]models.StashID{
|
||||||
{
|
{
|
||||||
StashID: stashID1,
|
StashID: stashID1,
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ var (
|
||||||
},
|
},
|
||||||
fkColumn: tagIDColumn,
|
fkColumn: tagIDColumn,
|
||||||
foreignTable: tagTable,
|
foreignTable: tagTable,
|
||||||
orderBy: "COALESCE(tags.sort_name, tags.name) ASC",
|
orderBy: tagTableSortSQL,
|
||||||
},
|
},
|
||||||
performers: joinRepository{
|
performers: joinRepository{
|
||||||
repository: repository{
|
repository: repository{
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ var (
|
||||||
},
|
},
|
||||||
fkColumn: tagIDColumn,
|
fkColumn: tagIDColumn,
|
||||||
foreignTable: tagTable,
|
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()
|
// 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()
|
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{
|
tagsAliasesTableMgr = &stringTable{
|
||||||
table: table{
|
table: table{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue