[vlc-commits] [Git][videolan/vlc][master] 8 commits: macosx: Rename colelction view item secondary text field from...

François Cartegnie (@fcartegnie) gitlab at videolan.org
Tue Dec 27 09:34:33 UTC 2022



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
dcd0bcfd by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Rename colelction view item secondary text field from durationTextField to secondaryInfoTextField

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
2cb96bf8 by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Use detail string for secondary string in library collection view items instead of duration

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e912ff2a by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Ensure VLCMediaLibraryMediaItem delivers empty NSString as fallback rather than nil

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
1c3d9058 by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Only fetch and check artist for VLCMediaLibraryMediaItem if media library item subtype is album track

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
1b1dd617 by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Return duration string as VLCMediaLibraryMediaItem detailString as fallback

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d0c47736 by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Add specialised detail strings for each media library media item sub type

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
1b21ad17 by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Make VLCMediaLibraryArtist detailString return durationString

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
485c3f02 by Claudio Cambra at 2022-12-27T09:19:18+00:00
macosx: Make VLCMediaLibraryGenre detailString the same as durationString, as they were practically the same

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


4 changed files:

- modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
- modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
- modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
- modules/gui/macosx/library/VLCLibraryDataTypes.m


Changes:

=====================================
modules/gui/macosx/UI/VLCLibraryCollectionViewItem.xib
=====================================
@@ -9,7 +9,7 @@
             <connections>
                 <outlet property="addToPlaylistButton" destination="Ubz-8I-W2F" id="k0q-b1-PZi"/>
                 <outlet property="annotationTextField" destination="tm2-NW-WsZ" id="Miy-RS-Rol"/>
-                <outlet property="durationTextField" destination="VAn-gF-QiZ" id="U8T-Cs-HaL"/>
+                <outlet property="secondaryInfoTextField" destination="VAn-gF-QiZ" id="U8T-Cs-HaL"/>
                 <outlet property="highlightBox" destination="Vwd-1n-Sbd" id="h1g-hL-1gh"/>
                 <outlet property="mediaImageView" destination="2aB-sB-hfY" id="Sv0-G1-KNm"/>
                 <outlet property="mediaTitleTextField" destination="OBS-Eh-1mT" id="h1n-PU-IAx"/>


=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewItem.h
=====================================
@@ -35,7 +35,7 @@ extern NSString *VLCLibraryCellIdentifier;
 @property (readwrite, assign) IBOutlet NSTextField *mediaTitleTextField;
 @property (readwrite, assign) IBOutlet NSTextField *annotationTextField;
 @property (readwrite, assign) IBOutlet NSTextField *unplayedIndicatorTextField;
- at property (readwrite, assign) IBOutlet NSTextField *durationTextField;
+ at property (readwrite, assign) IBOutlet NSTextField *secondaryInfoTextField;
 @property (readwrite, assign) IBOutlet VLCImageView *mediaImageView;
 @property (readwrite, assign) IBOutlet NSButton *playInstantlyButton;
 @property (readwrite, assign) IBOutlet NSButton *addToPlaylistButton;


=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
=====================================
@@ -76,7 +76,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 - (void)awakeFromNib
 {
     [(VLCTrackingView *)self.view setViewToHide:self.playInstantlyButton];
-    self.durationTextField.textColor = [NSColor VLClibrarySubtitleColor];
+    self.secondaryInfoTextField.textColor = [NSColor VLClibrarySubtitleColor];
     self.annotationTextField.font = [NSFont VLClibraryCellAnnotationFont];
     self.annotationTextField.textColor = [NSColor VLClibraryAnnotationColor];
     self.annotationTextField.backgroundColor = [NSColor VLClibraryAnnotationBackgroundColor];
@@ -116,10 +116,10 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
 {
     if (config_GetInt("macosx-large-text")) {
         self.mediaTitleTextField.font = [NSFont VLClibraryLargeCellTitleFont];
-        self.durationTextField.font = [NSFont VLClibraryLargeCellSubtitleFont];
+        self.secondaryInfoTextField.font = [NSFont VLClibraryLargeCellSubtitleFont];
     } else {
         self.mediaTitleTextField.font = [NSFont VLClibrarySmallCellTitleFont];
-        self.durationTextField.font = [NSFont VLClibrarySmallCellSubtitleFont];
+        self.secondaryInfoTextField.font = [NSFont VLClibrarySmallCellSubtitleFont];
     }
 }
 
@@ -130,7 +130,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
     [super prepareForReuse];
     _playInstantlyButton.hidden = YES;
     _mediaTitleTextField.stringValue = @"";
-    _durationTextField.stringValue = [NSString stringWithTime:0];
+    _secondaryInfoTextField.stringValue = [NSString stringWithTime:0];
     _mediaImageView.image = nil;
     _annotationTextField.hidden = YES;
     _progressIndicator.hidden = YES;
@@ -175,7 +175,7 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
     }
 
     _mediaTitleTextField.stringValue = _representedItem.displayString;
-    _durationTextField.stringValue = _representedItem.durationString;
+    _secondaryInfoTextField.stringValue = _representedItem.detailString;
     _mediaImageView.image = _representedItem.smallArtworkImage;
 
     // TODO: Add handling for the other types


=====================================
modules/gui/macosx/library/VLCLibraryDataTypes.m
=====================================
@@ -307,7 +307,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
 
 - (NSString *)detailString
 {
-    return nil;
+    return [self durationString];
 }
 
 - (NSString *)durationString
@@ -498,7 +498,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
 
 - (NSString *)detailString
 {
-    return [NSString stringWithFormat:_NS("%lli items"), _numberOfTracks];
+    return [self durationString];
 }
 
 - (NSString *)durationString
@@ -810,12 +810,27 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
 
 - (NSString *)detailString
 {
-    VLCMediaLibraryArtist *artist = [VLCMediaLibraryArtist artistWithID:_artistID];
-    if (artist) {
-        return artist.name;
+   if (_mediaSubType == VLC_ML_MEDIA_SUBTYPE_SHOW_EPISODE) {
+        VLCInputItem *inputItem = [self inputItem];
+        if (inputItem) {
+            NSString *showName = inputItem.showName;
+            return showName.length > 0 ? showName : [self durationString];
+        }
+   } else if (_mediaSubType == VLC_ML_MEDIA_SUBTYPE_MOVIE) {
+        VLCInputItem *inputItem = [self inputItem];
+        if (inputItem) {
+            NSString *directorString = inputItem.director;
+            return directorString.length > 0 ? directorString : [self durationString];
+        }
+    } else if (_mediaSubType == VLC_ML_MEDIA_SUBTYPE_ALBUMTRACK) {
+        VLCMediaLibraryArtist *artist = [VLCMediaLibraryArtist artistWithID:_artistID];
+        if (artist) {
+            NSString *artistName = artist.name;
+            return artistName.length > 0 ? artistName : [self durationString];
+        }
     }
 
-    return nil;
+    return [self durationString];
 }
 
 - (NSString *)durationString



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e3b28612d38f925d92f9d7fd45ee6b337fe2dfe5...485c3f02f5a75f574f4e1ba7fc68674cf5bf5baf

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e3b28612d38f925d92f9d7fd45ee6b337fe2dfe5...485c3f02f5a75f574f4e1ba7fc68674cf5bf5baf
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list