diff --git a/Medianno/MADocument.mm b/Medianno/MADocument.mm index 5422ba4..6bb94b0 100644 --- a/Medianno/MADocument.mm +++ b/Medianno/MADocument.mm @@ -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