mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 08:53:37 +00:00
Only process if there is a name present
This commit is contained in:
parent
b33e2be047
commit
21b7aa2785
1 changed files with 16 additions and 14 deletions
|
@ -658,24 +658,26 @@ def sanitizeSceneName(name, ezrss=False):
|
||||||
Returns: A string containing the scene version of the show name given.
|
Returns: A string containing the scene version of the show name given.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not ezrss:
|
if name:
|
||||||
bad_chars = u",:()'!?\u2019"
|
|
||||||
# ezrss leaves : and ! in their show names as far as I can tell
|
|
||||||
else:
|
|
||||||
bad_chars = u",()'?\u2019"
|
|
||||||
|
|
||||||
# strip out any bad chars
|
if not ezrss:
|
||||||
for x in bad_chars:
|
bad_chars = u",:()'!?\u2019"
|
||||||
name = name.replace(x, "")
|
# ezrss leaves : and ! in their show names as far as I can tell
|
||||||
|
else:
|
||||||
|
bad_chars = u",()'?\u2019"
|
||||||
|
|
||||||
# tidy up stuff that doesn't belong in scene names
|
# strip out any bad chars
|
||||||
name = name.replace("- ", ".").replace(" ", ".").replace("&", "and").replace('/', '.')
|
for x in bad_chars:
|
||||||
name = re.sub("\.\.*", ".", name)
|
name = name.replace(x, "")
|
||||||
|
|
||||||
if name.endswith('.'):
|
# tidy up stuff that doesn't belong in scene names
|
||||||
name = name[:-1]
|
name = name.replace("- ", ".").replace(" ", ".").replace("&", "and").replace('/', '.')
|
||||||
|
name = re.sub("\.\.*", ".", name)
|
||||||
|
|
||||||
return name
|
if name.endswith('.'):
|
||||||
|
name = name[:-1]
|
||||||
|
|
||||||
|
return name
|
||||||
|
|
||||||
|
|
||||||
def create_https_certificates(ssl_cert, ssl_key):
|
def create_https_certificates(ssl_cert, ssl_key):
|
||||||
|
|
Loading…
Reference in a new issue