def validate_single_media(context, param, values):
'''Parse the passed medias when they are "single", such as movies.'''
medias = []
for value in values:
query = value.strip()
try:
media = context.obj['MEDIA_CLASS'](query)
except Media.MediaNotFoundException:
raise click.BadParameter('the media {} was not found'.format(
query
))
except pytvdbapi.error.ConnectionError:
logger.error('You\'re not connected to any network.')
os._exit(1)
medias.append(('single', media))
return medias
评论列表
文章目录