Commit 98e4fda6 authored by Soomin Lee's avatar Soomin Lee

VLCPlaylistCollectionViewCell: Handle formatting inside modelview

parent 831ead30
......@@ -36,3 +36,12 @@ extension VideoModel: MediaLibraryObserver {
updateView?()
}
}
extension VLCMLMedia {
@objc func formatDuration(ofMedia media: VLCMLMedia) -> String {
return String(format: "%@ - %@",
VLCTime(int: Int32(media.duration())),
ByteCountFormatter.string(fromByteCount: Int64(media.mainFile().size()),
countStyle: .file))
}
}
......@@ -16,8 +16,7 @@
#import "VLCPlaylistCollectionViewCell.h"
#import "VLCThumbnailsCache.h"
#import "NSString+SupportedMedia.h"
#import <VLCMediaLibraryKit/VLCMLFile.h>
#import "VLC-Swift.h"
@interface VLCPlaylistCollectionViewCell ()
{
......@@ -211,9 +210,7 @@
- (void)_updateDisplayedInformations
{
_titleLabel.text = _media.title;
_subtitleLabel.text = [NSString stringWithFormat:@"%@ — %@", [VLCTime timeWithNumber:[NSNumber numberWithLongLong:_media.duration]],
[NSByteCountFormatter stringFromByteCount:[_media.mainFile size] countStyle:NSByteCountFormatterCountStyleFile]];
_subtitleLabel.text = [_media formatDurationOfMedia:_media];
}
- (void)_updatedDisplayedInformationForKeyPath:(NSString *)keyPath
......
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