Skip to content

Commit

Permalink
feat(torrent): add as stopped for v5.0.0 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
zze0s authored Oct 7, 2024
1 parent 0b2a1dc commit fec84d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ const (
// Torrent is paused and has finished downloading
TorrentStatePausedUp TorrentState = "pausedUP"

// Torrent is stopped and has finished downloading
TorrentStateStoppedUp TorrentState = "stoppedUP"

// Queuing is enabled and torrent is queued for upload
TorrentStateQueuedUp TorrentState = "queuedUP"

Expand All @@ -132,6 +135,9 @@ const (
// Torrent is paused and has NOT finished downloading
TorrentStatePausedDl TorrentState = "pausedDL"

// Torrent is stopped and has NOT finished downloading
TorrentStateStoppedDl TorrentState = "stoppedDL"

// Queuing is enabled and torrent is queued for download
TorrentStateQueuedDl TorrentState = "queuedDL"

Expand Down Expand Up @@ -175,6 +181,9 @@ const (
// Torrent is paused
TorrentFilterPaused TorrentFilter = "paused"

// Torrent is stopped
TorrentFilterStopped TorrentFilter = "stopped"

// Torrent is stalled
TorrentFilterStalled TorrentFilter = "stalled"

Expand Down Expand Up @@ -261,6 +270,7 @@ const (
)

type TorrentAddOptions struct {
Stopped bool // introduced in Web API v2.11.0 (v5.0.0)
Paused bool
SkipHashCheck bool
ContentLayout ContentLayout
Expand All @@ -281,8 +291,14 @@ func (o *TorrentAddOptions) Prepare() map[string]string {
options := map[string]string{}

options["paused"] = "false"
options["stopped"] = "false"
if o.Paused {
options["paused"] = "true"
options["stopped"] = "true"
}
if o.Stopped {
options["paused"] = "true"
options["stopped"] = "true"
}
if o.SkipHashCheck {
options["skip_checking"] = "true"
Expand Down

0 comments on commit fec84d3

Please sign in to comment.