<commit_before>var React = require('./vendor/react/react-with-addons.js');

var cx = React.addons.classSet;

var PlaylistItem = React.createClass({
    render: function() {

        var item = this.props.item;

        var details;

        if (item.title) {
            details = [];

            if (item.artist) {
                details.push(
                    <span className="artist">{item.artist}</span>
                );

                if (item.album) {
                    details.push(<span>,&nbsp;</span>);
                    details.push(
                        <span className="album">{item.album}</span>
                    );
                }

                if (item.date) {
                    details.push(<span>,&nbsp;</span>);
                    details.push(
                        <span className="year">{item.date}</span>
                    );
                }
            }

            details =
                <div>
                    <p className="title">{item.title}</p>
                    <p className="details">
                        {details}
                    </p>
                </div>;
        } else {
            details = <span className="url">{item.file}</span>
        }

        var classes = cx({
            'playlist-item': true,
            'playlist-item-selected': this.props.selected,
            'playlist-item-playing': this.props.playing
        });

        return (
            <li className={classes} onMouseDown={this.itemClick} onDoubleClick={this.itemDblClick}>
                {this.props.time}
                <div className="image"></div>
                {details}
            </li>
        );
    },

    itemClick: function(e) {
        if (this.props.onItemClick) {
            this.props.onItemClick(e, this.props.item);
        }
    },

    itemDblClick: function(e) {
        if (this.props.onItemDblClick) {
            this.props.onItemDblClick(e, this.props.item);
        }<commit_msg>Added times to the playlist items.<commit_after>var React = require('./vendor/react/react-with-addons.js');

var cx = React.addons.classSet;

function formatTime(seconds) {
    function zeroPad(n) {
        return n < 10 ? '0' + n : n;
    }
    return Math.floor(seconds / 60) + ':' + zeroPad(seconds % 60);
}

var PlaylistItem = React.createClass({
    render: function() {

        var item = this.props.item;

        var details;

        if (item.title) {
            details = [];

            if (item.artist) {
                details.push(
                    <span className="artist">{item.artist}</span>
                );

                if (item.album) {
                    details.push(<span>,&nbsp;</span>);
                    details.push(
                        <span className="album">{item.album}</span>
                    );
                }

                if (item.date) {
                    details.push(<span>,&nbsp;</span>);
                    details.push(
                        <span className="year">{item.date}</span>
                    );
                }
            }

            details =
                <div>
                    <p className="title">{item.title}</p>
                    <p className="details">
                        {details}
                    </p>
                </div>;
        } else {
            details = <span className="url">{item.file}</span>
        }

        var time = formatTime(+this.props.item.time);

        var classes = cx({
            'playlist-item': true,
            'playlist-item-selected': this.props.selected,
            'playlist-item-playing': this.props.playing
        });

        return (
            <li className={classes} onMouseDown={this.itemClick} onDoubleClick={this.itemDblClick}>
                <span className="time">{time}</span>
                <div className="image" />
                {details}
            </li>
        );
    },

    itemClick: function(e) {
        if (this.props.onItemClick) {
            this.props.onItemClick(e, this.props.item);
        }
    },

    itemDblClick: function(e) {
        if (this.props.onItemDblClick) {
            this.props.onItemDblClick(e, this.props.item);
        }
{'fraction_non_alphanumeric': 0.13648231663897462, 'fraction_numerical': 0.001661523854735343, 'mean_word_length': 1.237918215613383, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 48, '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': '5407596', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1112, 'n_words': 184}