浏览代码

VLCEditController: Fill cell with VLCMLMedia

Soomin Lee 7 年之前
父节点
当前提交
3f7a8e080c
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      Sources/VLCEditController.swift

+ 5 - 4
Sources/VLCEditController.swift

@@ -63,10 +63,11 @@ extension VLCEditController: UICollectionViewDataSource {
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: VLCMediaViewEditCell.identifier,
                                                          for: indexPath) as? VLCMediaViewEditCell {
-            cell.titleLabel.text = "( `ー´)ノ"
-            cell.subInfoLabel.text = "(-ω-、)"
-            cell.sizeLabel.text = "|ω°•)"
-            cell.thumbnailImageView.image = UIImage(named: "vlc-xmas")
+            if let media = category.anyfiles[indexPath.row] as? VLCMLMedia {
+                cell.titleLabel.text = media.title
+                cell.subInfoLabel.text = media.formatDuration(ofMedia: media)
+                cell.sizeLabel.text = media.formatSize(ofMedia: media)
+            }
             return cell
         }
         return UICollectionViewCell()