Bläddra i källkod

CloudServices: Post NewFileAdded notification

Soomin Lee 7 år sedan
förälder
incheckning
d5f0eddd68

+ 3 - 0
Sources/VLCBoxController.m

@@ -302,6 +302,9 @@
     APLog(@"BoxFile download was successful");
     UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
     [[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
+    // FIXME: Replace notifications by cleaner observers
+    [[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.VLCNewFileAddedNotification
+                                                        object:self];
 
     if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
         [self.delegate operationWithProgressInformationStopped];

+ 4 - 0
Sources/VLCDropboxController.m

@@ -17,6 +17,7 @@
 #import "VLCActivityManager.h"
 #import "VLCMediaFileDiscoverer.h"
 #import "VLCDropboxConstants.h"
+#import "VLC-Swift.h"
 
 @interface VLCDropboxController ()
 
@@ -243,6 +244,9 @@
                 [self.delegate operationWithProgressInformationStopped];
             }
 
+            // FIXME: Replace notifications by cleaner observers
+            [[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.VLCNewFileAddedNotification
+                                                                object:self];
             self.downloadInProgress = NO;
             [self _triggerNextDownload];
             if (networkError) {

+ 3 - 0
Sources/VLCGoogleDriveController.m

@@ -356,6 +356,9 @@
     APLog(@"DriveFile download was successful");
     UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, NSLocalizedString(@"GDRIVE_DOWNLOAD_SUCCESSFUL", nil));
     [[VLCMediaFileDiscoverer sharedInstance] performSelectorOnMainThread:@selector(updateMediaList) withObject:nil waitUntilDone:NO];
+    // FIXME: Replace notifications by cleaner observers
+    [[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.VLCNewFileAddedNotification
+                                                        object:self];
 
     if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
         [self.delegate operationWithProgressInformationStopped];

+ 5 - 0
Sources/VLCOneDriveController.m

@@ -21,6 +21,8 @@
 #import "LiveApiHelper.h"
 #import "LiveAuthStorage.h"
 
+#import "VLC-Swift.h"
+
 @interface VLCOneDriveController () <LiveAuthDelegate, VLCOneDriveObjectDelegate, VLCOneDriveObjectDownloadDelegate>
 {
     LiveConnectClient *_liveClient;
@@ -267,6 +269,9 @@
 
     if ([self.delegate respondsToSelector:@selector(operationWithProgressInformationStopped)])
         [self.delegate operationWithProgressInformationStopped];
+    // FIXME: Replace notifications by cleaner observers
+    [[NSNotificationCenter defaultCenter] postNotificationName:NSNotification.VLCNewFileAddedNotification
+                                                        object:self];
 
     _downloadInProgress = NO;
     [self _triggerNextDownload];