[BEP47] sha1 hash files are binary by default (#1348)

This commit is contained in:
Cønstantine Kovalensky 2024-01-27 11:34:48 +04:00 committed by GitHub
commit 4d9bfa6dea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -78,10 +78,7 @@ $files = $torrent->$t_version_field()->$t_files_field();
$allFiles = '';
foreach ($files as $file) {
$path = clean_tor_dirname(implode('/', $file->path));
$size = humn_size($file->length, 2);
$hash = ($t_hash_field === 'sha1' && isset($file->$t_hash_field)) ? "SHA1: {$file->$t_hash_field}" : $file->$t_hash_field;
$allFiles .= '<tr><td>' . $path . '</td><td>' . $size . '</td><td>' . $hash . '</td></tr><tr>';
$allFiles .= '<tr><td>' . clean_tor_dirname(implode('/', $file->path)) . '</td><td>' . humn_size($file->length, 2) . '</td><td>' . $file->$t_hash_field . '</td></tr>';
}
$data = [
@ -125,19 +122,19 @@ table {
border: collapse;
width: auto;
margin: 20px auto;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
font-family: "Segoe UI","Noto Sans",Helvetica,sans-serif;
background-color: #2c2c2c;
}
th, td {
padding: 8px;
padding: 10px;
text-align: left;
color: #acacac;
width: auto;
}
td {
border: 2px solid #353535;
border: 3px solid #353535;
}
th {
@ -202,7 +199,7 @@ sup {
</sup>
</th>
</tr>
$allFiles
{$allFiles}
</table>
<p style = "color: gray; font-family: Calibri Light">Generated by <a href = "https://github.com/torrentpier/torrentpier" target="_blank" title = "Bull-powered BitTorrent tracker engine">TorrentPier</a></p>
</center>