<commit_before>var stat = require('fs').stat;
var helper = require('../../../helper');
var localPath = helper.localPath;
var basename = require('path').basename;
var joinpath = require('path').join;
var moment = require('moment');
var Entry = require('../../../models/entry');
var IgnoredFiles = require('../../../models/ignoredFiles');

var REASONS = {
        'PREVIEW': 'a preview',
        'TOO_LARGE': 'too large',
        'WRONG_TYPE': 'not a file Blot can process'
      };
module.exports = function (blog, path, callback) {

  var blogID = blog.id;

  var local = localPath(blogID, path);

  stat(local, function(err, stat){

    if (err) return callback(err);

    IgnoredFiles.getStatus(blogID, path, function(err, ignored){

      Entry.getByPath(blogID, path, function(entry){

        if (ignored) ignored = REASONS[ignored] || 'was ignored';

        stat.path = path;
        stat.name = basename(path);

        stat.updated = moment.utc(stat.mtime).from(moment.utc(), true);

        stat.size = humanFileSize(stat.size);

        stat.directory = stat.isDirectory();
        stat.file = stat.isFile();
        stat.url = joinpath('/~', path);
        stat.entry = entry;
        stat.ignored = ignored;

        if (entry) {

          if (entry.page && entry.menu === false) {
            entry.url = entry.path;
          }

          if (entry.draft) {
            entry.url = '/draft/view' + entry.path;
          }

          if (entry.scheduled) {
            entry.url += "?scheduled=true";
            entry.toNow = moment.utc(entry.dateStamp).fromNow();
            entry.date = moment.utc(entry.dateStamp)
                               .tz(blog.timeZone)
                               .format('MMMM Do YYYY, h:mma');
          }

        }

        return callback(null, stat);
      });
    });
  });<commit_msg>tweaked dashboard display logic<commit_after>var stat = require('fs').stat;
var helper = require('../../../helper');
var localPath = helper.localPath;
var basename = require('path').basename;
var joinpath = require('path').join;
var moment = require('moment');
var Entry = require('../../../models/entry');
var IgnoredFiles = require('../../../models/ignoredFiles');
var extname = require('path').extname;

var REASONS = {
        'PREVIEW': 'a preview',
        'TOO_LARGE': 'too large',
        'WRONG_TYPE': 'not a file Blot can process'
      };
module.exports = function (blog, path, callback) {

  var blogID = blog.id;

  var local = localPath(blogID, path);

  stat(local, function(err, stat){

    if (err) return callback(err);

    IgnoredFiles.getStatus(blogID, path, function(err, ignored){

      Entry.getByPath(blogID, path, function(entry){

        if (ignored) ignored = REASONS[ignored] || 'was ignored';

        stat.path = path;
        stat.name = basename(path);

        stat.updated = moment.utc(stat.mtime).from(moment.utc(), true);

        stat.size = humanFileSize(stat.size);

        stat.directory = stat.isDirectory();
        stat.file = stat.isFile();
        stat.url = joinpath('/~', path);
        stat.entry = entry;
        stat.ignored = ignored;

        if (entry) {

          if (entry.page && entry.menu === false && ['.txt', '.md', '.html'].indexOf(extname(entry.path)) === -1) {
            entry.url = entry.path;
          }

          if (entry.draft) {
            entry.url = '/draft/view' + entry.path;
          }

          if (entry.scheduled) {
            entry.url += "?scheduled=true";
            entry.toNow = moment.utc(entry.dateStamp).fromNow();
            entry.date = moment.utc(entry.dateStamp)
                               .tz(blog.timeZone)
                               .format('MMMM Do YYYY, h:mma');
          }

        }

        return callback(null, stat);
      });
    });
  });
{'fraction_non_alphanumeric': 0.1633832413974258, 'fraction_numerical': 0.0002626740215392698, 'mean_word_length': 2.0934199837530465, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '111591', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1144, 'n_words': 250}