hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
162 stars 62 forks source link

API Quota Reached #185

Closed smiles3983 closed 4 months ago

smiles3983 commented 4 months ago

The Google API Quota is 10,000. If I leave my MagicMirror alone all day it gets high, but doesnt hit it. But if im working on another module and restart MM a number of times, I hit the API quota. Why is it hitting the API so many times? Shouldnt it grab a list of photos in one call? and then call once per photo load? Is it calling the API for every photo when it may not even show that photo that day? I have an album with alot of photos in it.

smiles3983 commented 4 months ago

I increased the page size to 500, and I think that will help me out... Can you make the page size adjustable from the config?

hermanho commented 4 months ago

When you start MM every time, the module will get the album list and the images list from each album. The modules scans selected albums and get the images list per hour. Usually it is within 500 requests per day.

Screenshot 2024-03-05 上午10 19 04

Refer to the API docs, the recommended page size is 50 and the maximum page size is 100 so there is useless to make as configurable. https://developers.google.com/photos/library/guides/list