diff --git a/OpenStack Summit/CoreSummit/CoreDataExtensions.swift b/OpenStack Summit/CoreSummit/CoreDataExtensions.swift index be1b5dfd..e8085650 100644 --- a/OpenStack Summit/CoreSummit/CoreDataExtensions.swift +++ b/OpenStack Summit/CoreSummit/CoreDataExtensions.swift @@ -119,6 +119,12 @@ public extension NSManagedObjectContext { return (try self.executeFetchRequest(fetchRequest) as! [NSNumber]).first!.integerValue } + @inline(__always) + func count(managedObjectType: ManagedObject.Type, predicate: CoreSummit.Predicate) throws -> Int { + + return try count(managedObjectType, predicate: predicate.toFoundation()) + } + /// Save and attempt to recover from validation errors func validateAndSave(fileName: String = #file, _ lineNumber: Int = #line) throws { diff --git a/OpenStack Summit/CoreSummit/DataUpdate.swift b/OpenStack Summit/CoreSummit/DataUpdate.swift index 979be2ff..6da0646d 100644 --- a/OpenStack Summit/CoreSummit/DataUpdate.swift +++ b/OpenStack Summit/CoreSummit/DataUpdate.swift @@ -91,7 +91,10 @@ public extension DataUpdate { case .PresentationCategoryGroup, .PrivatePresentationCategoryGroup: return CoreSummit.TrackGroupDataUpdate.self case .SummitLocationMap, .SummitLocationImage: return CoreSummit.Image.self case .SummitWIFIConnection: return CoreSummit.WirelessNetwork.self - + case .PresentationVideo: return CoreSummit.Video.self + case .PresentationSlide: return CoreSummit.Slide.self + case .PresentationLink: return CoreSummit.Link.self + default: return nil } } @@ -315,3 +318,6 @@ extension TrackGroupDataUpdate: Updatable { } extension Image: Updatable { } extension GroupEventDataUpdate: Updatable { } extension WirelessNetwork: Updatable { } +extension Video: Updatable { } +extension Slide: Updatable { } +extension Link: Updatable { } diff --git a/OpenStack Summit/CoreSummit/Event.swift b/OpenStack Summit/CoreSummit/Event.swift index 4aa4bfb9..3ae0a166 100644 --- a/OpenStack Summit/CoreSummit/Event.swift +++ b/OpenStack Summit/CoreSummit/Event.swift @@ -50,6 +50,10 @@ public struct Event: Named { public var videos: Set