Downloader

Methods

inner addTor(magnet)

Add a torrent to WebTorrent and the DB.

Parameters:
Name Type Description
magnet string

the magnet URI for WebTorrent

async, inner dlAll()

Download all of the torrents, after they are added to the DOM.

inner dlProgress()

Update the download progress bar, but make sure not to do it too often.

async, inner dropTorrents()

Drop the torrent database. Mainly for testing purpose.

async, inner findDocuments()

Initial load, get the torrents in the db.

inner getDlPath(callback)

Get the path for torrents to be downloaded to, from JSON storage.

Parameters:
Name Type Description
callback

inner getRSSURI(callback)

Get the ShowRSS URI from JSON storage

Parameters:
Name Type Description
callback

return it.

inner getSwalConfirmButton() → {Promise}

Get the confirm button for the currently active sweetalert

Returns:
Promise -

Rejects if no sweetalert on screen, resolves the confirm button DOM element if a sweetalert is currently active

async, inner ignoreDupeTorrents(torrent, callback)

Make sure not to add torrents already downloaded.

Parameters:
Name Type Description
torrent object

the torrent object to be checked

callback

You know what it is.

async, inner indexDB()

Index the database.

inner insertDlPath(callback)

Insert the download path to electron-json-storage

Parameters:
Name Type Description
callback

callback, obviously

inner processTorrents(data)

Function to process torrents from ShowRSS

Parameters:
Name Type Description
data object

inner runScript(e) → {boolean}

Called on hitting enter in the Magnet URI box.

Parameters:
Name Type Description
e object

the keypress event.

Returns:
boolean -
  • whether the key was enter or not.

inner updateProgress(magnet, torrent)

Update the download progress.

Parameters:
Name Type Description
magnet string

The magnet URI for the download. Used to identify which DOM element to modify.

torrent any

The WebTorrent torrent instance.

inner updateURI(uri)

Make sure that the ShowRSS URI is updated.

Parameters:
Name Type Description
uri string

the ShowRSS URI