Module: video

Methods

(async, inner) addNewVideo(video)

Add a new video: insert new video object to the database, and immediately attempt to update the cache with the new object. The video object is only cached if it can successfully be updated from the LinkedIn Learning API.
Parameters:
Name Type Description
video Object
Source:

(async, inner) deleteVideo(id)

Delete a video from the database and efficiently remove it from the cache so full flushing of cache can be avoided.
Parameters:
Name Type Description
id Number
Source:

(async, inner) fetchAll()

Fetch call videos. Fetches from cache if possible, otherwise fetches from database and caches values for future use.
Source:

(async, inner) fetchAllWithUniqueTitles() → {Array}

Fetch all videos that have unique titles. Fetches all videos then filters and sorts by the titles.
Source:
Returns:
videos
Type
Array

(async, inner) fetchAndResolveVideo(videoId) → {Object}

Fetches all info related to video and resolves all identifiers to values in the database. Returns resolved video object.
Parameters:
Name Type Description
videoId Number
Source:
Returns:
video
Type
Object

(async, inner) fetchByFilters(filters) → {Array}

Fetch videos based on input filters. Fetches from cache if possible
Parameters:
Name Type Description
filters Object
Source:
Returns:
matching video objects
Type
Array

(async, inner) fetchSimilarVideoRecords(video, maximumopt) → {Array}

Fetch similar video records by provided video and video-phase records. If the provided video has multiple phases, one is picked to avoid duplicate results. Returns an array of video records with a default maximum size of 5.
Parameters:
Name Type Attributes Default Description
video Object
maximum Number <optional>
5 default is 5
Source:
Returns:
similar video records
Type
Array

(async, inner) updateVideo(video)

Update a video: update a stored video object in the database, and immediately attempt to update the cache with the object. The video object is only cached if it can successfully be updated from the LinkedIn Learning API.
Parameters:
Name Type Description
video Object
Source: