This is just a suggestion which I don't expect will happen, due to the low priority of it, but it could be good for bandwidth.
Currently, if you request this URL:
http://api.themoviedb.org/3/movie/25657
You get this ETag:
W/"29b21c33f5540e8be9ab71e728157422"
If you request the same film, but append to the response, various other information, like this:
http://api.themoviedb.org/3/movie/25657?append_to_response=alternative_titles,credits,images,keywords,releases,videos,similar
You get this ETag:
W/"29b21c33f5540e8be9ab71e728157422"
The same ETag.
Now, the method name says it all, you are taking the initial response and the initial ETag and appending to it.
That said, it would be nice if append did change the ETag.
Thus, when you request all the information, you can just do a HEAD call to get the ETag and see if it has changed, rather than having to download it all to check.
How many people actually do HEAD requests? Probably just me. Thus the low prioirty. It would be nice though! :P
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on November 18, 2017 at 12:19 PM
I could have sworn way back when, I added proper support for ETag's and append_to_response.
Digging... aha, yes, it did work at one point but as pointed to on this thread broke in ~2013 sometime. It completely fell off my radar.
The stack is quite different today than it was in 2013, I suspect it might not be too hard to add back now. I have a lot of small stuff like this piling up, I'll try to set aside a week here and there and get issues like this knocked off.
P.S. I'm not sure how useful the
similar
method is anymore, I've moved everything over torecommendations
myself. Just a heads upReply by Adi
on November 18, 2017 at 5:55 PM
I find "known for" or "best known for" is fairly computable. Attempts at "similar" that I have seen have best been left to human input.
Reply by Travis Bell
on March 16, 2018 at 1:18 PM
This is supported properly now on the media methods. It's not hooked up on list methods (search, discover, etc..) but may at some point. It's less useful there anyways since so much of that data changes.
Anyways, you can use it the way you wanted above
Reply by Adi
on March 16, 2018 at 1:28 PM
Awesome! Will be really handy considering how many films there are and many of which will never get updated.
Does the order you put the append additions in the URL API call impact the eTag? Or does it ignore order (hopefully)?
Reply by Travis Bell
on March 16, 2018 at 3:27 PM
As long as the ETag is the same it will work. Based on my simple test it looks both calls return the same ETag which means we're good:
Reply by Adi
on March 16, 2018 at 5:20 PM
Great!
Reply by Adi
on March 16, 2018 at 5:22 PM
Can actually make good use of the HEAD command now, rather than GET :D
Reply by Adi
on April 20, 2018 at 5:12 PM
Okay, so I finally got around to fiddling with this.
If I call this: https://api.themoviedb.org/3/movie/2?api_key=xxx&append_to_response=alternative_titles,credits,images,keywords,releases,videos,similar";
I get an eTag of: W/"79894c6a8a69f6515f26de9e031382c5
If I call this: https://api.themoviedb.org/3/movie/2?api_key=xxx&append_to_response=alternative_titles,credits,images,keywords,releases,videos";
I get an eTag of: W/"79894c6a8a69f6515f26de9e031382c5
I was kinda hoping they would be different!
Is this working as intended?
Now obviously, I am not planning on changing what I am asking for all the time. I just decided I didn't need "similar" and it increases the size quite a bit and there is no point doing it if I am not using it. That said, I wasn't expecting the eTag to remain the same.
Reply by Travis Bell
on April 24, 2018 at 11:40 AM
The ETag should be a value computed on response body so yes, it looks like it's a bug. I'll have to take a look. I've created a new ticket for this here.
Reply by Adi
on April 24, 2018 at 2:36 PM
Remember to make sure the order of the append_to_response comma delimited string does impact the eTag.
I remember you saying that you order them and thus avoiding the issue. Just thought I would mention it though.
Reply by Travis Bell
on April 24, 2018 at 3:08 PM
does or doesn't? It won't since the order of the query params does not change the response body. The only thing that would create a new ETag would be a different SHA of the response body.
Reply by Adi
on April 24, 2018 at 10:02 PM
That should be fine.
e.g. you should an example above of it working, but that said, the append choices don't make much odds at the moment :)
The way you describe it though, there should be no issue.
Reply by Adi
on May 7, 2018 at 1:25 PM
Is the ETA on this one sooner or later?
Any information on the matter would help me plan accordingly!
Thanks.
Reply by Travis Bell
on May 8, 2018 at 6:41 PM
Hey Adi,
I'll try to find time to look into this tomorrow.
Reply by Adi
on May 10, 2018 at 9:14 PM
Just noticed that the eTag for Ariel (ID:2) has changed. It hasn't been edited since February though. Doesn't have any reviews.
Does this change every time something like popularity is recalculated or when someone adds a vote, the eTag changes?
Can you still add a vote?
If it is just popularity, how often is that calculated?
Obviously, an eTag is just an MD5 hash of the data. So it is what it is.
Makes me hanker for an X-Data-eTag to indicate manual changes to the data, rather than automated one. e.g. if someone adds a review, votes up an image, you want that change. Having popularity changed, especially if it is on a schedule, less so.
Obviously, such thinking opens up a whole different can of worms.