I realized that adding to shared albums is not working at the moment. I believe the problem is in function addItemsToAlbum which is using an rpcid that differs from what google photos UI uses when adding photo to shared albums.
google photos uses rpcid = 'laUYf' when adding to shared albums and rpcid = 'E1Cajb' when adding to non-shared albums.
The following code works for me to add photos to shared albums (request parameters are also different) .
async addItemsToSharedAlbum(productIdList, albumId = null, albumName = null) {
// supply album ID for adding to an existing album, or a name for a new one
const rpcid = 'laUYf';
let requestData = null;
if (albumName) requestData = [productIdList, null, albumName];
else if (albumId) requestData = [albumId, [2, null, productIdList.map(id => [[id]]), null, null, null, [1]]];
try {
const response = await this.makeApiRequest(rpcid, requestData);
return response;
} catch (error) {
console.error('Error in addItemsToSharedAlbum:', error);
throw error;
}
}
I realized that adding to shared albums is not working at the moment. I believe the problem is in function
addItemsToAlbum
which is using anrpcid
that differs from what google photos UI uses when adding photo to shared albums.google photos uses
rpcid = 'laUYf'
when adding to shared albums andrpcid = 'E1Cajb'
when adding to non-shared albums.The following code works for me to add photos to shared albums (request parameters are also different) .