Home Manual Reference Source Test Repository
public class | source

Helper

Class for saving shows.

Constructor Summary

Public Constructor
public

Create an helper object for show content.

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

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

Adds one datebased season to a show.

private

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

Adds one seasonal season to a show.

private

_getImages(tmdb_id: Integer, tvdb_id: Integer): Object

Get images from Fanart.tv on thetvdb.com.

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 for show content.

Params:

NameTypeAttributeDescription
name String

The name of the content provider.

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 _addDateBasedSeason(show: Show, episodes: Object, seasonNumber: Integer, slug: String): * source

Adds one datebased 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:

*

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

Adds one seasonal 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:

*

private _getImages(tmdb_id: Integer, tvdb_id: Integer): Object source

Get images from Fanart.tv on thetvdb.com.

Params:

NameTypeAttributeDescription
tmdb_id Integer

The tmdb id of the how you want the images from.

tvdb_id Integer

The tvdb id of the show you want the images from.

Return:

Object

Object with a banner, fanart and poster images.

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.