<commit_before>class SetMediaAccessModeWorker
  include Sidekiq::Worker

  def perform(media_id, media_type)
    case media_type
    when "photo"
      media = Hanuman::ObservationPhoto.find media_id
      unless media.photo.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.photo.my_public_id)
      end
    when "video"
      media = Hanuman::ObservationVideo.find media_id
      unless media.video.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.video.my_public_id, :resource_type => :video)
      end
    when "document"
      media = Hanuman::ObservationDocument.find media_id
      unless media.document.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.document.my_public_id, :resource_type => :raw)
      end
    when "signature"
      media = Hanuman::ObservationSignature.find media_id
      unless media.signature.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.signature.my_public_id)
      end
    when "project_document"
      media = ProjectDocument.find media_id
      unless media.document.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.document.my_public_id)
      end
    else
      media = nil
    end

  end<commit_msg>#160002343 remove not working raw<commit_after>class SetMediaAccessModeWorker
  include Sidekiq::Worker

  def perform(media_id, media_type)
    case media_type
    when "photo"
      media = Hanuman::ObservationPhoto.find media_id
      unless media.photo.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.photo.my_public_id)
      end
    when "video"
      media = Hanuman::ObservationVideo.find media_id
      unless media.video.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.video.my_public_id, :resource_type => :video)
      end
    when "document"
      media = Hanuman::ObservationDocument.find media_id
      unless media.document.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.document.my_public_id)
      end
    when "signature"
      media = Hanuman::ObservationSignature.find media_id
      unless media.signature.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.signature.my_public_id)
      end
    when "project_document"
      media = ProjectDocument.find media_id
      unless media.document.blank?
        Cloudinary::Api.update_resources_access_mode_by_ids('authenticated', media.document.my_public_id)
      end
    else
      media = nil
    end

  end
{'fraction_non_alphanumeric': 0.08178438661710037, 'fraction_numerical': 0.003345724907063197, 'mean_word_length': 3.771276595744681, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3821931', 'n_tokens_mistral': 808, 'n_tokens_neox': 788, 'n_words': 137}