xob0t / Google-Photos-Toolkit

Userscript to filter, search, organize, or delete your Google Photos library
MIT License
222 stars 14 forks source link

Restore from trash fails with an error #30

Open ndv400 opened 2 months ago

ndv400 commented 2 months ago

Source read complete Found items: 28079 Items to process: 28079 Restoring 28079 items from trash Processing 500 items Processing 500 items Processing 500 items Processing 500 items Processing 500 items restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') TypeError: Cannot read properties of null (reading '0') restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0')

xob0t commented 2 months ago

Try lowering Api Operation Batch Size to 50 or less.

ndv400 commented 2 months ago

OK, I will. Is this also related to Api Operation Batch Size? Processing 500 items Processing 500 items moveItemsToTrash Api error SyntaxError: "undefined" is not valid JSON SyntaxError: "undefined" is not valid JSON

xob0t commented 2 months ago

May be. There is a bug in the Google Photos api, in my experience setting lower batch size fixes it.

xob0t commented 2 months ago

@ndv400 Did it help?

ndv400 commented 2 weeks ago

Sorry for the very late reply. It was still erroring out at 50: Source read complete Found items: 33989 Items to process: 33989 Restoring 33989 items from trash Processing 50 items Processing 50 items Processing 50 items Processing 50 items Processing 50 items Processing 50 items restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') TypeError: Cannot read properties of null (reading '0') restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') Same goes for 30: Processing 30 items restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') TypeError: Cannot read properties of null (reading '0') However, when I put it to 10 and tried on another computer with a different IP address it started working for a while, and then failed again: Processing 10 items Processing 10 items Processing 10 items Processing 10 items Processing 10 items restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') TypeError: Cannot read properties of null (reading '0') restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0') restoreFromTrash Api error TypeError: Cannot read properties of null (reading '0')

xob0t commented 2 weeks ago

@ndv400 Does restoring from the trash using the UI work? Try selecting a few hundred items and restoring them manually.