Browse Source

MediaCollectionViewCell: Audio: Add album title in description

Soomin Lee 5 years ago
parent
commit
a5a8d91b37
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Sources/MediaCategoryCells/MediaCollectionViewCell.swift

+ 5 - 1
Sources/MediaCategoryCells/MediaCollectionViewCell.swift

@@ -84,7 +84,11 @@ class MediaCollectionViewCell: BaseCollectionViewCell {
     func update(audiotrack: VLCMLMedia) {
         titleLabel.text = audiotrack.title()
         accessibilityLabel = audiotrack.accessibilityText(editing: false)
-        descriptionLabel.text = audiotrack.albumTrackArtistName()
+        var descriptionText = audiotrack.albumTrackArtistName()
+        if let albumTitle = audiotrack.albumTrack?.album?.title, !albumTitle.isEmpty {
+            descriptionText += " - " + albumTitle
+        }
+        descriptionLabel.text = descriptionText
         newLabel.isHidden = !audiotrack.isNew
         thumbnailView.image = audiotrack.thumbnailImage()
     }