Procházet zdrojové kódy

MediaCollectionViewCell: Audio: Add album title in description

Soomin Lee před 5 roky
rodič
revize
a5a8d91b37

+ 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()
     }