<commit_before>SyncFS = (function () {
    "use strict";

    var ID3V1_START = "TAG";
    var NULLSTRING = String.fromCharCode(0);

    var pendingQueue = []; // do not allow simultaneous multiple download processed
    var downloadingURL; // active download URL
    var downloadedFilesIds = []; // vkids of files in the cloud

    // listen to syncfs file changes
    chrome.syncFileSystem.onFileStatusChanged.addListener(onStatusChange);

    // load downloaded files vkids immediately
    chrome.syncFileSystem.requestFileSystem(function (fs) {
        if (!fs || !fs.root) {
            return; // probably not authorized
        }

        var dirReader = fs.root.createReader();
        dirReader.readEntries(function (results) {
            [].forEach.call(results, function (fileEntry) {
                if (!/\.mp3$/.test(fileEntry.name))
                    return;

                getAudioIdFromFile(fileEntry, function (vkId) {
                    if (vkId) {
                        downloadedFilesIds.push(vkId);

                        // this process can last longer than the first UI view happens
                        // so here's the time to update songs' status
                        var cloudIcon = $(".song[data-vkid='" + vkId + "'] .cloud");
                        if (cloudIcon) {
                            cloudIcon.addClass("pending");
                        }
                    }
                });
            });
        }, function (err) {
            throw new Error(err.message + " (code " + err.code + ")");
        });
    });

    function onStatusChange(details) {
        requestFilesNum(function (num) {
            $("header span.header-local span.counter").text(num || "");
        });
    }

    function requestFilesNum(callback) {
        chrome.syncFileSystem.requestFileSystem(function (fs) {
            var dirReader = fs.root.createReader();
            dirReader.readEntries(function (results) {
                var cnt = 0;

                [].forEach.call(results, function (fileEntry) {
                    if (!/\.mp3$/.test(fileEntry.name))
                        return;

                    cnt += 1;
                });

                callback(cnt);
            }, function (err) {
                callback(0);
                throw new Error(err.message + " (code " + err.code + ")");<commit_msg>Fix status change log errors<commit_after>SyncFS = (function () {
    "use strict";

    var ID3V1_START = "TAG";
    var NULLSTRING = String.fromCharCode(0);

    var pendingQueue = []; // do not allow simultaneous multiple download processed
    var downloadingURL; // active download URL
    var downloadedFilesIds = []; // vkids of files in the cloud

    // listen to syncfs file changes
    chrome.syncFileSystem.onFileStatusChanged.addListener(onStatusChange);

    // load downloaded files vkids immediately
    chrome.syncFileSystem.requestFileSystem(function (fs) {
        if (!fs || !fs.root) {
            return; // probably not authorized
        }

        var dirReader = fs.root.createReader();
        dirReader.readEntries(function (results) {
            [].forEach.call(results, function (fileEntry) {
                if (!/\.mp3$/.test(fileEntry.name))
                    return;

                getAudioIdFromFile(fileEntry, function (vkId) {
                    if (vkId) {
                        downloadedFilesIds.push(vkId);

                        // this process can last longer than the first UI view happens
                        // so here's the time to update songs' status
                        var cloudIcon = $(".song[data-vkid='" + vkId + "'] .cloud");
                        if (cloudIcon) {
                            cloudIcon.addClass("pending");
                        }
                    }
                });
            });
        }, function (err) {
            throw new Error(err.message + " (code " + err.code + ")");
        });
    });

    function onStatusChange(details) {
        requestFilesNum(function (num) {
            var cntElem = $("header span.header-local span.counter");

            if (cntElem) {
                cntElem.text(num || "");
            }
        });
    }

    function requestFilesNum(callback) {
        chrome.syncFileSystem.requestFileSystem(function (fs) {
            var dirReader = fs.root.createReader();
            dirReader.readEntries(function (results) {
                var cnt = 0;

                [].forEach.call(results, function (fileEntry) {
                    if (!/\.mp3$/.test(fileEntry.name))
                        return;

                    cnt += 1;
                });

                callback(cnt);
            }, function (err) {
                callback(0);
                throw new Error(err.message + " (code " + err.code + ")");
{'fraction_non_alphanumeric': 0.11575031004547334, 'fraction_numerical': 0.0033071517155849523, 'mean_word_length': 1.49948347107438, '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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1978936', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1185, 'n_words': 287}