[API Request] update/changed timestamp value on all entities #32
Replies: 2 comments 14 replies
-
|
+5000 :) But needs the rest of the API (Sorting and filtering on it) to be really useful and start to offer differential sync to clients. There's also the complexity of knowing the kind of changes that happens. Typically the changedValue can't indicate that a song is removed from the database. Or artists ... There's also indirect changes like an album is changed, but the change is a new artist, you then need to also sync that new artist. And doing differential on every entry to detect those can be highly inefficient. So it to resume it would be nice to extend this to allow proper differential sync for offline first clients. |
Beta Was this translation helpful? Give feedback.
-
|
What does a change mean for non-atomic entities? For an album, has it changed if:
Same for, say, genres, considering constituent albums and tracks? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Type of change
API Clarification
Proposal description
A change timestamp should be added to all entities so that remote clients can determine if their local cache is current without further action.
A change timestamp attribute should also be added to the top level list entity to indicate if any entities in the list have changed. The client can then skip iterating through the list if nothing has changed.
getPlaylists already contains the change attribute for this very reason but it was not added to the other entities.
For example, in the getStarred2 api. A remote client needs to iterate through the albums listed and subsequently call getAlbum to determine if the songs in the album have changed.
getStarred2 returns
Backward compatibility impact
adding as attribute to entity would not break compatibility
Backward compatibility
API details
All entities should contain a "changed" attribute containing a timestamp to reduce network traffic and processing time
Example:
<album id="1987" name="Graceland" artist="Paul Simon" artistId="404" coverArt="al-1987" songCount="22" duration="5173" playCount="180" created="2015-11-20T13:54:17.000Z" starred="2022-11-01T05:04:24.300Z" year="1986" genre="Blues" changed="2023-04-11T13:54:17.000Z"/>
Security impacts
none
Potential issues
No response
Alternative solutions
My current solution is to iterate through the entity lists, when the changed value is not available, but this obviously causes more network traffic and overhead.
Beta Was this translation helpful? Give feedback.
All reactions