Browse Source

fix search API continuing

Tobias Conradi 9 years ago
parent
commit
19b68fe3a3
1 changed files with 11 additions and 1 deletions
  1. 11 1
      Sources/VLCAppDelegate.m

+ 11 - 1
Sources/VLCAppDelegate.m

@@ -215,7 +215,17 @@ continueUserActivity:(NSUserActivity *)userActivity
         _isComingFromHandoff = YES;
         return YES;
     } else {
-        NSURL *uriRepresentation = dict[@"playingmedia"];
+        NSURL *uriRepresentation = nil;
+        if ([userActivityType isEqualToString:CSSearchableItemActionType]) {
+            uriRepresentation = [NSURL URLWithString:dict[CSSearchableItemActivityIdentifier]];
+        } else {
+            uriRepresentation = dict[@"playingmedia"];
+        }
+
+        if (!uriRepresentation) {
+            return NO;
+        }
+
         NSManagedObject *managedObject = [[MLMediaLibrary sharedMediaLibrary] objectForURIRepresentation:uriRepresentation];
         if (managedObject == nil) {
             APLog(@"%s file not found: %@",__PRETTY_FUNCTION__,userActivity);