Class: GoogleSource

GoogleSource

A potential source of photos from Google


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
entry Array

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
entry Object

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
entry Object

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
albumId string

Picasa album ID

userId string <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
root Object

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
Properties:
Name Type Description
index int

Array index

uid string

unique identifier

name string

album name

id string

Google album Id

thumb string

thumbnail url

checked boolean

is album selected

ct int

number of photos

photos Array.<app.PhotoSource.Photo>

Array of photos

Source:

SelectedAlbum

A Selected Google Photo Album

Type:
  • Object
Properties:
Name Type Description
id string

Google album Id

photos Array.<app.PhotoSource.Photo>

Array of photos

Source: