From 90d998a64ac9fe02e4b9aa2e1a423f26d6b66865 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Sat, 20 Oct 2018 20:51:43 +0200 Subject: [PATCH] Patch error on Peertube when playlist name contains non letter characters surrounded by space. fix #19 --- lib/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils.py b/lib/utils.py index 4234116..772ff6b 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -193,6 +193,7 @@ def parseNFO(options): def upcaseFirstLetter(s): return s[0].upper() + s[1:] + def cleanString(toclean): toclean = toclean.split(' ') cleaned = '' @@ -201,6 +202,8 @@ def cleanString(toclean): continue strtoclean = unicodedata.normalize('NFKD', unicode (s, 'utf-8')).encode('ASCII', 'ignore') strtoclean = ''.join(e for e in strtoclean if e.isalnum()) + if strtoclean == '': + continue strtoclean = upcaseFirstLetter(strtoclean) cleaned = cleaned + strtoclean