mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 17:57:55 +00:00
Check for torrents in queue before calling the api stop_torrent() (#53895)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
parent
7518c58806
commit
fa9ac71c3a
@ -447,6 +447,8 @@ class TransmissionData:
|
|||||||
|
|
||||||
def stop_torrents(self):
|
def stop_torrents(self):
|
||||||
"""Stop all active torrents."""
|
"""Stop all active torrents."""
|
||||||
|
if len(self._torrents) == 0:
|
||||||
|
return
|
||||||
torrent_ids = [torrent.id for torrent in self._torrents]
|
torrent_ids = [torrent.id for torrent in self._torrents]
|
||||||
self._api.stop_torrent(torrent_ids)
|
self._api.stop_torrent(torrent_ids)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user