Don't default to "localclient" as owner unconditionally.
Only set "localclient" as a last resort, first try to find out who is logged in.
This commit is contained in:
parent
8b6d6e3836
commit
5bffa3757d
|
@ -345,9 +345,14 @@ class TorrentManager(component.Component):
|
|||
|
||||
def add(self, torrent_info=None, state=None, options=None, save_state=True,
|
||||
filedump=None, filename=None, magnet=None, resume_data=None,
|
||||
owner='localclient'):
|
||||
owner=Ellipsis):
|
||||
"""Add a torrent to the manager and returns it's torrent_id"""
|
||||
|
||||
if owner is Ellipsis:
|
||||
owner = component.get("RPCServer").get_session_user()
|
||||
if not owner:
|
||||
owner = "localclient"
|
||||
|
||||
if torrent_info is None and state is None and filedump is None and magnet is None:
|
||||
log.debug("You must specify a valid torrent_info, torrent state or magnet.")
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue