|
@@ -43,7 +43,7 @@
|
|
|
if (_playlistViewController && url != nil) {
|
|
|
APLog(@"%@ requested %@ to be opened", sourceApplication, url);
|
|
|
|
|
|
- if (url.isFileURL || [url.scheme isEqualToString:@"http"] || [url.scheme isEqualToString:@"https"]) {
|
|
|
+ if (url.isFileURL) {
|
|
|
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"SAVE_FILE", @"") message:[NSString stringWithFormat:NSLocalizedString(@"SAVE_FILE_LONG", @""), url.lastPathComponent] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", @"") otherButtonTitles:NSLocalizedString(@"BUTTON_SAVE", @""), nil];
|
|
|
_tempURL = url;
|
|
|
[alert show];
|
|
@@ -59,14 +59,15 @@
|
|
|
if (buttonIndex == 1) {
|
|
|
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
|
|
NSString *directoryPath = searchPaths[0];
|
|
|
- NSURL *destinationURL = [NSURL URLWithString:[NSString stringWithFormat:@"file://%@/%@", directoryPath, _tempURL.lastPathComponent]];
|
|
|
+ NSURL *destinationURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", directoryPath, _tempURL.lastPathComponent]];
|
|
|
NSError *theError;
|
|
|
[[NSFileManager defaultManager] copyItemAtURL:_tempURL toURL:destinationURL error:&theError];
|
|
|
+ if (theError.code != noErr)
|
|
|
+ APLog(@"saving the file failed (%i): %@", theError.code, theError.localizedDescription);
|
|
|
|
|
|
[self updateMediaList];
|
|
|
- }
|
|
|
-
|
|
|
- [_playlistViewController openMovieFromURL:_tempURL];
|
|
|
+ } else
|
|
|
+ [_playlistViewController openMovieFromURL:_tempURL];
|
|
|
}
|
|
|
|
|
|
- (void)applicationWillResignActive:(UIApplication *)application
|