mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 03:55:43 +00:00
[Core] Add is_session_paused method
This commit is contained in:
parent
3176b877a4
commit
d45dbfe064
@ -630,20 +630,25 @@ class Core(component.Component):
|
||||
|
||||
@export
|
||||
def pause_session(self):
|
||||
"""Pause all torrents in the session"""
|
||||
"""Pause the entire session"""
|
||||
if not self.session.is_paused():
|
||||
self.session.pause()
|
||||
component.get('EventManager').emit(SessionPausedEvent())
|
||||
|
||||
@export
|
||||
def resume_session(self):
|
||||
"""Resume all torrents in the session"""
|
||||
"""Resume the entire session"""
|
||||
if self.session.is_paused():
|
||||
self.session.resume()
|
||||
for torrent_id in self.torrentmanager.torrents:
|
||||
self.torrentmanager[torrent_id].update_state()
|
||||
component.get('EventManager').emit(SessionResumedEvent())
|
||||
|
||||
@export
|
||||
def is_session_paused(self):
|
||||
"""Returns the activity of the session"""
|
||||
return self.session.is_paused()
|
||||
|
||||
@export
|
||||
def resume_torrent(self, torrent_id):
|
||||
"""Resumes a torrent"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user