mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-04 09:59:16 +02:00
Patch error on Peertube when playlist name contains non letter characters surrounded by space. fix #19
This commit is contained in:
parent
f8d1fb8e33
commit
90d998a64a
1 changed files with 3 additions and 0 deletions
|
@ -193,6 +193,7 @@ def parseNFO(options):
|
||||||
def upcaseFirstLetter(s):
|
def upcaseFirstLetter(s):
|
||||||
return s[0].upper() + s[1:]
|
return s[0].upper() + s[1:]
|
||||||
|
|
||||||
|
|
||||||
def cleanString(toclean):
|
def cleanString(toclean):
|
||||||
toclean = toclean.split(' ')
|
toclean = toclean.split(' ')
|
||||||
cleaned = ''
|
cleaned = ''
|
||||||
|
@ -201,6 +202,8 @@ def cleanString(toclean):
|
||||||
continue
|
continue
|
||||||
strtoclean = unicodedata.normalize('NFKD', unicode (s, 'utf-8')).encode('ASCII', 'ignore')
|
strtoclean = unicodedata.normalize('NFKD', unicode (s, 'utf-8')).encode('ASCII', 'ignore')
|
||||||
strtoclean = ''.join(e for e in strtoclean if e.isalnum())
|
strtoclean = ''.join(e for e in strtoclean if e.isalnum())
|
||||||
|
if strtoclean == '':
|
||||||
|
continue
|
||||||
strtoclean = upcaseFirstLetter(strtoclean)
|
strtoclean = upcaseFirstLetter(strtoclean)
|
||||||
cleaned = cleaned + strtoclean
|
cleaned = cleaned + strtoclean
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue