mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add Sort Name to Tags (#5531)
* override "name" sort with COALESCE * tag sort_name frontend adds `data-sort-name` attribute to tag links prioritizes sort_name value but will default to tag name if not present in the same way that COALESCE will prioritize the same values in the same way * add sort_name filter, update locale per request * Include sort name in anonymiser * Add import/export support --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -816,6 +816,7 @@ func (db *Anonymiser) anonymiseTags(ctx context.Context) error {
|
||||
query := dialect.From(table).Select(
|
||||
table.Col(idColumn),
|
||||
table.Col("name"),
|
||||
table.Col("sort_name"),
|
||||
table.Col("description"),
|
||||
).Where(table.Col(idColumn).Gt(lastID)).Limit(1000)
|
||||
|
||||
@@ -826,12 +827,14 @@ func (db *Anonymiser) anonymiseTags(ctx context.Context) error {
|
||||
var (
|
||||
id int
|
||||
name sql.NullString
|
||||
sortName sql.NullString
|
||||
description sql.NullString
|
||||
)
|
||||
|
||||
if err := rows.Scan(
|
||||
&id,
|
||||
&name,
|
||||
&sortName,
|
||||
&description,
|
||||
); err != nil {
|
||||
return err
|
||||
@@ -839,6 +842,7 @@ func (db *Anonymiser) anonymiseTags(ctx context.Context) error {
|
||||
|
||||
set := goqu.Record{}
|
||||
db.obfuscateNullString(set, "name", name)
|
||||
db.obfuscateNullString(set, "sort_name", sortName)
|
||||
db.obfuscateNullString(set, "description", description)
|
||||
|
||||
if len(set) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user