Ido Ran
Ido Ran

Reputation: 11374

How to know if a Google Photos album has changed

I'm using Google Photos API to access albums.
Users can have in an album anything from a single photo to thousands of photos.
Is there a way to get something like an ETag to know if an album has changed since a previous known state?

Currently, the only way I could find is to iterate over all the images, and having to do that in 100 photos each time can take a lot of calls just to find out at the end that nothing has changed.

Upvotes: 1

Views: 404

Answers (1)

Tanaike
Tanaike

Reputation: 201378

  • You want to know whether the album of Google Photos has been changed.

I could understand like above. Unfortunately, in the current stage, there are no metadata like the modified date when the contents in the album were changed. So in my case, I use the following workaround. Please think of this as just one of several workarounds.

Workaround:

  • If the number of photos in the album is changed, it can be known by the property of mediaItemsCount.

  • If the cover photo is changed, it can be known by the property of coverPhotoBaseUrl.

  • If several photos in a album are changed without increasing and decreasing the number of photos, unfortunately, in the current stage, I think that it is required to confirm the creationTime, filename and so on using the method of mediaItems.list.

By confirming from above in order, I can know about the change of the album.

References:

Upvotes: 1

Related Questions