Store size for media for safer indentification

This commit is contained in:
Matthias Neeracher 2011-08-16 04:16:24 +02:00
parent 7bf30dc43e
commit 41beabba04

View File

@ -45,10 +45,14 @@
NSManagedObjectContext *moc = [self managedObjectContext];
MAMedia * media = [NSEntityDescription insertNewObjectForEntityForName:@"MAMedia" inManagedObjectContext:moc];
NSString * path = [url path];
NSNumber * size;
[url getResourceValue:&size forKey:NSURLFileSizeKey error:nil];
media.media = path;
media.date = [date timeIntervalSinceReferenceDate];
media.name = name;
media.notes = @"";
media.size = size ? [size longLongValue] : 0;
}
#pragma mark Annotation management