Truncate overlong titles instead of hashing, which behaved inconsistently

This commit is contained in:
Tim Van Baak 2018-10-16 11:45:55 -07:00
parent 590bf958de
commit a18b16baac
1 changed files with 1 additions and 2 deletions

View File

@ -19,8 +19,7 @@ def titleescape(s):
s = re.sub(r"\s+", '_', s) # Replace whitespace with _
s = parse.quote(s) # Encode all other characters
s = re.sub(r"%", "", s) # Strip encoding %s
if len(s) > 64: # If the result is unreasonably long,
s = hex(abs(hash(s)))[2:] # Replace it with a hex hash
s = s[:64] # Limit to 64 characters
return s
def titlesort(s):