Home Manual Reference Source Repository
public class | source

Helper

Class for saving shows.

Constructor Summary

Public Constructor
public

Create an helper object.

Member Summary

Public Members
public

The name of the torrent provider.

Private Members
private

The util object with general functions.

Method Summary

Public Methods
public

addEpisodes(show: Show, episodes: Object, slug: String): Show

Adds episodes to a show.

public

Get info from Trakt and make a new show object.

Private Methods
private

_addSeason(show: Show, episodes: Object, seasonNumber: Integer, slug: String): Show

Adds one season to a show.

private

_updateEpisode(matching: Object, found: Object, show: Show, quality: String): Show

Update the torrents for an existing show.

private

Update a given show with it's associated episodes.

private

Update the number of seasons of a given show

Public Constructors

public constructor(name: String) source

Create an helper object.

Params:

NameTypeAttributeDescription
name String

The name of the helper.

Public Members

public name: String source

The name of the torrent provider.

Private Members

private _util: Util source

The util object with general functions.

Public Methods

public addEpisodes(show: Show, episodes: Object, slug: String): Show source

Adds episodes to a show.

Params:

NameTypeAttributeDescription
show Show

The show to add the torrents to.

episodes Object

The episodes containing the torrents.

slug String

The slug of the show.

Return:

Show

A show with updated torrents.

public getTraktInfo(slug: String): Show source

Get info from Trakt and make a new show object.

Params:

NameTypeAttributeDescription
slug String

The slug to query https://trakt.tv/.

Return:

Show

A new show without the episodes attached.

Private Methods

private _addSeason(show: Show, episodes: Object, seasonNumber: Integer, slug: String): Show source

Adds one season to a show.

Params:

NameTypeAttributeDescription
show Show

The show to add the torrents to.

episodes Object

The episodes containing the torrents.

seasonNumber Integer

The season number.

slug String

The slug of the show.

Return:

Show

A new show with seasons.

private _updateEpisode(matching: Object, found: Object, show: Show, quality: String): Show source

Update the torrents for an existing show.

Params:

NameTypeAttributeDescription
matching Object

The matching episode of new the show.

found Object

The matching episode existing show.

show Show

The show to merge the episodes to.

quality String

The quality of the torrent.

Return:

Show

A show with merged torrents.

private _updateEpisodes(show: Show): Show source

Update a given show with it's associated episodes.

Params:

NameTypeAttributeDescription
show Show

The show to update its episodes.

Return:

Show

A newly updated show.

private _updateNumSeasons(show: Show): Show source

Update the number of seasons of a given show

Params:

NameTypeAttributeDescription
show Show

The show to update the number of seasons.

Return:

Show

A newly updated show.