jackfagner / OpenTidl

Free and open source API for TIDAL
GNU Affero General Public License v3.0
44 stars 18 forks source link

ETag/If-None-Match Header #3

Closed scgough closed 8 years ago

scgough commented 8 years ago

Hi, Great API. I've noticed an issue when I try and add a track to an existing playlist. This might affect any POST request but I've not tested fully as yet.

It looks like the request to add the track needs the If-None-Match header adding in. Without it the request fails.

The value of this seems to be the ETag value given when a playlist is requested via GetPlaylist.

scgough commented 8 years ago

Update - I do see a reference to the IfNoneMatch variable on AddPlaylistTracks and DeletePlaylistTracks so maybe this is a work in progress?

jackfagner commented 8 years ago

Thank you for reporting this bug. IfNoneMatch is most likely used as a timestamp-based concurrency control and I wasn't aware it was mandatory for the playlist methods. An update is coming ...

scgough commented 8 years ago

Great thank you, I've managed to implement this my side by extracting the ETag header to the ModelBase (where available) then passing it through to the relevant requests as a custom header variable on the RestClient.Process method.

jackfagner commented 8 years ago

Sounds good. You are much welcome to create a pull request.

jackfagner commented 8 years ago

This issue should be fixed in 2282d9978587a65579ae9855e07ae305e89ba0a4