All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Updated supported
Go
versions to1.21
-1.23
. - [CI] Updated
golangci
to 'v1.61.0'. - Updated
github.com/go-chi/chi/v5
to version 5.1.0. - Updated
github.com/hashicorp/go-retryablehttp
to version 0.7.7. - Updated
google.golang.org/api
to version 0.198.0.
- Updated supported
Go
versions to1.20
-1.21
. - Updated
github.com/go-chi/chi/v5
to version 5.0.12. - Updated
github.com/gphotosuploader/googlemirror
to version 0.5.0. - Updated
github.com/hashicorp/go-retryablehttp
to version 0.7.5. - Updated
google.golang.org/api
to version 0.167.0. - [CI] Updated
golangci
to 'v1.56.2'.
- Bump
google.golang.org/api
to version 0.155.0 - Bump
github.com/hashicorp/go-retryablehttp
to version 0.7.5 - Bump
github.com/go-chi/chi/v5
to version 5.0.11
- Filename metadata field in Google Photos UI was not set properly (#116)
- Bump
google.golang.org/api
from 0.145.0 to 0.148.0
- The missing mapping for
MediaItem.Description
, leaving all Descriptions empty when retrieving from the API. Thanks, @timjonischkat (#105)
- Update supported
Go
versions to1.19
,1.20
and1.21
. - Bump
github.com/go-chi/chi/v5
from 5.0.8 to 5.0.10 (#102) - Bump
google.golang.org/api
from 0.130.0 to 0.143.0 (#113) - [CI] Bump
actions/checkout
from 3 to 4 (#110) - [CI] Bump
golangci
from 1.53.1 to 1.54.2
- Bump
google.golang.org/api
dependency.
Note: This is a major version update and is NOT BACKWARDS COMPATIBLE.
// New module path
import gphotos "github.com/gphotosuploader/google-photos-api-client-go/v3"
albums.PaginatedList
retrieves a specific page of albums, allowing for efficient retrieval of albums in pages. (#65)media_items.PaginatedList
retrieves a specific page of media items, allowing for efficient retrieval of media items in pages. (#65)- Possibility to set custom
BaseURL
andUserAgent
inalbums
andmedia_items
services. - Possibility to set custom
BaseURL
inalbums
andmedia_items
services using theNewClientWithBaseURL
. - The
MockedGooglePhotosService
implements the Google Photos API for testing purposes. - A new
ErrDailyQuotaExceeded
error has been implemented to detect errors when the Google Photos 'All request' daily quota has been exceeded. (#62)
- [BREAKING CHANGE] Updated constructors for
albums.Service
andmedia_items.Service
to utilize the Config struct for customizations. - [BREAKING CHANGE] Google Photos 'All request' daily quota exceeded will not be retried. A
ErrDailyQuotaExceeded
will be raised instead. (#62) - [BREAKING CHANGE] Uploaders have been moved to
uploader.SimpleUplader
anduploader.ResumableUploader
. - [BREAKING CHANGE] The
uploader.NewResumableUploader
doesn't require auploader.Store
anymore. If it's not set, it will just work as anuploader.SimpleUploader
. - Reducing the number of retries for failed request to Google Photos API to 3,
- Simplified code in the
albums
andmedia_items
modules by removing the repository abstraction, resulting in improved code readability. - Module documentation has been improved adding examples of how to use this module.
- [BREAKING CHANGE] Implemented a retry policy that excludes retries when the Google Photos quota per day has been reached. Instead, it returns an error
ErrDailyQuotaExceeded
. (#62) - Optimized the Albums Service to reduce the number of requests by fixing caching issues.
- The HTTP Client is now optional when the Album Manager, Media Item Manager, and Uploader are set.
- [BREAKING CHANGE] Removed the previous
CachedAlbumsService
service, which was not working properly. We encourage implementing caching strategies at consumer side. - [BREAKING CHANGE] Removed
gphotos.Client
optional options. Useghotos.Client
direct assignment to configure it after creation. - All services mock in favor of the
MockedGooglePhotosService
implementing Google Photos API for testing. - Unused OAuth scopes have been removed:
DrivePhotosReadonlyScope
andPhotoslibrarySharingScope
.
- Supported
Go
versions are1.18
,1.19
and1.20
. - Upgraded several dependencies to remove vulnerabilities.
- [CI] Updated GHA to create releases on tags.
- [CI] Run tests against last three major Go releases.
- [CI] Enable dependabot to scan vulnerable dependencies.
- Supported
go
versions are1.18
and1.19
.
- Support for
go
version1.16
and1.17
.
- Support for
go
version1.17
. - Pagination to the mediaItems:search mock.
ListWithOptions()
method to list all albums specifying if non app created albums should be returned or not. (#72)
- Reduce number of request to Google Photos by using bigger
PageSize
onmediaItems.search
andalbums.list
.
ListAll()
method useexcludeNonAppCreatedData
and it doesn't return all albums. (#72)This could be a breaking change, given that we were excluding non app created albums previously. If you want to maintain the same behaviour as before, use
ListWithOptions()
instead.MediaItems.ListByAlbum
does not support paging. (#65)
- Support for
go
version1.15
.
- Add support to
go
version1.16
.
- Support for
go
version1.14
.
- Removes retry when Google Photos requests quota limit has been reached. (gphotos-uploader-cli#290)
- Removes retry when Google Photos requests quota limit has been reached. (gphotos-uploader-cli#248)
- Disabled DEBUG log for each request. (#56)
- Crash when Google Photos API returns a
MediaItem
with an error onmediaItems.batchCreate
. (#54) - Basic uploader is throwing a bad request when trying to upload a file. (#53)
- Mocks for this package. See
mocks
folder. - oAuth scopes has been added, given that they are needed to make oAuth works.
- Documentation has been improved.
- Albums repository
albums.PhotosLibraryAlbumsRepository
usinggphotosuploader/googlemirror
package. - Method
media_items.NewPhotosLibraryClientWithURL()
for customize Google Photos servicebasePath
. - Google Photos library
gphotosuploader/googlemirror
mock.
- Code without tests. Test coverage has been improved a lot (~ 70%).
- Albums repository using
duffpl/google-photos-api-client
package. It has been replaced bygphotosuploader/googlemirror
.
This is a major version update, it means that is NOT BACKWARDS COMPATIBLE. New import path is in place.
- Cache is used to improve performance and reduce the number of calls to Google Photos API. See albums.Cache interface.
- Improved testing of the whole module.
- Added
ListAlbums
andListAlbumsWithCallback
, to get album list from library. - Added
AddMediaToLibrary
to upload media without assigning it to an album. - Added retries on HTTP Client. The default configuration will use Exponential Backoff with a maximum of 5 retries.
- Import path includes v2:
github.com/gphotosuploader/google-photos-api-client-go/v2
. - Client call has changes to
NewClient
where you can customize withOptions
. See README for more information.
- Check for permission errors. (#25)
GetUploadToken
should not be exposed. (#9)- Albums duplication, using mutex and cache. (#36)
- Removed
AlbumByName
byFindAlbum
. - Removed
GetOrCreateAlbumByName
byCreateAlbum
. - Removed
AddMediaItem
byAddMediaToAlbum
. - Removed
NewOAuthConfig
. - Removed the methods that were deprecated on v1.1.0. (#11)
- Update required
googlemirror
package version to v0.3.5.
This version was not working due to
photoslibrary
dependency. PLEASE UPDATE TO v1.1.5 ASAP.
- Update required
googlemirror
package version to v0.3.4.
- CONTRIBUTING guide line has been added.
- README has been updated fixing some typos.
- Module use an interface Logger to log activity. This allow to implement different logging systems. See internal/log/logger.go.
- Once Go 1.13 has been published, previous Go 1.11 support is deprecated. This project will maintain compatibility with the last two major versions published.
- Fix uploaded photos without a correct file name. (#32)
- Remove progress information when uploading, if you want to have progress bars when upload a file, you should inject a reader to the Uploader().
- Update golangci linter to version 1.20.0.
- Fix fatal error introduced in the last version. (#28)
- Fix race condition on
GetOrCreateAlbumByName()
. Google Photos API allow you to create several albums with the same name. (#26)
- New
NewClientWithResumableUploads()
function to create a Google Photos client with uploads that can be resumed. - New
AddMediaItem()
method to upload contents and make it available in Google Photos. - New
uploader
internal package implementing uploads to Google Photos.
- Refactor how Google response is checked. It's following Google Photos best practices. (#10)
- Updated README documentation and added examples.
- Refactor how retries are handled by the code. See
retryableMediaItemBatchCreateDo()
method.
NewClient()
function has been deprecated. UseNewClientWithResumableUploads()
instead.UploadFile()
andUploadFileResumable()
methods has been deprecated. UseAddMediaItem()
instead.noserver-gphotos
package has been deprecated.
- A new Logger has been added to be shared across the whole package. See
logger.go
. - Tests for almost all the code, except
uploads.go
that needs a lot of refactor. - Package's documentation and examples of use.
xerrors
is used instead oferrors
. Preparing code for Go 1.13 release.
Token()
method has been deprecated. Current package implementation doesn't need to have OAuth token.
- Fix progress logging. (#19)
ReadProgressReporter
was giving panic at some circumstances. There was a problem castingint64
toint
. (#17)- Fix progress calculations for files big sized.
- CI platform is now drone.io.
- Fix
AlbumByName
to check against all Google Photos album list (#12).
- Add resumable file uploads. You can use new
UploadFileResumable
method to upload files that can be resumed. See documentation for more details.
- Add makefile for easy test and linting
- Add CI using travis-ci.com
- Add travis and goodocs badges to README
- Add semantic versioning to this package
- Add Go module support
- Add MIT license
- Clean up of useless files / directories
- Update package documentation
- Fix issue #8 on parent repository here
- Removed
Makefile
support
Initial release after clone it from original repository. Latest commit was 3dac07f