Fix remotely deleted feeds not being removed
This commit is contained in:
parent
c89df7604b
commit
ed0a2f1ba3
|
@ -91,6 +91,9 @@ class PersistentContainer: NSPersistentContainer {
|
|||
mo.updateFromServer(feed)
|
||||
}
|
||||
}
|
||||
for removed in existingFeeds where !serverFeeds.contains(where: { $0.id == removed.id }) {
|
||||
self.backgroundContext.delete(removed)
|
||||
}
|
||||
|
||||
if self.backgroundContext.hasChanges {
|
||||
try self.backgroundContext.save()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<attribute name="title" attributeType="String"/>
|
||||
<attribute name="url" optional="YES" attributeType="URI"/>
|
||||
<relationship name="groups" toMany="YES" deletionRule="Nullify" destinationEntity="Group" inverseName="feeds" inverseEntity="Group"/>
|
||||
<relationship name="items" toMany="YES" deletionRule="Nullify" destinationEntity="Item" inverseName="feed" inverseEntity="Item"/>
|
||||
<relationship name="items" toMany="YES" deletionRule="Cascade" destinationEntity="Item" inverseName="feed" inverseEntity="Item"/>
|
||||
</entity>
|
||||
<entity name="Group" representedClassName="Group" syncable="YES">
|
||||
<attribute name="id" attributeType="String"/>
|
||||
|
|
Loading…
Reference in New Issue