SubmarinerApp / Submariner

A Subsonic client for macOS
https://submarinerapp.com
BSD 3-Clause "New" or "Revised" License
122 stars 3 forks source link

Deal with `id` attributes on Core Data objects #167

Closed NattyNarwhal closed 8 months ago

NattyNarwhal commented 8 months ago

A big problem is that the Identifiable Swift protocol on Core Data objects commandeers id as a property. Unfortunately, this means it uses the existing id attribute for our Core Data objects. That tends to be String?, because only items associated with a server have an ID, not local items. This unfortunately massively fowls the semantics of Identifiable for the sake of SwiftUI, where a String? is going to confuse things, especially if it can be nil.

We need to either:

  1. Rename id, at least in Swift, maybe in Objective-C (no @objc(id)) and in the Core Data model (rename attribute, new model version)
  2. Trickery to point Identifiable somewhere else and have Identifiable.id not mess with the existing id.

SBMusicItem and SBPlaylist are affected.