Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions photos/photos.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (p *Photos) AddToLibrary(ctx context.Context, filepaths []string) error {
}
for _, chunk := range splitMediaItems(mediaItems, batchCreateSize) {
p.log.Printf("Adding %d file(s) to the library", len(chunk))
batch := &photoslibrary.BatchCreateMediaItemsRequest{NewMediaItems: mediaItems}
batch := &photoslibrary.BatchCreateMediaItemsRequest{NewMediaItems: chunk}
if err := p.BatchCreate(ctx, batch); err != nil {
return err
}
Expand Down Expand Up @@ -79,7 +79,7 @@ func (p *Photos) CreateAlbum(ctx context.Context, title string, filepaths []stri
for _, chunk := range splitMediaItems(mediaItems, batchCreateSize) {
p.log.Printf("Adding %d file(s) into the album %s", len(chunk), album.Title)
batch := &photoslibrary.BatchCreateMediaItemsRequest{
NewMediaItems: mediaItems,
NewMediaItems: chunk,
AlbumId: album.Id,
AlbumPosition: &photoslibrary.AlbumPosition{Position: "LAST_IN_ALBUM"},
}
Expand Down