<commit_before>var path = require('path');
var tilelive = require('tilelive');
var settings = Bones.plugin.config;

models.Preview.prototype.sync = function(method, model, success, error) {
    if (method !== 'read') return error(new Error('Method not supported.'));
    var filepath = path.join(settings.files, 'export', model.id);
    tilelive.load('mbtiles://' + filepath, function(err, source) {
        if (err) return error(err);
        source.getInfo(function(err, info) {
            if (err) return error(err);
            info.tiles = ['http://' + settings.tileUrl + '/tile/' + model.id + '/{z}/{x}/{y}.png'];
            success(_(info).extend({id: model.id }));
        });
    });
};

<commit_msg>Add timestamp querystring to mbtiles preview. Fixes #760.<commit_after>var path = require('path');
var tilelive = require('tilelive');
var settings = Bones.plugin.config;

models.Preview.prototype.sync = function(method, model, success, error) {
    if (method !== 'read') return error(new Error('Method not supported.'));
    var filepath = path.join(settings.files, 'export', model.id);
    tilelive.load('mbtiles://' + filepath, function(err, source) {
        if (err) return error(err);
        source.getInfo(function(err, info) {
            if (err) return error(err);
            info.tiles = ['http://' + settings.tileUrl + '/tile/' + model.id + '/{z}/{x}/{y}.png?' + (+new Date)];
            success(_(info).extend({id: model.id }));
        });
    });
};


{'fraction_non_alphanumeric': 0.18906144496961513, 'fraction_numerical': 0.002025658338960162, 'mean_word_length': 3.1512605042016806, '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': '5028109', 'n_tokens_mistral': 461, 'n_tokens_neox': 457, 'n_words': 107}