deluge-rpc 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48dc5778e785c4c3d33e6d6346cb5611697df894cac0876a353aca0df205564a
4
- data.tar.gz: b37ffe6f233367b2fc14c53c66f5f20e6ee485c4c9dfc0828777d081e249c2e5
3
+ metadata.gz: fae94aca88e0cdf01efdc40596aea1d07b24d48d475f7302723bf82abdeb7a64
4
+ data.tar.gz: ffa497496c6caa1027eab7dde89a6676df48a34634344c109863cf974509f4b3
5
5
  SHA512:
6
- metadata.gz: '04995d0ba11452edd757ffff2a3a04fa60acf97db735aa74996d9c6a8af7f2eaeffc83c44ed3f8798ddaf24a90bd59e13b1c33e55d072d095a3af7fa70ea1687'
7
- data.tar.gz: a974c420628b8415bc9dcf0f48c71c41b77a07e825d321f4f4294c752d2f4bf074da42220d2082cf35ab42849dc3b4b6cc4807fcf6ea8e0cd27b6503d54eca86
6
+ metadata.gz: f670476d2ab81393c6b0db0393293c1ca2e4db7c3170bf19c7d17d623e3596447b5e622b4ad5287e9dde8e4c38a3f027f7a909f608f35267788b65c05e9b442e
7
+ data.tar.gz: 4fde233a805d65cccde068bf7838a2407682902ecb88bb42e9d1454dd67f0153e94703a75d984fd62aa7337dc34b5bf8e1628e65d293e87133140e3a99a4cd76
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 3.0.3
data/README.md CHANGED
@@ -1,16 +1,19 @@
1
1
  # Deluge::RPC
2
2
 
3
- Ruby RPC client library for Deluge 2.0+ torrent client.
4
- Provides dynamic API bindings depending on RPC server.
3
+ Ruby RPC client library for [Deluge 2.0+ torrent client](https://deluge-torrent.org/).
4
+ Provides dynamic API bindings depending on RPC server.
5
5
  Multi-threading friendly, thanks to ``concurrent-ruby`` gem.
6
6
 
7
- Deluge 1.x is not supported anymore.
7
+ *Deluge 1.x is not supported anymore*.
8
8
 
9
- Official RPC protocol documentation:
10
- https://deluge.readthedocs.io/en/latest/reference/rpc.html
9
+ ## Reference
11
10
 
12
- Deluge RPC API reference:
13
- https://deluge.readthedocs.io/en/latest/reference/api.html
11
+ * [Official RPC protocol documentation](https://deluge.readthedocs.io/en/latest/reference/rpc.html)
12
+ * [Deluge RPC API reference](https://deluge.readthedocs.io/en/latest/reference/api.html)
13
+ * [Official repository](https://github.com/deluge-torrent/deluge)
14
+ * Other client implementations:
15
+ [Go](https://github.com/gdm85/go-libdeluge),
16
+ [Python](https://github.com/JohnDoee/deluge-client)
14
17
 
15
18
  ## Usage
16
19
 
@@ -74,10 +77,10 @@ client.register_event(:torrent_removed) do |torrent_id|
74
77
  end
75
78
  ```
76
79
 
77
- Unfortunately there is no way to listen ALL events, due to Deluge architecture.
80
+ Unfortunately there is no way to listen ALL events, due to Deluge architecture.
78
81
  You have to register each event you need.
79
82
 
80
- **Keep in mind event blocks would be executed in connection thread, NOT main thread!**
83
+ **Keep in mind event blocks would be executed in connection thread, NOT main thread!**
81
84
  Avoid time-consuming code!
82
85
 
83
86
  ### Known events
@@ -102,7 +105,7 @@ Avoid time-consuming code!
102
105
  ``PluginEnabledEvent`` | name | Plugin is enabled in the Core.
103
106
  ``PluginDisabledEvent`` | name | Plugin is disabled in the Core.
104
107
 
105
- This list was extracted from Deluge 1.3.11 sources. Events for your version could be different.
108
+ This list was extracted from Deluge 1.3.11 sources. Events for your version could be different.
106
109
  There is no official documentation.
107
110
 
108
111
  Current events could be found here:
@@ -118,8 +121,12 @@ gem 'deluge-rpc'
118
121
 
119
122
  And then execute:
120
123
 
121
- $ bundle
124
+ ```shell
125
+ $ bundle
126
+ ```
122
127
 
123
128
  Or install it yourself as:
124
129
 
125
- $ gem install deluge-rpc
130
+ ```shell
131
+ $ gem install deluge-rpc
132
+ ```
@@ -67,7 +67,7 @@ module Deluge
67
67
  end
68
68
 
69
69
  def authenticate(login, password)
70
- self.call(DAEMON_LOGIN, login, password)
70
+ self.call(DAEMON_LOGIN, [login, password, {'client_version' => Deluge::Rpc::VERSION.to_s}])
71
71
  end
72
72
 
73
73
  def method_list
@@ -93,7 +93,10 @@ module Deluge
93
93
  raise "Not connected!" unless @connection
94
94
 
95
95
  kwargs = {}
96
- kwargs = args.pop if args.size == 1 && args.last.is_a?(Hash)
96
+ if args.size == 1 && args[0].last.is_a?(Hash)
97
+ kwargs = args[0].pop
98
+ args = args[0]
99
+ end
97
100
 
98
101
  future = Concurrent::IVar.new
99
102
 
@@ -189,7 +192,10 @@ module Deluge
189
192
 
190
193
  raise('Received response with unknown protocol_version=' + protocol_version) if protocol_version != PROTOCOL_VERSION
191
194
 
192
- raw = socket.readpartial(buffer_size)
195
+ # a big response requires some extra reads because deluged may be
196
+ # slow to generate and send all the data through the socket
197
+ raw += socket.readpartial(buffer_size - raw.bytesize) while raw.bytesize < buffer_size
198
+
193
199
  raw = Zlib::Inflate.inflate(raw)
194
200
 
195
201
  parse_packets(raw)
@@ -1,5 +1,5 @@
1
1
  module Deluge
2
2
  module Rpc
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deluge-rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Yamolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-08 00:00:00.000000000 Z
11
+ date: 2023-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 3.1.4
125
+ rubygems_version: 3.2.32
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Deluge RPC protocol wrapper