From a18b16baac20308ee965ff5e3262e50771c2dd7a Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Tue, 16 Oct 2018 11:45:55 -0700 Subject: [PATCH] Truncate overlong titles instead of hashing, which behaved inconsistently --- src/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils.py b/src/utils.py index e3e7e4a..9d2ea2c 100644 --- a/src/utils.py +++ b/src/utils.py @@ -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):