mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-12 23:34:34 -05:00
Update dependency com.pinterest.ktlint:ktlint-cli to v1.8.0 (#1786)
* Update dependency com.pinterest.ktlint:ktlint-cli to v1.8.0 * Format --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
@@ -44,10 +44,18 @@ object OpdsStringUtil {
|
||||
if (serverConfig.opdsUseBinaryFileSizes.value) {
|
||||
// Binary notation (base 1024)
|
||||
when {
|
||||
size >= 1_125_899_906_842_624 -> "%.2f TiB".format(size / 1_125_899_906_842_624.0) // 1024^4
|
||||
size >= 1_073_741_824 -> "%.2f GiB".format(size / 1_073_741_824.0) // 1024^3
|
||||
size >= 1_048_576 -> "%.2f MiB".format(size / 1_048_576.0) // 1024^2
|
||||
size >= 1024 -> "%.2f KiB".format(size / 1024.0) // 1024
|
||||
// 1024^4
|
||||
size >= 1_125_899_906_842_624 -> "%.2f TiB".format(size / 1_125_899_906_842_624.0)
|
||||
|
||||
// 1024^3
|
||||
size >= 1_073_741_824 -> "%.2f GiB".format(size / 1_073_741_824.0)
|
||||
|
||||
// 1024^2
|
||||
size >= 1_048_576 -> "%.2f MiB".format(size / 1_048_576.0)
|
||||
|
||||
// 1024
|
||||
size >= 1024 -> "%.2f KiB".format(size / 1024.0)
|
||||
|
||||
else -> "$size bytes"
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user