Browse Source

MediaCategoryViewController: Request thumbnail only for video

Soomin Lee 5 years ago
parent
commit
33c6ec7a5e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Sources/MediaCategories/MediaCategoryViewController.swift

+ 3 - 1
Sources/MediaCategories/MediaCategoryViewController.swift

@@ -290,7 +290,9 @@ class MediaCategoryViewController: UICollectionViewController, UICollectionViewD
         let mediaObject = isSearching ? searchDataSource.objectAtIndex(index: indexPath.row) : model.anyfiles[indexPath.row]
         let mediaObject = isSearching ? searchDataSource.objectAtIndex(index: indexPath.row) : model.anyfiles[indexPath.row]
         if let media = mediaObject as? VLCMLMedia {
         if let media = mediaObject as? VLCMLMedia {
             // FIXME: This should be done in the VModel, workaround for the release.
             // FIXME: This should be done in the VModel, workaround for the release.
-            services.medialibraryService.requestThumbnail(for: media)
+            if media.type() == .video {
+                services.medialibraryService.requestThumbnail(for: media)
+            }
             assert(media.mainFile() != nil, "The mainfile is nil")
             assert(media.mainFile() != nil, "The mainfile is nil")
             mediaCell.media = media.mainFile() != nil ? media : nil
             mediaCell.media = media.mainFile() != nil ? media : nil
         } else {
         } else {