Explorar el Código

MediaCollectionViewCell: Audio: Add album title in description

Soomin Lee hace 5 años
padre
commit
a5a8d91b37
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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()
     }