I can check for playlistItem.track using the weird if case let syntax. I think I can solve problem 2 by adding a computed property in the spotify object. However, I’m not able to get any playlist item data from the api. The last checked-in build on Main (with the old UI) does run correctly, so I’m a bit confused!

Working assumption is the my getCurrentPlayback doesn’t seem to be called anywhere in the new UI version, so I’m trying to figure out where that might be.

  • Aha: in the old version, I was calling .onReceive(timer){spotify.getCurrentPlayback()}
    • Not sure that this is the best option really (reloading the entire top level view every second)
      • Would it be better to: call getCurrentPlayback in spotify(init) and then have a timer running within the spotify object that changes depending on its state (playing, looping, paused, no active player)?

tomorrow:

  • Added getCurrentPlayback to the spotify(init), but I still need a placeholder, or to otherwise deal with the optional Track, as it doesn’t get the Combine Publisher message back before the view appears.

Tags:

Categories:

Updated: