new GoogleSource(useKey, photosKey, type, desc, isDaily, isArray [, loadArg])
Create a new photo source
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
useKey |
string | The key for if the source is selected |
||
photosKey |
string | The key for the collection of photos |
||
type |
string | A descriptor of the photo source |
||
desc |
string | A human readable description of the source |
||
isDaily |
boolean | Should the source be updated daily |
||
isArray |
boolean | Is the source an Array of photo Arrays |
||
loadArg |
Object |
<optional> <nullable> |
null | optional arg for load function |
- Source:
Members
-
<private, static, constant> _ALBUM_QUERY :string
-
Query an album for its photos
Type:
- string
- Source:
-
<private, static, constant> _ALBUMS_QUERY :string
-
Query for list of albums
Type:
- string
- Source:
-
<private, static, constant> _URL_BASE :string
-
Path to Picasa API
Type:
- string
- Default Value:
-
- https://picasaweb.google.com/data/feed/api/user/
- Source:
Methods
-
<static> _fetchAlbumPhotos() → {Promise.<Array.<app.PhotoSource.Photo>>}
-
Fetch the photos for the selected albums
- Source:
Returns:
Array of photos
- Type
- Promise.<Array.<app.PhotoSource.Photo>>
-
<private, static> _getMaxImageSize() → {string}
-
Get max image size to retrieve
- Source:
Returns:
image size description
- Type
- string
-
<private, static> _getThumbnail(entry) → {string}
-
Get the thumbnail url if it exists
Parameters:
Name Type Description entryArray Picasa media object
- Source:
Returns:
url or null
- Type
- string
-
<private, static> _hasGeo(entry) → {boolean}
-
Determine if a Picasa entry has Geo position
Parameters:
Name Type Description entryObject Picasa media object
- Source:
Returns:
true if entry has Geo position
- Type
- boolean
-
<private, static> _isImage(entry) → {boolean}
-
Determine if a Picasa entry is an image
Parameters:
Name Type Description entryObject Picasa media object
- Source:
Returns:
true if entry is a photo
- Type
- boolean
-
<private, static> _loadAlbum(albumId [, userId]) → {Promise.<Object>}
-
Retrieve a Google Photos album
Parameters:
Name Type Argument Default Description albumIdstring Picasa album ID
userIdstring <optional>
'default' userId for non-authenticated request
- Source:
Returns:
Root object from Picasa call null if not found
- Type
- Promise.<Object>
-
<private, static> _processPhotos(root) → {Array.<app.PhotoSource.Photo>}
-
Extract the Picasa photos into an Array
Parameters:
Name Type Description rootObject root object from Picasa API call
- Source:
Returns:
Array of photos
- Type
- Array.<app.PhotoSource.Photo>
-
<static> loadAlbumList() → {Promise.<Array.<app.GoogleSource.Album>>}
-
Retrieve the users list of albums, including the photos in each
- Source:
Returns:
Array of albums
- Type
- Promise.<Array.<app.GoogleSource.Album>>
-
fetchPhotos() → {Promise.<Array.<app.PhotoSource.Photo>>}
-
Fetch the photos for this source
- Source:
Returns:
Array of photos
- Type
- Promise.<Array.<app.PhotoSource.Photo>>
Type Definitions
-
Album
-
A Google Photo Album
Type:
- Object
- Source:
Properties:
Name Type Description indexint Array index
uidstring unique identifier
namestring album name
idstring Google album Id
thumbstring thumbnail url
checkedboolean is album selected
ctint number of photos
photosArray.<app.PhotoSource.Photo> Array of photos
-
SelectedAlbum
-
A Selected Google Photo Album
Type:
- Object
- Source:
Properties:
Name Type Description idstring Google album Id
photosArray.<app.PhotoSource.Photo> Array of photos