Merge pull request #50 from Luminarys/master

Add Rarest/Sequential toggle to torrents
This commit is contained in:
Drew DeVault 2018-04-18 17:54:31 -04:00 committed by GitHub
commit efb4333d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"