mirror of https://github.com/ksherlock/ample.git
download controller - delete existing file (if it exists) when re-downloading an existing rom.
This commit is contained in:
parent
308b15277c
commit
45fe32893f
|
@ -610,13 +610,16 @@ static NSInteger TaskStatusCode(NSURLSessionTask *task) {
|
||||||
NSURL *dest = [_romFolder URLByAppendingPathComponent: [src lastPathComponent]];
|
NSURL *dest = [_romFolder URLByAppendingPathComponent: [src lastPathComponent]];
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
|
|
||||||
|
/* just in case ... */
|
||||||
|
[fm removeItemAtURL: dest error: NULL];
|
||||||
[fm moveItemAtURL: location toURL: dest error: &error];
|
[fm moveItemAtURL: location toURL: dest error: &error];
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^(void){
|
dispatch_async(dispatch_get_main_queue(), ^(void){
|
||||||
NSMutableDictionary *taskIndex = self->_taskIndex;
|
NSMutableDictionary *taskIndex = self->_taskIndex;
|
||||||
DownloadItem *item = [taskIndex objectForKey: task];
|
DownloadItem *item = [taskIndex objectForKey: task];
|
||||||
|
|
||||||
[item refresh: dest];
|
if (error) [item completeWithError: error];
|
||||||
|
else [item refresh: dest];
|
||||||
});
|
});
|
||||||
|
|
||||||
NSLog(@"%@", src);
|
NSLog(@"%@", src);
|
||||||
|
|
Loading…
Reference in New Issue