Skip to content

Commit

Permalink
fix(app/Sanitizer): Update file size formatting
Browse files Browse the repository at this point in the history
- Updated the file size formatting function in the Sanitizer trait
- Added precision parameter to Number::fileSize method for accurate formatting
  • Loading branch information
guanguans committed Jul 12, 2024
1 parent bebe5f4 commit f503865
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Concerns/Sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function sanitize(array $song, string $keyword): array
$song['name'] = str_replace($keyword, "<fg=red;options=bold>$keyword</>", (string) $song['name']);
$song['artist'] = str_replace($keyword, "<fg=red;options=bold>$keyword</>", implode(',', $song['artist']));
$song['album'] = str_replace($keyword, "<fg=red;options=bold>$keyword</>", (string) $song['album']);
$song['size'] = isset($song['size']) ? sprintf('<fg=yellow>%s</>', Number::fileSize((float) $song['size'])) : null;
$song['size'] = isset($song['size']) ? sprintf('<fg=yellow>%s</>', Number::fileSize((float) $song['size'], 1)) : null;
$song['br'] = (int) $song['br'];

return $song;
Expand Down

0 comments on commit f503865

Please sign in to comment.