Clean up transmission empty containers evaluation (#59304)

This commit is contained in:
Jim Shank 2021-11-07 16:06:56 -08:00 committed by GitHub
parent 8ebd47b430
commit 563eba7684
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -441,13 +441,13 @@ class TransmissionData:
def start_torrents(self):
"""Start all torrents."""
if len(self._torrents) <= 0:
if not self._torrents:
return
self._api.start_all()
def stop_torrents(self):
"""Stop all active torrents."""
if len(self._torrents) == 0:
if not self._torrents:
return
torrent_ids = [torrent.id for torrent in self._torrents]
self._api.stop_torrent(torrent_ids)