Provider: Google Photos #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Google Photos provider using the Google Photos Library API with OAuth2.
Config Schema
Runtime state (stored separately, not user-configured):
access_token,refresh_token,token_expiryAuth Flow
https://photos.haunt.house/api/providers/{id}/oauth/callbackclient_idandclient_secretin the provider config formScopes needed:
https://www.googleapis.com/auth/photoslibrary.readonlyImplementation Notes
google-authandrequests(not the full Google client library — too heavy)list_photos()callsmediaItems.listormediaItems.search(if album_id set), paginates tomax_photosget_photo()fetches from thebaseUrl+=w{width}-h{height}parameter (Google serves resized versions)get_thumbnail()fetchesbaseUrl+=w300-h300-c(cropped thumbnail, served by Google — fast)PhotoRef.date=mediaMetadata.creationTimePhotoRef.width/height=mediaMetadata.width/heightbaseUrlexpires after ~60 minutes. Thelist_photos()cache TTL must respect this. Either re-fetch URLs before they expire, or fetch the URL on-demand inget_photo().Album Selection UI
After OAuth authorization, the web UI should:
albums.listalbum_idto provider configDependencies
google-authadded torequirements.txtGotchas
baseUrlexpiration means we can't cache photo URLs long-term — only cache themediaItem.idand re-resolve URLs when neededlist— only insearch. For "all photos" mode, we paginate through everything.Depends on #9 (core architecture).