Commit da74fe8d authored by Felix Paul Kühne's avatar Felix Paul Kühne

Deploy NSByteCountFormatter instead of calculating file sizes ourselves as...

Deploy NSByteCountFormatter instead of calculating file sizes ourselves as this results in a more appealing appearance
parent c249af5d
......@@ -206,7 +206,7 @@
else
mediaSize = [mediaItem.size longLongValue];
[cell setSubtitle: [NSString stringWithFormat:@"%0.2f MB (%@)", (float)(mediaSize / 1e6), mediaItem.duration]];
[cell setSubtitle: [NSString stringWithFormat:@"%@ (%@)", [NSByteCountFormatter stringFromByteCount:mediaSize countStyle:NSByteCountFormatterCountStyleFile], mediaItem.duration]];
[cell setIsDirectory:NO];
cell.isDownloadable = YES;
if (![mediaItem.albumArt isEqualToString:NULL]) {
......
......@@ -218,7 +218,7 @@
VLCPlaylistViewController *delegate = (VLCPlaylistViewController*)self.collectionView.delegate;
if (delegate.isEditing)
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[mediaFile duration]], (int)([mediaFile fileSizeInBytes] / 1e6)];
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]];
else {
self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[mediaFile duration]]];
if (mediaFile.videoTrack) {
......
......@@ -224,7 +224,7 @@
self.titleLabel.text = mediaFile.title;
if (self.isEditing)
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %i MB", [VLCTime timeWithNumber:[mediaFile duration]], (int)([mediaFile fileSizeInBytes] / 1e6)];
self.subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[mediaFile duration]], [NSByteCountFormatter stringFromByteCount:[mediaFile fileSizeInBytes] countStyle:NSByteCountFormatterCountStyleFile]];
else {
self.subtitleLabel.text = [NSString stringWithFormat:@"%@", [VLCTime timeWithNumber:[mediaFile duration]]];
if (mediaFile.videoTrack) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment