forked from 0x2620/pandora
use path to populate unknown sort names, #958
This commit is contained in:
parent
fdb358ea89
commit
7b22bba4e7
2 changed files with 7 additions and 2 deletions
|
|
@ -15,11 +15,13 @@ import item.models
|
|||
import managers
|
||||
import tasks
|
||||
|
||||
def get_name_sort(name):
|
||||
def get_name_sort(name, sortname=None):
|
||||
name = unicodedata.normalize('NFKD', name).strip()
|
||||
if name:
|
||||
person, created = Person.objects.get_or_create(name=name)
|
||||
if created:
|
||||
if sortname:
|
||||
person.sortname = sortname
|
||||
person.save()
|
||||
sortname = unicodedata.normalize('NFKD', person.sortname)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue