Replies: 2 comments
-
That's true, good observation. If I knew for sure that this will definitely keep being the case, I'd love simplified code! Thing is, I'm not Spotify and I can't be sure. Especially looking at other design choices they made (stuffing tracks and episodes in one field, ...) I'd rather not risk doing a big refactor and having to undo it in the case. Not much is currently changing at the api and the existing code does its job... |
Beta Was this translation helpful? Give feedback.
-
That's fair enough. This would definitely require a massive rewrite in one way or another. 😅 |
Beta Was this translation helpful? Give feedback.
-
This isn't a request, so much as it is just a question about how feasible it would be. If the answer is yes, I could see myself making a PR.
So, basically, there are a ton of "simplified" variants of many entities on Spotify. AlbumSimplified, ArtistSimplified, TrackSimplified, PlaylistSimplified, etc. From my own observation, it seems like these are true subsets of their respective "full" versions.
As an example, compare the fields of TrackSimplified to Track:
If you toss away every field that is contained in both variants, this is what you're left with:
As you can see, not a whole lot remains unique to the full object and the simplified doesn't have any unique fields.
So, from a design perspective, I'm not quite sure why the full objects don't simply extend the simplified objects. It seems like a ton of duplicated code for little to no benefit. Unless, of course, there is a reason behind it. Maybe it makes JSON parsing easier or something, I don't know.
Beta Was this translation helpful? Give feedback.
All reactions