Răsfoiți Sursa

Deal with Transmission delete bugs

Zachary Kotlarek 14 ani în urmă
părinte
comite
887846ed47
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      transmission.pl

+ 4 - 0
transmission.pl

@@ -33,6 +33,7 @@ my $host          = 'http://localhost:9091';
 my $url           = $host . '/transmission/rpc';
 my $content       = '{"method":"torrent-get","arguments":{"fields":["hashString","id","addedDate","comment","creator","dateCreated","isPrivate","name","totalSize","pieceCount","pieceSize","downloadedEver","error","errorString","eta","haveUnchecked","haveValid","leftUntilDone","metadataPercentComplete","peersConnected","peersGettingFromUs","peersSendingToUs","rateDownload","rateUpload","recheckProgress","sizeWhenDone","status","trackerStats","uploadedEver","uploadRatio","seedRatioLimit","seedRatioMode","downloadDir","files","fileStats"]}}';
 my $delContent    = '{"method":"torrent-remove","arguments":{"ids":["#_ID_#"], "delete-local-data":"true"}';
+my $delSleep      = 5;
 my $RAR_MIN_FILES = 4;
 
 # Debug
@@ -406,6 +407,9 @@ sub delTor($) {
 		print STDERR 'Deleting torrent: ' . $tor->{'name'} . "\n";
 	}
 
+	# Sleep to avoid bugs in Transmission (i.e. multiple deletes fail)
+	sleep($delSleep);
+
 	# Construct the content
 	my $id      = $tor->{'hashString'};
 	my $content = $delContent;