[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Remove debug logging from VLCSettingTextField

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jul 11 05:33:34 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
11a861bb by Claudio Cambra at 2023-07-11T05:13:27+00:00
macosx: Remove debug logging from VLCSettingTextField

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

- - - - -
ae20c0fd by Claudio Cambra at 2023-07-11T05:13:27+00:00
macosx: Update relevant media library folders when modifying input item(s)

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

- - - - -
f68058b8 by Claudio Cambra at 2023-07-11T05:13:27+00:00
macosx: Don't check modified input items if they have already been checked for media library folder refresh

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

- - - - -
89603efc by Claudio Cambra at 2023-07-11T05:13:27+00:00
macosx: Extract post-save metadata library folder reload to different method

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

- - - - -


2 changed files:

- modules/gui/macosx/panels/VLCInformationWindowController.m
- modules/gui/macosx/views/VLCSettingTextField.m


Changes:

=====================================
modules/gui/macosx/panels/VLCInformationWindowController.m
=====================================
@@ -26,7 +26,9 @@
 #import "extensions/NSString+Helpers.h"
 
 #import "library/VLCInputItem.h"
+#import "library/VLCLibraryController.h"
 #import "library/VLCLibraryImageCache.h"
+#import "library/VLCLibraryModel.h"
 
 #import "main/VLCMain.h"
 
@@ -478,6 +480,33 @@ settingsChanged = settingsChanged || _##field##TextField.settingChanged;
     _saveMetaDataButton.enabled = settingsChanged;
 }
 
+- (void)reloadMediaLibraryFoldersForInputItems:(NSArray<VLCInputItem *> *)inputItems
+{
+    VLCLibraryController * const libraryController = VLCMain.sharedInstance.libraryController;
+    NSArray<VLCMediaLibraryEntryPoint *> * const entryPoints = libraryController.libraryModel.listOfMonitoredFolders;
+    NSMutableSet<NSString *> * const reloadMRLs = NSMutableSet.set;
+    NSMutableSet<VLCInputItem *> * const checkedInputItems = NSMutableSet.set;
+
+    for (VLCMediaLibraryEntryPoint * const entryPoint in entryPoints) {
+        for (VLCInputItem * const inputItem in inputItems) {
+            if ([checkedInputItems containsObject:inputItem]) {
+                continue;
+            }
+
+            if ([inputItem.MRL hasPrefix:entryPoint.MRL]) {
+                [reloadMRLs addObject:entryPoint.MRL];
+                [checkedInputItems addObject:inputItem];
+                break;
+            }
+        }
+    }
+
+    for (NSString * const entryPointMRL in reloadMRLs) {
+        NSURL * const entryPointURL = [NSURL URLWithString:entryPointMRL];
+        [libraryController reloadFolderWithFileURL:entryPointURL];
+    }
+}
+
 - (void)saveInputItemsMetadata:(NSArray<VLCInputItem *> *)inputItems
 {
     NSParameterAssert(inputItems);
@@ -508,6 +537,7 @@ SET_INPUTITEM_PROP(field, field)                \
 #undef SET_INPUTITEM_PROP
     
     [self updateRepresentation];
+    [self reloadMediaLibraryFoldersForInputItems:inputItems];
 }
 
 - (IBAction)saveMetaData:(id)sender


=====================================
modules/gui/macosx/views/VLCSettingTextField.m
=====================================
@@ -39,7 +39,6 @@
 - (void)textDidChange:(NSNotification *)notification
 {
     _settingChanged = ![self.stringValue isEqualToString:self.originalStateString];
-    NSLog(@"text changed bruh %@ %@ %i", self.stringValue, _originalStateString, _settingChanged);
     [super textDidChange:notification];
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/307fbf6378f3b9ec6aa9d8392bdfe523ada1be4c...89603efce06e7bf431e0bbe74ba11618d7449e91

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/307fbf6378f3b9ec6aa9d8392bdfe523ada1be4c...89603efce06e7bf431e0bbe74ba11618d7449e91
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