Permalink
Browse files

Merge pull request #2 from olof/fix/write_wanted_skip_empty_list

Skip (un)wanted-files requests if list is empty
  • Loading branch information...
2 parents 3c045f0 + 525ce90 commit 3aad4012ec125279e06de7b8b09ecd36b77af47b @jhthorsen jhthorsen committed Aug 17, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/Transmission/Torrent.pm
@@ -632,6 +632,9 @@ sub write_wanted {
}
for my $key (qw/wanted unwanted/) {
+ # Transmission interpret an empty list to mean all files
+ next unless @{$wanted{$key}};
+
$self->client->rpc('torrent-set' =>
ids => [ $self->id ], "files-$key" => $wanted{$key}
) or return;

0 comments on commit 3aad401

Please sign in to comment.