def isFinalResult(result):
 logger.log((u"Checking if we should keep searching after we've found " + result.name), logger.DEBUG)
 show_obj = result.episodes[0].show
 (any_qualities, best_qualities) = Quality.splitQuality(show_obj.quality)
 if (best_qualities and (result.quality < max(best_qualities))):
  return False
 elif (any_qualities and (result.quality == max(any_qualities))):
  return True
 elif (best_qualities and (result.quality == max(best_qualities))):
  if (any_qualities and (result.quality < max(any_qualities))):
   return False
  else:
   return True
 else:
  return False

def isFinalResult ( result ) : logger . log ( ( u"Checking if we should keep searching after we've found " + result . name ) , logger . DEBUG ) show_obj = result . episodes [ 0 ] . show ( any_qualities , best_qualities ) = Quality . splitQuality ( show_obj . quality ) if ( best_qualities and ( result . quality < max ( best_qualities ) ) ) : return False elif ( any_qualities and ( result . quality == max ( any_qualities ) ) ) : return True elif ( best_qualities and ( result . quality == max ( best_qualities ) ) ) : if ( any_qualities and ( result . quality < max ( any_qualities ) ) ) : return False else : return True else : return False
checks if the given result is good enough quality that we can stop searching for other ones .