Add Rarest/Sequential toggle to torrents

master
Luminarys 2018-04-16 11:18:59 -07:00
parent 25ca270ffb
commit 305f5c245c
2 changed files with 17 additions and 0 deletions

View File

@ -251,8 +251,11 @@ class Torrent extends Component {
<TorrentOptions
id={torrent.id}
priority={torrent.priority}
strategy={torrent.strategy}
priorityChanged={priority =>
dispatch(updateResource({ id: torrent.id, priority }))}
strategyChanged={strategy =>
dispatch(updateResource({ id: torrent.id, strategy }))}
downloadThrottle={torrent.throttle_down}
downloadThrottleChanged={throttle_down =>
dispatch(updateResource({ id: torrent.id, throttle_down }))}

View File

@ -11,6 +11,7 @@ export default class TorrentOptions extends Component {
const {
id,
start,
strategy,
startChanged,
path,
pathChanged,
@ -18,6 +19,7 @@ export default class TorrentOptions extends Component {
priorityChanged,
downloadThrottle,
downloadThrottleChanged,
strategyChanged,
uploadThrottle,
uploadThrottleChanged,
} = this.props;
@ -60,6 +62,18 @@ export default class TorrentOptions extends Component {
<option value="5">Highest</option>
</Input>
</FormGroup>
<FormGroup>
<Label for="strategy">Download Strategy</Label>
<Input
type="select"
id="strategy"
value={strategy}
onChange={e => strategyChanged(e.target.value)}
>
<option value="rarest">Rarest</option>
<option value="sequential">Sequential</option>
</Input>
</FormGroup>
<Throttle
prop={`dl-throttle-${id}`}
legend="Download throttle"