Commit 41836cab authored by Carola Nitz's avatar Carola Nitz

Media and MovieCell: Check for optimizeItemName and remove extension accordingly

(closes #485)
parent 17e5a279
......@@ -60,7 +60,11 @@ class MediaCollectionViewCell: BaseCollectionViewCell {
}
func update(audiotrack: VLCMLMedia) {
titleLabel.text = audiotrack.title
var title = audiotrack.title
if UserDefaults.standard.bool(forKey: kVLCOptimizeItemNamesForDisplay) == true {
title = (title as NSString).deletingPathExtension
}
titleLabel.text = title
accessibilityLabel = audiotrack.accessibilityText(editing: false)
descriptionLabel.text = audiotrack.albumTrackArtistName()
newLabel.isHidden = !audiotrack.isNew
......@@ -84,7 +88,11 @@ class MediaCollectionViewCell: BaseCollectionViewCell {
}
func update(movie: VLCMLMedia) {
titleLabel.text = movie.title
var title = movie.title
if UserDefaults.standard.bool(forKey: kVLCOptimizeItemNamesForDisplay) == true {
title = (title as NSString).deletingPathExtension
}
titleLabel.text = title
accessibilityLabel = movie.accessibilityText(editing: false)
descriptionLabel.text = movie.mediaDuration()
if movie.isThumbnailGenerated() {
......
......@@ -58,7 +58,11 @@ class MovieCollectionViewCell: BaseCollectionViewCell {
}
func update(movie: VLCMLMedia) {
titleLabel.text = movie.title
var title = movie.title
if UserDefaults.standard.bool(forKey: kVLCOptimizeItemNamesForDisplay) == true {
title = (title as NSString).deletingPathExtension
}
titleLabel.text = title
accessibilityLabel = movie.accessibilityText(editing: false)
descriptionLabel.text = movie.mediaDuration()
thumbnailView.image = movie.thumbnailImage()
......
......@@ -18,6 +18,7 @@
#define kVLCSettingPasscodeAllowFaceID @"AllowFaceID"
#define kVLCThemeDidChangeNotification @"themeDidChangeNotfication"
#define kVLCSettingAppTheme @"darkMode"
#define kVLCOptimizeItemNamesForDisplay @"MLDecrapifyTitles"
#define kVLCSettingAbout @"about"
#define kVLCAutomaticallyPlayNextItem @"AutomaticallyPlayNextItem"
#define kVLCSettingContinueAudioInBackgroundKey @"BackgroundAudioPlayback"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment