Add Rarest/Sequential toggle to torrents

This commit is contained in:
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 <TorrentOptions
id={torrent.id} id={torrent.id}
priority={torrent.priority} priority={torrent.priority}
strategy={torrent.strategy}
priorityChanged={priority => priorityChanged={priority =>
dispatch(updateResource({ id: torrent.id, priority }))} dispatch(updateResource({ id: torrent.id, priority }))}
strategyChanged={strategy =>
dispatch(updateResource({ id: torrent.id, strategy }))}
downloadThrottle={torrent.throttle_down} downloadThrottle={torrent.throttle_down}
downloadThrottleChanged={throttle_down => downloadThrottleChanged={throttle_down =>
dispatch(updateResource({ id: torrent.id, throttle_down }))} dispatch(updateResource({ id: torrent.id, throttle_down }))}

View File

@ -11,6 +11,7 @@ export default class TorrentOptions extends Component {
const { const {
id, id,
start, start,
strategy,
startChanged, startChanged,
path, path,
pathChanged, pathChanged,
@ -18,6 +19,7 @@ export default class TorrentOptions extends Component {
priorityChanged, priorityChanged,
downloadThrottle, downloadThrottle,
downloadThrottleChanged, downloadThrottleChanged,
strategyChanged,
uploadThrottle, uploadThrottle,
uploadThrottleChanged, uploadThrottleChanged,
} = this.props; } = this.props;
@ -60,6 +62,18 @@ export default class TorrentOptions extends Component {
<option value="5">Highest</option> <option value="5">Highest</option>
</Input> </Input>
</FormGroup> </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 <Throttle
prop={`dl-throttle-${id}`} prop={`dl-throttle-${id}`}
legend="Download throttle" legend="Download throttle"