forked from 0x2620/pandora
use unicodedata.normalize for sort_title
This commit is contained in:
parent
dcd8731b75
commit
67a31d1f58
1 changed files with 5 additions and 1 deletions
|
@ -7,6 +7,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import unicodedata
|
||||||
|
|
||||||
import ox
|
import ox
|
||||||
import ox.iso
|
import ox.iso
|
||||||
|
@ -164,7 +165,10 @@ def parse_path(path):
|
||||||
def sort_title(title):
|
def sort_title(title):
|
||||||
#title
|
#title
|
||||||
title = re.sub(u'[\'!¿¡,\.;\-"\:\*\[\]]', '', title)
|
title = re.sub(u'[\'!¿¡,\.;\-"\:\*\[\]]', '', title)
|
||||||
title = title.replace(u'Æ', 'Ae')
|
|
||||||
|
#title = title.replace(u'Æ', 'Ae')
|
||||||
|
title = unicodedata.normalize('NFKD',title)
|
||||||
|
|
||||||
#pad numbered titles
|
#pad numbered titles
|
||||||
title = re.sub('(\d+)', lambda x: '%010d' % int(x.group(0)), title)
|
title = re.sub('(\d+)', lambda x: '%010d' % int(x.group(0)), title)
|
||||||
return title.strip()
|
return title.strip()
|
||||||
|
|
Loading…
Reference in a new issue