Change web feed key to be an md5 has of the url.

This commit is contained in:
Maurice Parker 2020-04-04 13:36:54 -05:00
parent 71b5c8bc86
commit 231e3a12e2
1 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,8 @@ final class CloudKitAccountZone: CloudKitZone {
/// Persist a web feed record to iCloud and return the external key
func createWebFeed(url: String, editedName: String?, container: Container, completion: @escaping (Result<String, Error>) -> Void) {
let record = CKRecord(recordType: CloudKitWebFeed.recordType, recordID: generateRecordID())
let recordID = CKRecord.ID(recordName: url.md5String, zoneID: Self.zoneID)
let record = CKRecord(recordType: CloudKitWebFeed.recordType, recordID: recordID)
record[CloudKitWebFeed.Fields.url] = url
if let editedName = editedName {
record[CloudKitWebFeed.Fields.editedName] = editedName