<commit_before># frozen_string_literal: true

class Folio::Console::FileSerializer
  include FastJsonapi::ObjectSerializer

  ADMIN_THUMBNAIL_SIZE = '250x250'

  attributes :id,
             :file_size,
             :file_name,
             :type

  attribute :thumb do |object|
    object.thumb(ADMIN_THUMBNAIL_SIZE).url if object.is_a?(Folio::Image)
  end

  attribute :source_image do |object|<commit_msg>add ADMIN_RETINA_THUMBNAIL_SIZE constant<commit_after># frozen_string_literal: true

class Folio::Console::FileSerializer
  include FastJsonapi::ObjectSerializer

  ADMIN_THUMBNAIL_SIZE = '250x250'
  ADMIN_RETINA_THUMBNAIL_SIZE = '500x500'

  attributes :id,
             :file_size,
             :file_name,
             :type

  attribute :thumb do |object|
    object.thumb(ADMIN_THUMBNAIL_SIZE).url if object.is_a?(Folio::Image)
  end

  attribute :source_image do |object|
{'fraction_non_alphanumeric': 0.08700564971751412, 'fraction_numerical': 0.020338983050847456, 'mean_word_length': 3.763440860215054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '668189', 'n_tokens_mistral': 324, 'n_tokens_neox': 298, 'n_words': 55}