[Core] Add is_session_paused method

This commit is contained in:
Calum Lind 2017-06-28 22:31:05 +01:00
parent 3176b877a4
commit d45dbfe064

View File

@ -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"""