[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: Acquire finder tags in VLCInputItem and expose through property

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Jul 13 20:11:14 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
daba199a by Claudio Cambra at 2026-07-13T21:54:47+02:00
macosx: Acquire finder tags in VLCInputItem and expose through property

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

- - - - -
febd33e4 by Claudio Cambra at 2026-07-13T21:54:47+02:00
macosx: Present tags in media source collection view items

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

- - - - -
83b90a52 by Claudio Cambra at 2026-07-13T21:54:47+02:00
macosx: Present tags in list view mode for local files in media source

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

- - - - -


5 changed files:

- modules/gui/macosx/UI/VLCLibraryWindow.xib
- modules/gui/macosx/library/VLCInputItem.h
- modules/gui/macosx/library/VLCInputItem.m
- modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m
- modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m


Changes:

=====================================
modules/gui/macosx/UI/VLCLibraryWindow.xib
=====================================
@@ -1134,6 +1134,38 @@
                                             </tableCellView>
                                         </prototypeCellViews>
                                     </tableColumn>
+                                    <tableColumn identifier="VLCMediaSourceTableTagsColumn" width="150" minWidth="50" maxWidth="3.4028234663852886e+38" id="tagsColumnID">
+                                        <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Tags">
+                                            <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        </tableHeaderCell>
+                                        <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="tagsCellID">
+                                            <font key="font" metaFont="system"/>
+                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                            <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                        </textFieldCell>
+                                        <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+                                        <prototypeCellViews>
+                                            <tableCellView id="tagsViewCellID">
+                                                <rect key="frame" x="706" y="1" width="150" height="17"/>
+                                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                <subviews>
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tagsTextFieldID">
+                                                        <rect key="frame" x="0.0" y="0.0" width="150" height="16"/>
+                                                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+                                                        <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="tagsTextCellCellID">
+                                                            <font key="font" usesAppearanceFont="YES"/>
+                                                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+                                                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                                        </textFieldCell>
+                                                    </textField>
+                                                </subviews>
+                                                <connections>
+                                                    <outlet property="textField" destination="tagsTextFieldID" id="tagsTextFieldOutletID"/>
+                                                </connections>
+                                            </tableCellView>
+                                        </prototypeCellViews>
+                                    </tableColumn>
                                 </tableColumns>
                             </tableView>
                         </subviews>


=====================================
modules/gui/macosx/library/VLCInputItem.h
=====================================
@@ -78,6 +78,7 @@ extern NSString * const VLCInputItemCommonDataDifferingFlagString;
 @property (readonly) BOOL isStream;
 @property (readonly, nullable) NSArray<NSString *> *options;
 @property (readonly) NSArray<NSString *> *extraMetaNames;
+ at property (readonly, nullable) NSArray<NSString *> *finderTags;
 
 - (nullable NSString *)extraMetaForKey:(NSString *)key;
 


=====================================
modules/gui/macosx/library/VLCInputItem.m
=====================================
@@ -571,6 +571,21 @@ static const struct input_item_parser_cbs_t parserCallbacks =
     return options.copy;
 }
 
+- (nullable NSArray<NSString *> *)finderTags
+{
+    NSString * const mrl = self.MRL;
+    if (![mrl hasPrefix:@"file://"]) {
+        return nil;
+    }
+    NSURL * const url = [NSURL URLWithString:mrl];
+    if (!url) {
+        return nil;
+    }
+    NSArray<NSString *> *tags = nil;
+    [url getResourceValue:&tags forKey:NSURLTagNamesKey error:nil];
+    return tags;
+}
+
 @end
 
 


=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m
=====================================
@@ -48,6 +48,12 @@ NSString *VLCMediaSourceCollectionViewItemIdentifier = @"VLCMediaSourceCollectio
 
 @implementation VLCMediaSourceCollectionViewItem
 
+- (instancetype)initWithNibName:(NSNibName)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+{
+    self = [super initWithNibName:@"VLCMediaItemCollectionViewItem" bundle:nibBundleOrNil];
+    return self;
+}
+
 - (void)setRepresentedItem:(VLCInputItem *)representedItem
 {
     if (_representedItem == representedItem) {
@@ -93,6 +99,14 @@ NSString *VLCMediaSourceCollectionViewItemIdentifier = @"VLCMediaSourceCollectio
         }
         strongSelf.mediaImageView.image = thumbnail;
     }];
+
+    NSArray<NSString *> *tags = inputItem.finderTags;
+    if (tags.count > 0) {
+        self.secondaryInfoTextField.stringValue = [tags componentsJoinedByString:@", "];
+        self.secondaryInfoTextField.hidden = NO;
+    } else {
+        self.secondaryInfoTextField.hidden = YES;
+    }
 }
 
 #pragma mark - actions


=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceDataSource.m
=====================================
@@ -401,6 +401,22 @@ NSString * const VLCMediaSourceDataSourceLoadingEnded = @"VLCMediaSourceDataSour
                 break;
         }
         cellView.textField.stringValue = typeName;
+    } else if ([tableColumn.identifier isEqualToString:@"VLCMediaSourceTableTagsColumn"]) {
+        static NSString * const basicCellViewIdentifier = @"BasicTableCellViewIdentifier";
+        NSTableCellView *cellView = [tableView makeViewWithIdentifier:basicCellViewIdentifier
+                                                                owner:self];
+        if (cellView == nil) {
+            cellView = [NSTableCellView tableCellViewWithIdentifier:basicCellViewIdentifier
+                                                      showingString:@""];
+        }
+
+        NSArray<NSString *> * const tags = inputNode.inputItem.finderTags;
+        if (tags.count > 0) {
+            cellView.textField.stringValue = [tags componentsJoinedByString:@", "];
+        } else {
+            cellView.textField.stringValue = @"";
+        }
+        return cellView;
     }
     return cellView;
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b1a44a4da2fc55ddb7796141c19e38838354dbe6...83b90a52c017f82b04193ac40ef0eb254a7d143e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b1a44a4da2fc55ddb7796141c19e38838354dbe6...83b90a52c017f82b04193ac40ef0eb254a7d143e
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list