Bladeren bron

Cloud services: Add guard for tvOS

Soomin Lee 6 jaren geleden
bovenliggende
commit
534663d0ad

+ 2 - 1
Sources/VLCBoxController.m

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

+ 6 - 1
Sources/VLCDropboxController.m

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

+ 2 - 1
Sources/VLCGoogleDriveController.m

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

+ 6 - 2
Sources/VLCOneDriveController.m

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