<commit_before>var Fs = require('fire-fs');
var Path = require('fire-path');

function _updateTitile () {
    var url = Editor.assetdb.uuidToUrl(Editor.currentSceneUuid);
    if ( !url ) {
        url = 'Untitled';
    }
    Editor.mainWindow.nativeWin.setTitle( 'Fireball Editor - ' + url );
}

module.exports = {
    load: function () {
    },

    unload: function () {
    },

    'scene:open': function () {
        Editor.Panel.open('scene.panel');
    },

    'scene:open-by-uuid': function ( uuid ) {
        Editor.Panel.open('scene.panel', {
            uuid: uuid,
        });
    },

    'scene:ready': function () {
        _updateTitile();
    },

    'scene:save-scene': function (url, json) {
        var fspath = Editor.assetdb._fspath(url);
        if ( Fs.existsSync(fspath) ) {
            Editor.assetdb.save( url, json, function ( err, meta ) {
                if ( err ) {
                    Editor.assetdb.error('Failed to save scene %s', url, err.stack);
                    return;
                }

                Editor.currentSceneUuid = meta.uuid;
                _updateTitile();

                Editor.sendToAll( 'asset-db:asset-changed', {
                    type: meta['meta-type'],
                    uuid: meta.uuid,
                });
            });
        }
        else {
            Editor.assetdb.create( url, json, function ( err, results ) {
                if ( err ) {<commit_msg>change meta-type to asset-type<commit_after>var Fs = require('fire-fs');
var Path = require('fire-path');

function _updateTitile () {
    var url = Editor.assetdb.uuidToUrl(Editor.currentSceneUuid);
    if ( !url ) {
        url = 'Untitled';
    }
    Editor.mainWindow.nativeWin.setTitle( 'Fireball Editor - ' + url );
}

module.exports = {
    load: function () {
    },

    unload: function () {
    },

    'scene:open': function () {
        Editor.Panel.open('scene.panel');
    },

    'scene:open-by-uuid': function ( uuid ) {
        Editor.Panel.open('scene.panel', {
            uuid: uuid,
        });
    },

    'scene:ready': function () {
        _updateTitile();
    },

    'scene:save-scene': function (url, json) {
        var fspath = Editor.assetdb._fspath(url);
        if ( Fs.existsSync(fspath) ) {
            Editor.assetdb.save( url, json, function ( err, meta ) {
                if ( err ) {
                    Editor.assetdb.error('Failed to save scene %s', url, err.stack);
                    return;
                }

                Editor.currentSceneUuid = meta.uuid;
                _updateTitile();

                Editor.sendToAll( 'asset-db:asset-changed', {
                    type: meta['asset-type'],
                    uuid: meta.uuid,
                });
            });
        }
        else {
            Editor.assetdb.create( url, json, function ( err, results ) {
                if ( err ) {
{'fraction_non_alphanumeric': 0.14414414414414414, 'fraction_numerical': 0.0, 'mean_word_length': 1.5915619389587075, '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': '1800995', 'n_tokens_mistral': 886, 'n_tokens_neox': 861, 'n_words': 161}