diff options
-rw-r--r-- | src/client/apis/google_docs/GooglePhotosClientUtils.ts | 8 | ||||
-rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/client/apis/google_docs/GooglePhotosClientUtils.ts b/src/client/apis/google_docs/GooglePhotosClientUtils.ts index dfc4a6ddf..a13d9dcd6 100644 --- a/src/client/apis/google_docs/GooglePhotosClientUtils.ts +++ b/src/client/apis/google_docs/GooglePhotosClientUtils.ts @@ -214,9 +214,9 @@ export namespace GooglePhotos { let nextPageTokenStored: Opt<string> = undefined; let found = 0; do { - const { mediaItems, nextPageToken } = (await photos.search(albumId, pageSize, nextPageTokenStored)) as any; - mediaItems.push(...mediaItems); - nextPageTokenStored = nextPageToken; + const response: any = await photos.mediaItems.search(albumId, pageSize, nextPageTokenStored); + mediaItems.push(...response.mediaItems); + nextPageTokenStored = response.nextPageToken; } while (found); return mediaItems; }; @@ -280,6 +280,8 @@ export namespace GooglePhotos { baseUrl: string; } + export const ListAlbums = async () => (await endpoint()).albums.list(); + export const AddTextEnrichment = async (collection: Doc, content?: string) => { const photos = await endpoint(); const albumId = StrCast(collection.albumId); diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index aafd9460e..4d4f69b92 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -220,6 +220,7 @@ export function CollectionSubView<T>(schemaCtor: (doc: Doc) => T) { return; } if ((matches = /(https:\/\/)?photos\.google\.com\/(u\/3\/)?album\/([^\\]+)/g.exec(text)) !== null) { + const albums = await GooglePhotos.Transactions.ListAlbums(); const albumId = matches[3]; const mediaItems = await GooglePhotos.Query.AlbumSearch(albumId); console.log(mediaItems); |