From a7a048c3aa3c6f45a65f98c2eec4b9daaf318776 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Mon, 18 Apr 2022 21:20:28 -0700 Subject: [PATCH] update highlight coredata model --- .../CoreDataModel.xcdatamodel/contents | 8 +++++--- .../Sources/Models/DataModels/HighlightDep.swift | 2 +- .../PersistableModels/CachedPDFHighlights.swift | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Models/CoreData/CoreDataModel.xcdatamodeld/CoreDataModel.xcdatamodel/contents b/apple/OmnivoreKit/Sources/Models/CoreData/CoreDataModel.xcdatamodeld/CoreDataModel.xcdatamodel/contents index c15b134f4..b3cb44951 100644 --- a/apple/OmnivoreKit/Sources/Models/CoreData/CoreDataModel.xcdatamodeld/CoreDataModel.xcdatamodel/contents +++ b/apple/OmnivoreKit/Sources/Models/CoreData/CoreDataModel.xcdatamodeld/CoreDataModel.xcdatamodel/contents @@ -2,10 +2,10 @@ - + @@ -24,6 +24,7 @@ + @@ -36,6 +37,7 @@ + @@ -86,11 +88,11 @@ + + - - \ No newline at end of file diff --git a/apple/OmnivoreKit/Sources/Models/DataModels/HighlightDep.swift b/apple/OmnivoreKit/Sources/Models/DataModels/HighlightDep.swift index affd5863b..67e73bfda 100644 --- a/apple/OmnivoreKit/Sources/Models/DataModels/HighlightDep.swift +++ b/apple/OmnivoreKit/Sources/Models/DataModels/HighlightDep.swift @@ -39,7 +39,7 @@ public struct HighlightDep: Identifiable, Hashable, Codable { public func toManagedObject(context: NSManagedObjectContext, associatedItemID: String) -> Highlight { let highlight = Highlight(context: context) - highlight.associatedItemId = associatedItemID + highlight.linkedItemId = associatedItemID highlight.markedForDeletion = false highlight.id = id highlight.shortId = shortId diff --git a/apple/OmnivoreKit/Sources/Services/Persistence/PersistableModels/CachedPDFHighlights.swift b/apple/OmnivoreKit/Sources/Services/Persistence/PersistableModels/CachedPDFHighlights.swift index f4b7ae9da..b036a6b8c 100644 --- a/apple/OmnivoreKit/Sources/Services/Persistence/PersistableModels/CachedPDFHighlights.swift +++ b/apple/OmnivoreKit/Sources/Services/Persistence/PersistableModels/CachedPDFHighlights.swift @@ -7,7 +7,7 @@ public extension DataService { func cachedHighlights(pdfID: String) -> [HighlightDep] { let fetchRequest: NSFetchRequest = Highlight.fetchRequest() fetchRequest.predicate = NSPredicate( - format: "associatedItemId = %@ AND markedForDeletion = %@", pdfID, false + format: "linkedItemId = %@ AND markedForDeletion = %@", pdfID, false ) let highlights = (try? persistentContainer.viewContext.fetch(fetchRequest)) ?? []