Home Manual Reference Source Test Repository
import CLI from 'popcorn-api/src/cli.js'
public class | source

CLI

Class The class for the command line interface.

Constructor Summary

Public Constructor
public

constructor(providerName: String)

Create a cli object.

Member Summary

Private Members
private

The shema used by prompt insert an anime show.

private

The schema used by prompt to confirm an import.

private

The schema used by prompt insert a movie.

private

The schema used by prompt insert a show.

private

The util object with general functions.

Method Summary

Public Methods
public

run()

Run the CLI program.

Private Methods
private

Adds a show to the database through the CLI.

private

_getMovieTorrentDataRemote(torrent: String, language: String, quality: String): Promise

Get movie data from a given torrent url.

private

_getShowTorrentDataRemote(torrent: String, quality: String, season: Integer, episode: Integer): Promise

Get show data from a given torrent url.

private

Confimation to import a collection

private

Adds a movie to the database through the CLI.

private

Adds a show to the database through the CLI.

Public Constructors

public constructor(providerName: String) source

Create a cli object.

Params:

NameTypeAttributeDescription
providerName String
  • optional
  • default: CLI

The default provider name.

Private Members

private _animeSchema: Object source

The shema used by prompt insert an anime show.

private _importSchema: Object source

The schema used by prompt to confirm an import.

private _movieSchema: Object source

The schema used by prompt insert a movie.

private _showSchema: Object source

The schema used by prompt insert a show.

private _util: Util source

The util object with general functions.

Public Methods

public run() source

Run the CLI program.

Private Methods

private _animePrompt() source

Adds a show to the database through the CLI.

private _getMovieTorrentDataRemote(torrent: String, language: String, quality: String): Promise source

Get movie data from a given torrent url.

Params:

NameTypeAttributeDescription
torrent String

The url of the torrent.

language String

The language of the torrent.

quality String

The quality of the torrent.

Return:

Promise

Movie data from the torrent.

private _getShowTorrentDataRemote(torrent: String, quality: String, season: Integer, episode: Integer): Promise source

Get show data from a given torrent url.

Params:

NameTypeAttributeDescription
torrent String

The url of the torrent.

quality String

The quality of the torrent.

season Integer

The season of the show from the torrent file.

episode Integer

The episode of the show from the torrent.

Return:

Promise

Show data from the torrent.

private _importPrompt() source

Confimation to import a collection

private _moviePrompt() source

Adds a movie to the database through the CLI.

private _showPrompt() source

Adds a show to the database through the CLI.