<commit_before>block content
- if (!name)
  - var name = i18n.gettext('Media List');
- if (!fixed)
  - var fixed = false

- var readonly = false;
- var is_playlist = false;
- var dbind = 'foreach: collection';
- var inndbind = 'drag: $data, dragOptions: { cursorAt: {top: 5, left: 5 }, scroll: false, appendTo: "#content",  }';
- var default_name = '';

- if (type.match(/searchable/))
  - dbind = 'foreach: collection';
  - inndbind = '';

- if (type.match(/draggable/))
  - dbind = 'foreach: collection';
  - inndbind = 'drag: $data, dragOptions: { cursorAt: {top: 5, left: 5 }, scroll: false, appendTo: "#content"}';

- if (type.match(/sortable/))
  - dbind = 'sortable: { data: collection, allowDrop: allowDrop, dragged: dragHandler, afterMove: afterMove}';
  - inndbind = '';
  - is_playlist = true;
  - default_name= "||'" + i18n.gettext('New Playlist') + "'";

- if (type.match(/fixed/))
  - var fixed = true;

- if (type.match(/readonly/))
  - readonly = true;
  - dbind = 'foreach: collection';
  - inndbind = '';

- var thumbnail = i18n.gettext('Thumbnail')
- var media_info = i18n.gettext('Media info')

#media-list.infinit-panel
  - if (!fixed)
    button.close.kill-media-list(type='button', data-dismiss='alert') ×
  .listHeader
    .editable-list-name(
          data-trigger= 'hover'
          data-placement= 'left'
          data-title= i18n.gettext ('Edit me !')
          data-content= i18n.gettext('Click here to edit Playlist Name.')
          style= 'border:none;'
      )

      .fixed
      - if (is_playlist && !readonly)
          h1.list-name(data-bind="text: name()" + default_name + ", visible: !editingName(), click: nameClick")
          input.input-block-level.input-list-name(data-bind="value: name, visible: editingName, hasfocus: editingName, valueUpdate: 'afterkeydown', addOnEnter: changeFocus", type='text')
      - else
          h1.list-name= name

    #media-search
    <!-- ko if: playlist_or_notempty -->
    .total-time-div
        h1.label.label-inverse.format
            i.icon-time.icon-white
            span= ' '
            span.total-time.label.label-inverse.format(data-bind="text: total_time")
    .table-container
        table.table.table-bordered.table-striped.table-condensed#table
            thead
            tr
                th.thumbnail= thumbnail
                th.description= media_info
    <!-- /ko -->

    - if (!is_playlist)
       <!-- ko ifnot: collection().length -->
       .alert.alert-block.no-items
         h4= i18n.gettext('Oops!')
         p=  i18n.gettext('No items found')
       <!-- /ko -->

  <!-- ko if: playlist_or_notempty() -->
  .scrollable
    #playlist-table
      .table-container
        table.table.table-bordered.table-striped.table-condensed#table
              tbody.tbody#media-view(data-bind=dbind,class='tbody')
                tr(data-bind=inndbind)
                  td.center
                    - if (!is_playlist)
                      - var target = "attr:{href: '/media/'+checksum().split('-')[0]}";
                    a.plain(data-bind=target)
                      img(width="150",height="100",data-bind="attr:{ src: checksum() ?  '/sc/'+checksum().split('-')[0]+'.jpg' : '/pics/generic.jpg' }")
                  td
                      - if (is_playlist)
                        button.close.remove-media(type='button', data-bind='click: $root.removeItem, clickBubble: false') ×
                      h5(data-bind="text: name")
                      h5(data-bind="text: stat().name ? stat().name : file")
                      span.label.label-warning.format
                          i.icon-time.icon-white
                          span(data-bind="text: durationraw")
                      span='  '

                      <!-- ko if: video().container -->
                      span.label.format
                          i.icon-file.icon-white
                          span(data-bind="text: ' '+video().container ")
                      span=' '
                      <!-- /ko -->

                      span.label.video
                          i.icon-film.icon-white
                          span(data-bind=" text: ' '+video().codec")
                      span=' '
                      span.label.audio
                          i.icon-volume-up.icon-white
                          span(data-bind=" text: ' '+audio().codec")
                          span=' '
  .loading
  <!-- /ko -->
<commit_msg>Replace screenshot dir with config<commit_after>block content
- if (!name)
  - var name = i18n.gettext('Media List');
- if (!fixed)
  - var fixed = false

- var readonly = false;
- var is_playlist = false;
- var dbind = 'foreach: collection';
- var inndbind = 'drag: $data, dragOptions: { cursorAt: {top: 5, left: 5 }, scroll: false, appendTo: "#content",  }';
- var default_name = '';

- if (type.match(/searchable/))
  - dbind = 'foreach: collection';
  - inndbind = '';

- if (type.match(/draggable/))
  - dbind = 'foreach: collection';
  - inndbind = 'drag: $data, dragOptions: { cursorAt: {top: 5, left: 5 }, scroll: false, appendTo: "#content"}';

- if (type.match(/sortable/))
  - dbind = 'sortable: { data: collection, allowDrop: allowDrop, dragged: dragHandler, afterMove: afterMove}';
  - inndbind = '';
  - is_playlist = true;
  - default_name= "||'" + i18n.gettext('New Playlist') + "'";

- if (type.match(/fixed/))
  - var fixed = true;

- if (type.match(/readonly/))
  - readonly = true;
  - dbind = 'foreach: collection';
  - inndbind = '';

- var thumbnail = i18n.gettext('Thumbnail')
- var media_info = i18n.gettext('Media info')

- var conf_dirs = appCollection.at(0).get('Caspa').Dirs
- var thumbnail_dir = conf_dirs.screenshots.replace(conf_dirs.pub, '').replace(/\/?$/,'/')

#media-list.infinit-panel
  - if (!fixed)
    button.close.kill-media-list(type='button', data-dismiss='alert') ×
  .listHeader
    .editable-list-name(
          data-trigger= 'hover'
          data-placement= 'left'
          data-title= i18n.gettext ('Edit me !')
          data-content= i18n.gettext('Click here to edit Playlist Name.')
          style= 'border:none;'
      )

      .fixed
      - if (is_playlist && !readonly)
          h1.list-name(data-bind="text: name()" + default_name + ", visible: !editingName(), click: nameClick")
          input.input-block-level.input-list-name(data-bind="value: name, visible: editingName, hasfocus: editingName, valueUpdate: 'afterkeydown', addOnEnter: changeFocus", type='text')
      - else
          h1.list-name= name

    #media-search
    <!-- ko if: playlist_or_notempty -->
    .total-time-div
        h1.label.label-inverse.format
            i.icon-time.icon-white
            span= ' '
            span.total-time.label.label-inverse.format(data-bind="text: total_time")
    .table-container
        table.table.table-bordered.table-striped.table-condensed#table
            thead
            tr
                th.thumbnail= thumbnail
                th.description= media_info
    <!-- /ko -->

    - if (!is_playlist)
       <!-- ko ifnot: collection().length -->
       .alert.alert-block.no-items
         h4= i18n.gettext('Oops!')
         p=  i18n.gettext('No items found')
       <!-- /ko -->

  <!-- ko if: playlist_or_notempty() -->
  .scrollable
    #playlist-table
      .table-container
        table.table.table-bordered.table-striped.table-condensed#table
              tbody.tbody#media-view(data-bind=dbind,class='tbody')
                tr(data-bind=inndbind)
                  td.center
                    - if (!is_playlist)
                      - var target = "attr:{href: '/media/'+checksum().split('-')[0]}";
                    - var thumbnail_target = "attr:{ src: checksum() ?  '" + thumbnail_dir  + "'+checksum().split('-')[0]+'.jpg' : '/pics/generic.jpg' }"
                    a.plain(data-bind=target)
                      img(width="150",height="100",data-bind=thumbnail_target)
                  td
                      - if (is_playlist)
                        button.close.remove-media(type='button', data-bind='click: $root.removeItem, clickBubble: false') ×
                      h5(data-bind="text: name")
                      h5(data-bind="text: stat().name ? stat().name : file")
                      span.label.label-warning.format
                          i.icon-time.icon-white
                          span(data-bind="text: durationraw")
                      span='  '

                      <!-- ko if: video().container -->
                      span.label.format
                          i.icon-file.icon-white
                          span(data-bind="text: ' '+video().container ")
                      span=' '
                      <!-- /ko -->

                      span.label.video
                          i.icon-film.icon-white
                          span(data-bind=" text: ' '+video().codec")
                      span=' '
                      span.label.audio
                          i.icon-volume-up.icon-white
                          span(data-bind=" text: ' '+audio().codec")
                          span=' '
  .loading
  <!-- /ko -->

{'fraction_non_alphanumeric': 0.15987701767870868, 'fraction_numerical': 0.0075765894366970465, 'mean_word_length': 1.7566585956416465, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '947252', 'n_tokens_mistral': 2863, 'n_tokens_neox': 2746, 'n_words': 511}