@@ -262,17 +262,17 @@ public function listPeers($torrentId)
262262 public function getPeerUploadSpeed ($ peer ): string
263263 {
264264 $ diff = $ peer ->uploaded - $ peer ->uploadoffset ;
265- $ seconds = max (1 , $ peer ->started ->diffInSeconds ($ peer ->last_action ));
265+ $ seconds = max (1 , $ peer ->started ->diffInSeconds ($ peer ->last_action , true ));
266266 return mksize ($ diff / $ seconds ) . '/s ' ;
267267 }
268268
269269 public function getPeerDownloadSpeed ($ peer ): string
270270 {
271271 $ diff = $ peer ->downloaded - $ peer ->downloadoffset ;
272272 if ($ peer ->isSeeder ()) {
273- $ seconds = max (1 , $ peer ->started ->diffInSeconds ($ peer ->finishedat ));
273+ $ seconds = max (1 , $ peer ->started ->diffInSeconds ($ peer ->finishedat , true ));
274274 } else {
275- $ seconds = max (1 , $ peer ->started ->diffInSeconds ($ peer ->last_action ));
275+ $ seconds = max (1 , $ peer ->started ->diffInSeconds ($ peer ->last_action , true ));
276276 }
277277 return mksize ($ diff / $ seconds ) . '/s ' ;
278278 }
@@ -550,7 +550,7 @@ public function approval($user, array $params): array
550550 $ hasBeenDownloaded = Snatch::query ()->where ('torrentid ' , $ torrent ->id )->exists ();
551551 $ log = "Torrent: {$ torrent ->id } is in promotion, hasBeenDownloaded: $ hasBeenDownloaded " ;
552552 if (!$ hasBeenDownloaded ) {
553- $ diffInSeconds = $ torrent ->promotion_until ->diffInSeconds ($ torrent ->added );
553+ $ diffInSeconds = $ torrent ->promotion_until ->diffInSeconds ($ torrent ->added , true );
554554 $ log .= ", addSeconds: $ diffInSeconds " ;
555555 $ torrentUpdate ['promotion_until ' ] = $ torrent ->promotion_until ->addSeconds ($ diffInSeconds );
556556 }
0 commit comments