File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
crates/libtortillas/src/torrent Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ pub(crate) struct TorrentActor {
114114 pub ( super ) autostart : bool ,
115115
116116 /// If there is already a pending start, we don't want to start a new one
117- pending_start : bool ,
117+ pub ( super ) pending_start : bool ,
118118
119119 pub ( super ) ready_hook : Option < ReadyHook > ,
120120}
Original file line number Diff line number Diff line change @@ -322,9 +322,15 @@ impl Message<TorrentMessage> for TorrentActor {
322322 }
323323 TorrentMessage :: SetAutoStart ( auto) => {
324324 self . autostart = auto;
325+ if !self . pending_start {
326+ self . autostart ( ) . await ;
327+ }
325328 }
326329 TorrentMessage :: SetSufficientPeers ( peers) => {
327330 self . sufficient_peers = peers;
331+ if !self . pending_start {
332+ self . autostart ( ) . await ;
333+ }
328334 }
329335 TorrentMessage :: ReadyHook ( hook) => {
330336 // If torrent has already transitioned from Inactive state, immediately send
You can’t perform that action at this time.
0 commit comments