def subtitles_enabled(video):
 try:
  parse_result = NameParser().parse(video, cache_result=True)
 except (InvalidNameException, InvalidShowException):
  logger.log(u'Not enough information to parse filename into a valid show. Consider add scene exceptions or improve naming for: {0}'.format(video), logger.WARNING)
  return False
 if parse_result.show.indexerid:
  main_db_con = db.DBConnection()
  sql_results = main_db_con.select('SELECT subtitles FROM tv_shows WHERE indexer_id = ? LIMIT 1', [parse_result.show.indexerid])
  return (bool(sql_results[0]['subtitles']) if sql_results else False)
 else:
  logger.log(u'Empty indexer ID for: {0}'.format(video), logger.WARNING)
  return False

def subtitles_enabled ( video ) : try : parse_result = NameParser ( ) . parse ( video , cache_result = True ) except ( InvalidNameException , InvalidShowException ) : logger . log ( u'Not enough information to parse filename into a valid show. Consider add scene exceptions or improve naming for: {0}' . format ( video ) , logger . WARNING ) return False if parse_result . show . indexerid : main_db_con = db . DBConnection ( ) sql_results = main_db_con . select ( 'SELECT subtitles FROM tv_shows WHERE indexer_id = ? LIMIT 1' , [ parse_result . show . indexerid ] ) return ( bool ( sql_results [ 0 ] [ 'subtitles' ] ) if sql_results else False ) else : logger . log ( u'Empty indexer ID for: {0}' . format ( video ) , logger . WARNING ) return False
parse video filename to a show to check if it has subtitle enabled .