Skip to content

Commit 4019123

Browse files
committed
fix for 0.8.8 and ui.current_view.set
1 parent 45aa88b commit 4019123

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/pyrocore/util/xmlrpc.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class RTorrentMethod(object):
3232
""" Collect attribute accesses to build the final method name.
3333
"""
3434

35+
# Actually, many more methods might need a fake target added; but these are the ones we call...
36+
NEEDS_FAKE_TARGET = set((
37+
"ui.current_view.set",
38+
))
39+
40+
3541
def __init__(self, proxy, method_name):
3642
self._proxy = proxy
3743
self._method_name = method_name
@@ -64,14 +70,17 @@ def __call__(self, *args, **kwargs):
6470

6571
try:
6672
# Map multicall arguments
67-
if not self._proxy._use_deprecated and self._method_name.endswith(".multicall"):
68-
if self._method_name == "d.multicall":
73+
if not self._proxy._use_deprecated:
74+
if self._method_name.endswith(".multicall"):
75+
if self._method_name == "d.multicall":
76+
args = (0,) + args
77+
if config.debug:
78+
self._proxy.LOG.debug("BEFORE MAPPING: %r" % (args,))
79+
args = args[0:2] + tuple(self._proxy._map_call(i) for i in args[2:])
80+
if config.debug:
81+
self._proxy.LOG.debug("AFTER MAPPING: %r" % (args,))
82+
elif self._method_name in self.NEEDS_FAKE_TARGET:
6983
args = (0,) + args
70-
if config.debug:
71-
self._proxy.LOG.debug("BEFORE MAPPING: %r" % (args,))
72-
args = args[0:2] + tuple(self._proxy._map_call(i) for i in args[2:])
73-
if config.debug:
74-
self._proxy.LOG.debug("AFTER MAPPING: %r" % (args,))
7584

7685
# Prepare request
7786
xmlreq = xmlrpclib.dumps(args, self._proxy._map_call(self._method_name))

0 commit comments

Comments
 (0)