def _api_queue_rating(output, value, kwargs):
 vote_map = {'up': Rating.VOTE_UP, 'down': Rating.VOTE_DOWN}
 flag_map = {'spam': Rating.FLAG_SPAM, 'encrypted': Rating.FLAG_ENCRYPTED, 'expired': Rating.FLAG_EXPIRED, 'other': Rating.FLAG_OTHER, 'comment': Rating.FLAG_COMMENT}
 content_type = kwargs.get('type')
 setting = kwargs.get('setting')
 if value:
  try:
   video = audio = vote = flag = None
   if ((content_type == 'video') and (setting != '-')):
    video = setting
   if ((content_type == 'audio') and (setting != '-')):
    audio = setting
   if (content_type == 'vote'):
    vote = vote_map[setting]
   if (content_type == 'flag'):
    flag = flag_map[setting]
   if cfg.rating_enable():
    Rating.do.update_user_rating(value, video, audio, vote, flag, kwargs.get('detail'))
   return report(output)
  except:
   return report(output, _MSG_BAD_SERVER_PARMS)
 else:
  return report(output, _MSG_NO_VALUE)

def _api_queue_rating ( output , value , kwargs ) : vote_map = { 'up' : Rating . VOTE_UP , 'down' : Rating . VOTE_DOWN } flag_map = { 'spam' : Rating . FLAG_SPAM , 'encrypted' : Rating . FLAG_ENCRYPTED , 'expired' : Rating . FLAG_EXPIRED , 'other' : Rating . FLAG_OTHER , 'comment' : Rating . FLAG_COMMENT } content_type = kwargs . get ( 'type' ) setting = kwargs . get ( 'setting' ) if value : try : video = audio = vote = flag = None if ( ( content_type == 'video' ) and ( setting != '-' ) ) : video = setting if ( ( content_type == 'audio' ) and ( setting != '-' ) ) : audio = setting if ( content_type == 'vote' ) : vote = vote_map [ setting ] if ( content_type == 'flag' ) : flag = flag_map [ setting ] if cfg . rating_enable ( ) : Rating . do . update_user_rating ( value , video , audio , vote , flag , kwargs . get ( 'detail' ) ) return report ( output ) except : return report ( output , _MSG_BAD_SERVER_PARMS ) else : return report ( output , _MSG_NO_VALUE )
api: accepts output .