<commit_before>function updateDockBadge() {
    var playControls = document.getElementsByClassName('playControl');

    if (!playControls || playControls.length == 0) {
        console.log('Found no play control');
        window.fluid.dockBadge = '';
        return;
    }

    var playControl = playControls[0];
    var playing = playControl.title.match(/pause/i);
    var paused = playControl.title.match(/play/i);

    if (playing) {
        window.fluid.dockBadge = '\u27a4';
    } else if (paused) {
        window.fluid.dockBadge = '\u2016';
    } else {
        console.log('The play control had an unexpected title.', playControl);
        window.fluid.dockBadge = '';
    }

    setTimeout(updateDockBadge, 500);
}

setTimeout(updateDockBadge, 1000);<commit_msg>Improved badge icons and flow<commit_after>function reset() {
    if (arguments.length > 0) {
        console.log(arguments);
    }

    window.fluid.dockBadge = '\u25fc';
    setTimeout(updateDockBadge, 500);
    return null;
}

function updateDockBadge() {
    var playControlsContainer = document.querySelector('.playControls.m-visible');

    if (!playControlsContainer) {
        return reset('Found no visible play controls');
    }

    var playControls = document.getElementsByClassName('playControl');

    if (!playControls || playControls.length == 0) {
        return reset('Found no play control');
    }

    var playControl = playControls[0];
    var playing = playControl.title.match(/pause/i);
    var paused = playControl.title.match(/play/i);

    if (playing) {
        window.fluid.dockBadge = '\u25b6';
    } else if (paused) {
        window.fluid.dockBadge = 'II';
    } else {
        return reset('The play control had an unexpected title.', playControl);
    }

    setTimeout(updateDockBadge, 500);
}

setTimeout(updateDockBadge, 1000);
{'fraction_non_alphanumeric': 0.12854030501089325, 'fraction_numerical': 0.018518518518518517, 'mean_word_length': 3.0462555066079293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '53233', 'n_tokens_mistral': 596, 'n_tokens_neox': 541, 'n_words': 119}