Optional
config: TransmissionClientConfigThe magnet to add and any additional options
The info of the torrent that was added
client.addMagnet({
magnet: 'magnet-link',
downloadDir: '/path/to/download/dir',
pause: true,
});
When downloadDir
is not specified, Transmission will use the default
download directory as specified in the Transmission daemon's settings.
By default torrent will be added in a started state, to add it in a paused
state, set paused
to true
.
Fetch the lists of recently active torrents from the Transmission RPC
The method returns two lists of torrents, the first called removed
contains the ids of torrents that were removed,
the second called torrents
contains the info of the torrents that were added or updated.
Optional
config: GetRecentlyActiveTorrentsConfigThe fields to get for each torrent
The lists of recently active torrents
const recentlyActiveTorrents = await client.getRecentlyActiveTorrents();
When getting torrents you can also select which fields
you want to receive by passing in a list of fields:
const torrents = await client.getRecentlyActiveTorrents({
fields: ['id', 'name', 'status'],
});
If no fields
are specified, all fields will be returned. For a full list of fields see AllTorrentFields.
Gets the current Transmission session, which includes the information about the Transmission server and the current session.
The current Transmission session
Gets a list of torrents from the Transmission RPC endpoint
If no ids
are specified, all torrents will be returned.
Optional
config: ListTorrentsConfigA list of torrents from the Transmission RPC endpoint
// List all torrents currently in Transmission
const torrents = await client.getTorrents();
// List torrents with ids 1 and 2
const torrents = await client.getTorrents({
ids: [1, 2],
});
When getting torrents you can also select which fields
you want to receive by passing in a list of fields:
const torrents = await client.getTorrents({
fields: ['id', 'name', 'status'],
});
If no fields
are specified, all fields will be returned. For a full list of fields see AllTorrentFields.
Remove one or more torrents from the Transmission RPC endpoint
You can remove torrents by addressing them by their id:
// Remove torrent with id 1
await client.removeTorrents({
ids: 1,
});
// Remove torrents with ids 1 and 2
await client.removeTorrents({
ids: [1, 2],
});
// Remove torrent and delete downloaded data
await client.removeTorrents({
ids: 1,
deleteLocalData: true,
});
When removing torrents you can also set the deleteLocalData
option to true to delete the downloaded data.
Starts one or more torrents on the Transmission RPC endpoint
You can start torrents by addressing them by their id:
Optional
config: StartTorrentsConfigSpecifies which torrents to start
// Start torrent with id 1
await client.startTorrents({
ids: 1,
});
// Start torrents with ids 1 and 2
await client.startTorrents({
ids: [1, 2],
});
Optionally you can also start the torrents immediately by setting the now
option to true
.
If no ids
are specified, all torrents will be started.
Stops one or more torrents on the Transmission RPC endpoint
You can stop torrents by addressing them by their id:
Optional
config: StopTorrentsConfigSpecifies which torrents to stop
// Stop torrent with id 1
await client.stopTorrents({
ids: 1,
});
// Stop torrents with ids 1 and 2
await client.stopTorrents({
ids: [1, 2],
});
If no ids
are specified, all torrents will be stopped.
Generated using TypeDoc
Adds a magnet to the Transmission RPC endpoint