Performer disambiguation and aliases (#3113)

* Refactor performer relationships
* Remove checksum from performer
* Add disambiguation, overhaul aliases
* Add disambiguation filter criterion
* Improve name matching during import
* Add disambiguation filtering in UI
* Include aliases in performer select
This commit is contained in:
WithoutPants
2022-12-01 13:54:08 +11:00
committed by GitHub
parent d2395e579c
commit 4daf0a14a2
72 changed files with 2283 additions and 993 deletions

View File

@@ -30,6 +30,7 @@ var separatorRE = regexp.MustCompile(separatorPattern)
type PerformerAutoTagQueryer interface {
Query(ctx context.Context, performerFilter *models.PerformerFilterType, findFilter *models.FindFilterType) ([]*models.Performer, int, error)
QueryForAutoTag(ctx context.Context, words []string) ([]*models.Performer, error)
models.AliasLoader
}
type StudioAutoTagQueryer interface {
@@ -168,8 +169,27 @@ func PathToPerformers(ctx context.Context, path string, reader PerformerAutoTagQ
var ret []*models.Performer
for _, p := range performers {
// TODO - commenting out alias handling until both sides work correctly
if nameMatchesPath(p.Name, path) != -1 { // || nameMatchesPath(p.Aliases.String, path) {
matches := false
if nameMatchesPath(p.Name, path) != -1 {
matches = true
}
// TODO - disabled alias matching until we can get finer
// control over the matching
// if !matches {
// if err := p.LoadAliases(ctx, reader); err != nil {
// return nil, err
// }
// for _, alias := range p.Aliases.List() {
// if nameMatchesPath(alias, path) != -1 {
// matches = true
// break
// }
// }
// }
if matches {
ret = append(ret, p)
}
}