Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPhotos module doesnt download Albums with more than one page fetch #187

Closed
lerasmo opened this issue Mar 10, 2024 · 1 comment · Fixed by #188
Closed

GPhotos module doesnt download Albums with more than one page fetch #187

lerasmo opened this issue Mar 10, 2024 · 1 comment · Fixed by #188

Comments

@lerasmo
Copy link

lerasmo commented Mar 10, 2024

I was using the MMM, The module works fine when is less than 50 photos in the album, but with larger albums I get this error:

[09.03.2024 23:01.08.389] [INFO] Albums: my_album
[09.03.2024 23:01.10.244] [ERROR] Trace: [GPHOTOS:CORE] request fail with URL mediaItems:search
at GPhotos.logTrace (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:128:13)
at GPhotos.request (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:169:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getImage (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:249:24)
at async Class.getImageList (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/node_helper.js:326:20)
at async Class.scanJob (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/node_helper.js:230:23)
[09.03.2024 23:01.10.246] [ERROR] Trace: [GPHOTOS:CORE] params null
at GPhotos.logTrace (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:128:13)
at GPhotos.request (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:170:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getImage (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:249:24)
at async Class.getImageList (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/node_helper.js:326:20)
at async Class.scanJob (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/node_helper.js:230:23)
[09.03.2024 23:01.10.248] [ERROR] Trace: [GPHOTOS:CORE] data {"albumId":"ABVpo..an ID...siB","pageSize":50,"pageToken":"CpgBCkR0eXB.....a Long Token.....aGM"}
at GPhotos.logTrace (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:128:13)
at GPhotos.request (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:171:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getImage (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/GPhotos.js:249:24)
at async Class.getImageList (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/node_helper.js:326:20)
at async Class.scanJob (/home/orangepi/MagicMirror/modules/MMM-GooglePhotos/node_helper.js:230:23)
[09.03.2024 23:01.10.250] [ERROR] [GPHOTOS:CORE] response.data:
{"error":{"code":400,"message":"**When using a page token, you must use the same parameters as the previous request**.","status":"INVALID_ARGUMENT"}}

I think is about: When using a page token, you must use the same parameters as the previous
with the token change in every album page (nextPageToken) of GPhotos.js, but my APIs skills aren't enough to fix the issue.
Thanks

@lerasmo
Copy link
Author

lerasmo commented Mar 10, 2024

ok, changing the page size in:

GPhotos.js:241 const getImage = async (pageSize = 100, pageToken = "") => {

to pageSize = 50

fixed the issue

hermanho added a commit that referenced this issue Mar 16, 2024
@hermanho hermanho linked a pull request Mar 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant