Commit c6da1717 authored by Felix Paul Kühne's avatar Felix Paul Kühne

work-around a random file URL bug

parent d9a279b4
......@@ -219,10 +219,12 @@ NSString *kMLFileTypeAudio = @"audio";
/* we need to make sure that current app path is still part of the file
* URL since app upgrades via iTunes or the App Store will change the
* absolute URL of our files (trac #11330) */
if ([ret rangeOfString:[[MLMediaLibrary sharedMediaLibrary] documentFolderPath]].location != NSNotFound)
NSString *documentFolderPath = [[MLMediaLibrary sharedMediaLibrary] documentFolderPath];
if ([ret rangeOfString:documentFolderPath].location != NSNotFound)
return ret;
ret = [[[MLMediaLibrary sharedMediaLibrary] documentFolderPath] stringByAppendingPathComponent:[ret lastPathComponent]];
ret = [NSString stringWithFormat:@"%@/%@", documentFolderPath, [ret lastPathComponent]];
APLog(@"returning modified URL! will return %@", ret);
return ret;
}
......
......@@ -169,8 +169,7 @@ static NSString *kDecrapifyTitles = @"MLDecrapifyTitles";
int directory = NSDocumentDirectory;
NSArray *paths = NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES);
NSURL *url = [NSURL fileURLWithPath:paths[0]];
_documentFolderPath = [url absoluteString];
_documentFolderPath = [NSString stringWithFormat:@"file://%@", paths[0]];
return _documentFolderPath;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment