Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def release_group(show, name):
if name:
name = helpers.remove_non_release_groups(remove_extension(name))
else:
return ''
try:
parse_result = NameParser(name, showObj=show, naming_pattern=True).parse(name)
except (InvalidNameException, InvalidShowException) as e:
logger.log(u'Unable to get parse release_group: {}'.format(e), logger.DEBUG)
return ''
if not parse_result.release_group:
return ''
return parse_result.release_group.strip('.- []{}')
def release_name(name):
if name:
name = helpers.remove_non_release_groups(remove_extension(name))
return name