rtorrent_xmlrpc 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ae000db9daac6192dce5cf98cc2c8d974d42b7c
4
- data.tar.gz: 584a8a6dead03963572ef365a663a74443e84955
3
+ metadata.gz: daca72ab047033fdbdb755df64975cbf3ec9fb83
4
+ data.tar.gz: 19f9811596b204dbef819081946ccd98d15044f2
5
5
  SHA512:
6
- metadata.gz: 38942789a53713954eada8eec5e817a834b3b980aac312c21ecebd0d6b476e089089e9a202e85a9567d89447c48b005d9d7471c8f2bc98014ac56178485cac14
7
- data.tar.gz: 13e72a2aaee74129a9f2f661965159dd581b5b2910487018460f4e43ada857a58e9ddc85a828b500475e17e7bf81ade9a533d2214a97378ce1614b5db06853c1
6
+ metadata.gz: 7444dae6f5fa0678b77b5937cfb08f137037a7658975f5abcf04749d197a0e42ff7e66152c6ae93cc9b35cab40273b52d85cdc6c6096111347ee89636df8a4bd
7
+ data.tar.gz: b2b992429973f84dfcc44fed4a7579627134571c91d476797014ed8f45a6995ec5eb4208e4dbd4508d63a92752ef3ab1d94ca99165f8228ce6ee6969506cf9be
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rtorrent_xmlrpc (0.2.0)
4
+ rtorrent_xmlrpc (0.2.1)
5
5
  colorize (~> 0.7, >= 0.7.7)
6
6
  filesize (~> 0.1, >= 0.1.0)
7
7
  hashie (~> 3.4, >= 3.4.2)
data/bin/rtorrent_xmlrpc CHANGED
@@ -32,7 +32,7 @@ class RTorrent_XMLRPC < Thor
32
32
  if options[:json]
33
33
  puts torrents.to_json
34
34
  else
35
- torrents.each { |torrent| torrent.pp }
35
+ torrents.each { |torrent| torrent.pp(true) }
36
36
  end
37
37
  end
38
38
  end
@@ -84,8 +84,8 @@ module RTorrent
84
84
  torrent.name = stats[1]
85
85
  torrent.labels = stats[2]
86
86
  torrent.completed = stats[3] == 1 ? true : false
87
- torrent.base_filename = stats[4]
88
- torrent.base_path = stats[5]
87
+ torrent.base_filename = stats[4].gsub(/^#{@trim_suffix}/, '')
88
+ torrent.base_path = stats[5].gsub(/^#{@trim_suffix}/, '')
89
89
  torrent.is_multi_file = stats[6] == 1 ? true: false
90
90
  torrent.tied_to_file = stats[7]
91
91
  torrent.size = stats[8]
@@ -93,7 +93,7 @@ module RTorrent
93
93
  torrent.up_total = stats[10]
94
94
  torrent.ratio = stats[11].to_f / 1000
95
95
  torrent.priority = stats[12]
96
- torrent.files = @server.call('f.multicall', torrent.hash, '', 'f.get_path=').flatten
96
+ torrent.files = @server.call('f.multicall', torrent.hash, '', 'f.get_path=').flatten.map { |file| file.gsub(/^#{@trim_suffix}/, '') }
97
97
  @torrents << torrent
98
98
  end
99
99
  end
@@ -113,6 +113,10 @@ module RTorrent
113
113
  @server.call('d.stop', hash)
114
114
  end
115
115
 
116
+ # Set the custom1 (label) field for a torrent
117
+ def set_labels(hash, labels)
118
+ @server.call('d.set_custom1', hash, labels)
119
+ end
116
120
  end
117
121
 
118
122
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'rtorrent_xmlrpc'
3
- s.version = '0.2.1'
3
+ s.version = '0.2.2'
4
4
  s.date = '2015-07-03'
5
5
  s.summary = 'A library and tool to query an rtorrent xmlrpc service.'
6
6
  s.description = 'This is a library to get torrent information from a remote rtorrent server.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtorrent_xmlrpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zan Loy
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.4.5
131
+ rubygems_version: 2.4.8
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: A library and tool to query an rtorrent xmlrpc service.