<commit_before>(function() {
    var MetadataTabView = OCA.Files.DetailTabView.extend({
        id: 'metadataTabView',
        className: 'tab metadataTabView',

        getLabel: function() {
            return t('metadata', 'Metadata');
        },

        render: function() {
            this.$el.html('<div style="text-align:center; word-wrap:break-word;" class="get-metadata"><p><img src="'
                + OC.imagePath('core','loading.gif')
                + '"><br><br></p><p>'
                + t('metadata', 'Reading metadata ...')
                + '</p></div>');

            var url = OC.generateUrl('/apps/metadata/get'),
                data = {source: this.getFileInfo().getFullPath()},
                _self = this;
            $.ajax({
                type: 'GET',
                url: url,
                dataType: 'json',
                data: data,
                async: true,
                success: function(data) {
                    _self.updateDisplay(data);
                }
            });
        },

        canDisplay: function(fileInfo) {
            if (!fileInfo || fileInfo.isDirectory() || !fileInfo.has('mimetype')) {
                return false;
            }
            var mimetype = fileInfo.get('mimetype');

            return (['audio/flac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/wav',
                'image/jpeg', 'image/tiff',
                'video/3gpp', 'video/dvd', 'video/mp4', 'video/mpeg', 'video/quicktime',
                'video/x-flv', 'video/x-matroska', 'video/x-msvideo'].indexOf(mimetype) > -1);
        },

        updateDisplay: function(data) {
            var html = '';
            var showLocation = false;

            if (data.response === 'success') {
                html += '<table>';<commit_msg>Additional check to prevent #8<commit_after>(function() {
    var MetadataTabView = OCA.Files.DetailTabView.extend({
        id: 'metadataTabView',
        className: 'tab metadataTabView',

        getLabel: function() {
            return t('metadata', 'Metadata');
        },

        render: function() {
            var fileInfo = this.getFileInfo();
            
            if (fileInfo) {
                this.$el.html('<div style="text-align:center; word-wrap:break-word;" class="get-metadata"><p><img src="'
                    + OC.imagePath('core','loading.gif')
                    + '"><br><br></p><p>'
                    + t('metadata', 'Reading metadata ...')
                    + '</p></div>');

                var url = OC.generateUrl('/apps/metadata/get'),
                    data = {source: fileInfo.getFullPath()},
                    _self = this;
                $.ajax({
                    type: 'GET',
                    url: url,
                    dataType: 'json',
                    data: data,
                    async: true,
                    success: function(data) {
                        _self.updateDisplay(data);
                    }
                });
            }
        },

        canDisplay: function(fileInfo) {
            if (!fileInfo || fileInfo.isDirectory() || !fileInfo.has('mimetype')) {
                return false;
            }
            var mimetype = fileInfo.get('mimetype');

            return (['audio/flac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/wav',
                'image/jpeg', 'image/tiff',
                'video/3gpp', 'video/dvd', 'video/mp4', 'video/mpeg', 'video/quicktime',
                'video/x-flv', 'video/x-matroska', 'video/x-msvideo'].indexOf(mimetype) > -1);
        },

        updateDisplay: function(data) {
            var html = '';
            var showLocation = false;

            if (data.response === 'success') {
                html += '<table>';
{'fraction_non_alphanumeric': 0.16005326231691078, 'fraction_numerical': 0.002396804260985353, 'mean_word_length': 1.4357976653696498, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '1621496', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1005, 'n_words': 186}