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 |
Returns:
The created Album
- Type
- Album
Members
cloudId :string
The cloud ID of the Album. (database field: cloudIdentifier).
Type:
- string
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
folderUuid :string
The uuid of the parent Folder the Album is in. (database field: folderUuid).
Type:
- string
id :int
The ID of the Album in the database (database field: modelId).
Type:
- int
library :PhotosLibrary
The library used for media fetching.
Type:
- PhotosLibrary
magic :Bool
An Album is magic if it is generated by Apple Photos and not by the user (e.g. Favorites).
Type:
- Bool
name :string
The name of the Album. (database field: name).
Type:
- string
type :int
The type of the Album. (database field: albumType).
Type:
- int
uuid :string
The uuid of the Album in the database (database field: uuid).
Type:
- string
Methods
(async) media() → {Array.<Media>}
Load metadata about all pictures and videos from this Album.
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.
Returns:
The filtered object.
- Type
- Object