<commit_before><script type="text/javascript">
// {{ range _, cat := GetCategories(false, true) }}
T.Add("{{ cat.ID }}", "{{ T(cat.Name) }}")
// {{end}}
// {{ range _, language := GetTorrentLanguages() }}
T.Add("{{ language.Code }}", "{{ LanguageName(language, T) }}")
// {{ if language.Tag != language.Code }}
T.Add("{{ language.Tag }}", "{{ LanguageName(language, T) }}")
// {{end}}
// {{end}}
Templates.Add("torrents.item", function(torrent) {
    var tr_class = "torrent-info hidden"
    if (torrent.status == 2) {
            tr_class += " remake"
    } else if (torrent.status == 3) {
            tr_class += " trusted"
    } else if (torrent.status == 4) {
            tr_class += " aplus"
    }
    var catClass = "nyaa-cat"
    // {{ if Sukebei() }}
    catClass += " sukebei-cat-"+ torrent.category + torrent.sub_category
    // {{else}}
    catClass += " nyaa-cat-"+ torrent.sub_category
    // {{end}}
    var languages = ""
    var colspan = (torrent.comments.length  == 0 ? ` colspan="2"` : "" )
    var commentTd = ((torrent.comments.length > 0) ? '<td class="tr-cs home-td"><span>' + torrent.comments.length + '</span></td>' : "")
    var dlLink = (torrent.torrent != "" ? ' <a><div class="icon-floppy"></div></a>' : "")

    if (torrent.languages[0] != "") {
        var flagClass = (torrent.languages.length == 1) ? Templates.FlagCode(torrent.languages[0]) : "multiple"
        var langs = torrent.languages.map(function (el, i) { return T.r(el)}).join(",") 
        languages = `<a><img src="img/blank.gif" class="flag flag-` + flagClass + `" title="` + langs + `"></a>`
    }

    return `<tr id="torrent_` + torrent.id + `" class="` + tr_class + `">
    <td class="tr-cat home-td">
        <div class="` + catClass +`">
            <a class="category">
                ` + languages + `
            </a>
        </div></td>
        <td class="tr-name home-td"` +  colspan + `><a>` + Templates.EncodeEntities(torrent.name) + `</a></td>
        `+ commentTd +`
        <td class="tr-links home-td">
            <a  title="{{ T("magnet_link") }}">
                <div class="icon-magnet"></div>
            </a>`+ dlLink +`
        </td>
        <td class="tr-size home-td hide-xs">` + humanFileSize(torrent.filesize) + `</td>
        <td class="tr-se home-td hide-smol">` + torrent.seeders + `</td>
        <td class="tr-le home-td hide-smol">` + torrent.leechers + `</td>
        <td class="tr-dl home-td hide-xs">` + torrent.completed + `</td>
        <td class="tr-date home-td date-short hide-xs">` + torrent.date + `</td>
    </tr>`;
});
</script>
<commit_msg>Same but for preview torrents<commit_after><script type="text/javascript">
// {{ range _, cat := GetCategories(false, true) }}
T.Add("{{ cat.ID }}", "{{ T(cat.Name) }}")
// {{end}}
// {{ range _, language := GetTorrentLanguages() }}
T.Add("{{ language.Code }}", "{{ LanguageName(language, T) }}")
// {{ if language.Tag != language.Code }}
T.Add("{{ language.Tag }}", "{{ LanguageName(language, T) }}")
// {{end}}
// {{end}}
Templates.Add("torrents.item", function(torrent) {
    var tr_class = "torrent-info hidden"
    if (torrent.status == 2) {
            tr_class += " remake"
    } else if (torrent.status == 3) {
            tr_class += " trusted"
    } else if (torrent.status == 4) {
            tr_class += " aplus"
    }
    var catClass = "nyaa-cat"
    // {{ if Sukebei() }}
    catClass += " sukebei-cat-"+ torrent.category + torrent.sub_category
    // {{else}}
    catClass += " nyaa-cat-"+ torrent.sub_category
    // {{end}}
    var languages = ""
    var colspan = (torrent.comments.length  == 0 ? ` colspan="2"` : "" )
    var commentTd = ((torrent.comments.length > 0) ? `<td class="tr-cs home-td" title="`+torrent.comments.length + ` ` + {{T("comments")}} +`"><span>` + torrent.comments.length + `</span></td>` : "")
    var dlLink = (torrent.torrent != "" ? ' <a><div class="icon-floppy"></div></a>' : "")

    if (torrent.languages[0] != "") {
        var flagClass = (torrent.languages.length == 1) ? Templates.FlagCode(torrent.languages[0]) : "multiple"
        var langs = torrent.languages.map(function (el, i) { return T.r(el)}).join(",") 
        languages = `<a><img src="img/blank.gif" class="flag flag-` + flagClass + `" title="` + langs + `"></a>`
    }

    return `<tr id="torrent_` + torrent.id + `" class="` + tr_class + `">
    <td class="tr-cat home-td">
        <div class="` + catClass +`">
            <a class="category">
                ` + languages + `
            </a>
        </div></td>
        <td class="tr-name home-td"` +  colspan + `><a>` + Templates.EncodeEntities(torrent.name) + `</a></td>
        `+ commentTd +`
        <td class="tr-links home-td">
            <a  title="{{ T("magnet_link") }}">
                <div class="icon-magnet"></div>
            </a>`+ dlLink +`
        </td>
        <td class="tr-size home-td hide-xs">` + humanFileSize(torrent.filesize) + `</td>
        <td class="tr-se home-td hide-smol">` + torrent.seeders + `</td>
        <td class="tr-le home-td hide-smol">` + torrent.leechers + `</td>
        <td class="tr-dl home-td hide-xs">` + torrent.completed + `</td>
        <td class="tr-date home-td date-short hide-xs">` + torrent.date + `</td>
    </tr>`;
});
</script>

{'fraction_non_alphanumeric': 0.22124883504193849, 'fraction_numerical': 0.0033550792171481826, 'mean_word_length': 2.3748427672955974, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 87, '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': '3398433', 'n_tokens_mistral': 1924, 'n_tokens_neox': 1851, 'n_words': 361}