Class: Album

Album(library, row) → {Album}

The class that contains information about an album.

Constructor

new Album(library, row) → {Album}

Create a new Album class.

Parameters:
Name Type Description
library PhotosLibrary

An instance of PhotosLibrary used for media fetching.

row Object

A row of database data from RKAlbum.

Source:
Returns:

The created Album

Type
Album

Members

cloudId :string

The cloud ID of the Album. (database field: cloudIdentifier).

Type:
  • string
Source:

created :Date

The date the Album was created. (database field: createDate).

The database value is converted from a Apple Core Data date to a Javascript Date object.

Type:
  • Date
Source:

folderUuid :string

The uuid of the parent Folder the Album is in. (database field: folderUuid).

Type:
  • string
Source:

id :int

The ID of the Album in the database (database field: modelId).

Type:
  • int
Source:

library :PhotosLibrary

The library used for media fetching.

Type:
  • PhotosLibrary
Source:

magic :Bool

An Album is magic if it is generated by Apple Photos and not by the user (e.g. Favorites).

Type:
  • Bool
Source:

name :string

The name of the Album. (database field: name).

Type:
  • string
Source:

type :int

The type of the Album. (database field: albumType).

Type:
  • int
Source:

uuid :string

The uuid of the Album in the database (database field: uuid).

Type:
  • string
Source:

Methods

(async) media() → {Array.<Media>}

Load metadata about all pictures and videos from this Album.

Source:
Returns:

A list of all pictures and videos from the Album.

Type
Array.<Media>

toJSON() → {Object}

Prepare the Album for JSON serialization.

This function is needed to exclude the library property from JSON serialization.

Source:
Returns:

The filtered object.

Type
Object