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

http upload: clean cache prior to starting a new instance to addition to cache...

http upload: clean cache prior to starting a new instance to addition to cache cleaning on app launch
parent 8ccd71ed
......@@ -29,6 +29,8 @@
- (void)disableIdleTimer;
- (void)activateIdleTimer;
- (void)cleanCache;
- (void)openMediaFromManagedObject:(NSManagedObject *)file;
- (void)openMovieFromURL:(NSURL *)url;
- (void)openMediaList:(VLCMediaList*)list atIndex:(int)index;
......
......@@ -66,11 +66,7 @@
[quincyManager startManager];
/* clean caches on launch (since those are used for wifi upload only) */
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString* uploadDirPath = [searchPaths[0] stringByAppendingPathComponent:@"Upload"];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:uploadDirPath])
[fileManager removeItemAtPath:uploadDirPath error:nil];
[self cleanCache];
// Init the HTTP Server
self.uploadController = [[VLCHTTPUploaderController alloc] init];
......@@ -228,6 +224,15 @@
[_playlistViewController updateViewContents];
}
- (void)cleanCache
{
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString* uploadDirPath = [searchPaths[0] stringByAppendingPathComponent:@"Upload"];
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:uploadDirPath])
[fileManager removeItemAtPath:uploadDirPath error:nil];
}
#pragma mark - media list methods
- (NSString *)directoryPath
......
......@@ -70,6 +70,9 @@
[self.httpServer stop];
return true;
}
// clean cache before accepting new stuff
[(VLCAppDelegate *)[UIApplication sharedApplication].delegate cleanCache];
// Initialize our http server
_httpServer = [[HTTPServer alloc] init];
[_httpServer setInterface:WifiInterfaceName];
......
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