Minor improvements (#1685)

* Minor improvements

* Update ffprobe_info.php

* Update ffprobe_info.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-11-28 01:07:44 +07:00 committed by GitHub
commit 68ef591b82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View file

@ -25,7 +25,7 @@
- Fixed `md5()` deprecated in PHP 8.4 [\#1561](https://github.com/torrentpier/torrentpier/pull/1561) ([belomaxorka](https://github.com/belomaxorka))
- Increased `USEREMAIL_MAX_LENGTH` [\#1566](https://github.com/torrentpier/torrentpier/pull/1566) ([belomaxorka](https://github.com/belomaxorka))
- Disabled resizing for textarea tag [\#1638](https://github.com/torrentpier/torrentpier/pull/1638) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1570](https://github.com/torrentpier/torrentpier/pull/1570), [\#1571](https://github.com/torrentpier/torrentpier/pull/1571), [\#1575](https://github.com/torrentpier/torrentpier/pull/1575), [\#1589](https://github.com/torrentpier/torrentpier/pull/1589), [\#1592](https://github.com/torrentpier/torrentpier/pull/1592), [\#1605](https://github.com/torrentpier/torrentpier/pull/1605), [\#1611](https://github.com/torrentpier/torrentpier/pull/1611), [\#1612](https://github.com/torrentpier/torrentpier/pull/1612), [\#1615](https://github.com/torrentpier/torrentpier/pull/1615), [\#1627](https://github.com/torrentpier/torrentpier/pull/1627), [\#1633](https://github.com/torrentpier/torrentpier/pull/1633), [\#1641](https://github.com/torrentpier/torrentpier/pull/1641), [\#1651](https://github.com/torrentpier/torrentpier/pull/1651), [\#1658](https://github.com/torrentpier/torrentpier/pull/1658), [\#1674](https://github.com/torrentpier/torrentpier/pull/1674), [\#1675](https://github.com/torrentpier/torrentpier/pull/1675), [\#1676](https://github.com/torrentpier/torrentpier/pull/1676), [\#1679](https://github.com/torrentpier/torrentpier/pull/1679), [\#1681](https://github.com/torrentpier/torrentpier/pull/1681), [\#1683](https://github.com/torrentpier/torrentpier/pull/1683) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1570](https://github.com/torrentpier/torrentpier/pull/1570), [\#1571](https://github.com/torrentpier/torrentpier/pull/1571), [\#1575](https://github.com/torrentpier/torrentpier/pull/1575), [\#1589](https://github.com/torrentpier/torrentpier/pull/1589), [\#1592](https://github.com/torrentpier/torrentpier/pull/1592), [\#1605](https://github.com/torrentpier/torrentpier/pull/1605), [\#1611](https://github.com/torrentpier/torrentpier/pull/1611), [\#1612](https://github.com/torrentpier/torrentpier/pull/1612), [\#1615](https://github.com/torrentpier/torrentpier/pull/1615), [\#1627](https://github.com/torrentpier/torrentpier/pull/1627), [\#1633](https://github.com/torrentpier/torrentpier/pull/1633), [\#1641](https://github.com/torrentpier/torrentpier/pull/1641), [\#1651](https://github.com/torrentpier/torrentpier/pull/1651), [\#1658](https://github.com/torrentpier/torrentpier/pull/1658), [\#1674](https://github.com/torrentpier/torrentpier/pull/1674), [\#1675](https://github.com/torrentpier/torrentpier/pull/1675), [\#1676](https://github.com/torrentpier/torrentpier/pull/1676), [\#1679](https://github.com/torrentpier/torrentpier/pull/1679), [\#1681](https://github.com/torrentpier/torrentpier/pull/1681), [\#1683](https://github.com/torrentpier/torrentpier/pull/1683), [\#1685](https://github.com/torrentpier/torrentpier/pull/1685) ([belomaxorka](https://github.com/belomaxorka))
- Updated `modern-normalize` to `v3.0.1` [\#1669](https://github.com/torrentpier/torrentpier/pull/1669) ([belomaxorka](https://github.com/belomaxorka))
- Updated deps [\#1563](https://github.com/torrentpier/torrentpier/pull/1563), [\#1564](https://github.com/torrentpier/torrentpier/pull/1564), [\#1608](https://github.com/torrentpier/torrentpier/pull/1608), [\#1609](https://github.com/torrentpier/torrentpier/pull/1609), [\#1610](https://github.com/torrentpier/torrentpier/pull/1610), [\#1637](https://github.com/torrentpier/torrentpier/pull/1637), [\#1646](https://github.com/torrentpier/torrentpier/pull/1646), [\#1647](https://github.com/torrentpier/torrentpier/pull/1647), [\#1650](https://github.com/torrentpier/torrentpier/pull/1650), [\#1656](https://github.com/torrentpier/torrentpier/pull/1656), [\#1677](https://github.com/torrentpier/torrentpier/pull/1677), [\#1682](https://github.com/torrentpier/torrentpier/pull/1682) ([belomaxorka](https://github.com/belomaxorka))
- New Crowdin updates [\#1569](https://github.com/torrentpier/torrentpier/pull/1569), [\#1572](https://github.com/torrentpier/torrentpier/pull/1572), [\#1573](https://github.com/torrentpier/torrentpier/pull/1573), [\#1574](https://github.com/torrentpier/torrentpier/pull/1574), [\#1588](https://github.com/torrentpier/torrentpier/pull/1588), [\#1590](https://github.com/torrentpier/torrentpier/pull/1590), [\#1600](https://github.com/torrentpier/torrentpier/pull/1600), [\#1601](https://github.com/torrentpier/torrentpier/pull/1601), [\#1606](https://github.com/torrentpier/torrentpier/pull/1606), [\#1607](https://github.com/torrentpier/torrentpier/pull/1607), [\#1625](https://github.com/torrentpier/torrentpier/pull/1625), [\#1626](https://github.com/torrentpier/torrentpier/pull/1626), [\#1629](https://github.com/torrentpier/torrentpier/pull/1629), [\#1630](https://github.com/torrentpier/torrentpier/pull/1630), [\#1631](https://github.com/torrentpier/torrentpier/pull/1631), [\#1632](https://github.com/torrentpier/torrentpier/pull/1632), [\#1639](https://github.com/torrentpier/torrentpier/pull/1639), [\#1640](https://github.com/torrentpier/torrentpier/pull/1640), [\#1654](https://github.com/torrentpier/torrentpier/pull/1654), [\#1655](https://github.com/torrentpier/torrentpier/pull/1655) ([Exileum](https://github.com/Exileum))

View file

@ -63,11 +63,11 @@ if (isset($ffpInfo->streams)) {
if (!empty($stream->codec_name)) {
$result .= sprintf($lang['AUDIO_CODEC'], $stream->codec_long_name, mb_strtoupper($stream->codec_name, 'UTF-8')) . '<br>';
}
if (!empty($stream->bit_rate) && is_int($stream->bit_rate)) {
$result .= sprintf($lang['BITRATE'], humn_bitrate($stream->bit_rate)) . '<br>';
if (!empty($stream->bit_rate)) {
$result .= sprintf($lang['BITRATE'], humn_bitrate((int)$stream->bit_rate)) . '<br>';
}
if (!empty($stream->sample_rate) && is_int($stream->sample_rate)) {
$result .= sprintf($lang['SAMPLE_RATE'], humn_sample_rate($stream->sample_rate)) . '<br>';
if (!empty($stream->sample_rate)) {
$result .= sprintf($lang['SAMPLE_RATE'], humn_sample_rate((int)$stream->sample_rate)) . '<br>';
}
if (!empty($stream->channels)) {
$result .= sprintf($lang['CHANNELS'], $stream->channels) . '<br>';
@ -136,7 +136,14 @@ function humn_bitrate(int $bitrate, string $space = '&nbsp;'): string
*/
function humn_sample_rate(int $sample_rate, string $space = '&nbsp;'): string
{
$unit = '';
if ($sample_rate >= 1000000) {
$unit = 'Mhz';
} elseif ($sample_rate >= 1000) {
$unit = 'kHz';
} else {
$unit = 'Hz';
}
return sprintf('%.1f', commify($sample_rate)) . $space . $unit;
}