Repository: Flexget/Flexget

Issue:
rtorrent 0.9.x no longer has d.multicall
<!---
Before opening an issue, verify:

- Is this a feature request? Post it on https://feathub.com/Flexget/Flexget
- Did you recently upgrade? Look at the Change Log and Upgrade Actions to make sure that you don't need to make any changes to your config https://flexget.com/ChangeLog https://flexget.com/UpgradeActions
- Are you running FlexGet as a daemon? Stop it completely and then start it again https://flexget.com/CLI/daemon
- Did you search to see if the issue already exists? https://github.com/Flexget/Flexget/issues
- Did you fill out the issue template as completely as possible?

The issue template is here because it helps to ensure you submitted all the necessary information the first time, and allows us to more quickly review issues. Please fill it out correctly and do not ignore it, no matter how irrelevant you think it may be. Thanks in advance for your help with this!
--->
### Expected behaviour:
rtorrent returns the requested information

### Actual behaviour:
rtorrent returns an error that `d.multicall` is not defined

### Steps to reproduce:
- Step 1: Configure from_rtorrent for scgi

#### Config:
```
task:
  test_rtorrent:
    from_rtorrent:
      uri: scgi://rtorrent:5000
```
  
#### Log:
<details>
 <summary>(click to expand)</summary>

```
2018-10-21 18:46 DEBUG    task          test_rtorrent   executing test_rtorrent
2018-10-21 18:46 DEBUG    status        test_rtorrent   Adding new task test_rtorrent
2018-10-21 18:46 WARNING  task          test_rtorrent   Aborting task (plugin: from_rtorrent)
2018-10-21 18:46 DEBUG    task_queue                    task test_rtorrent aborted: TaskAbort(reason=Could not get torrents (main): <Fault -506: "Method 'd.multicall' not defined">, silent=False)
2018-10-21 18:46 DEBUG    task_queue                    task queue shut down
2018-10-21 18:46 INFO     ipc.rpyc                      listener closed
2018-10-21 18:46 INFO     ipc.rpyc                      server has terminated
2018-10-21 18:46 DEBUG    util.simple_persistence                 Flushing simple persistence for task None to db.
2018-10-21 18:46 DEBUG    manager                       Shutting down
2018-10-21 18:46 INFO     manager                       Removed test database
2018-10-21 18:46 DEBUG    manager                       Removed /home/xvicarious/repos/Flexget/.test-config-lock

```
</details>

### Additional information:

- FlexGet version: 2.17.0
- Python version: 3.6.6
- Installation method: docker
- Using daemon (yes/no): yes
- OS and version: Alpine 3.8
- Details about this migration [here](https://github.com/rakshasa/rtorrent/wiki/RPC-Migration-0.9#notes)

<!---
In config and debug/crash logs, remember to redact any personal or sensitive information such as passwords, API keys, private URLs and so on.

Please verify that the following data is present before submitting your issue:

- Link to a paste service or paste above the relevant config (preferably full config, including templates if present). Please make sure the paste does not expire, if possible.
- Link to a paste service or paste above debug-level logs of the relevant task/s (use `flexget -L debug execute --tasks <Task_name>`).
- FlexGet version (use `flexget -V` to get it).
- Full Python version, for example `2.7.11` (use `python -V` to get it). Note that FlexGet is not supported for use with Python v3.0, 3.1, 3.2 or 3.6.
- Installation method (pip, git install, etc).
- Whether or not you're running FlexGet as a daemon.
- OS and version.
- Attach crash log if one was generated, in addition to the debug-level log. It can be found in the directory with your config file.
--->



Discussion:
No longer?

There haven't been made any real changes to the plugin in ages
If the GitHub releases of rTorrent are accurate in their dates, this
happened in the end of 2011.

On Wed, Oct 31, 2018, 2:44 AM Claus Vium <notifications@github.com> wrote:

> No longer?
>
> There haven't been made any real changes to the plugin in ages
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/Flexget/Flexget/issues/2239#issuecomment-434578895>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AB0QvFjCf3OGKRQHsnW4X2G5YDYYhOSuks5uqUbSgaJpZM4Xytm4>
> .
>


Resolving patch:
diff --git a/flexget/plugins/clients/rtorrent.py b/flexget/plugins/clients/rtorrent.py
--- a/flexget/plugins/clients/rtorrent.py
+++ b/flexget/plugins/clients/rtorrent.py
@@ -302,7 +302,7 @@ def torrents(self, view='main', fields=None):
         params = ['d.%s=' % field for field in fields]
         params.insert(0, view)
 
-        resp = self._server.d.multicall(params)
+        resp = self._server.d.multicall2('', params)
 
         # Response is formatted as a list of lists, with just the values
         return [dict(list(zip(self._clean_fields(fields, reverse=True), val))) for val in resp]


Test patch: