transmission-rss 0.0.8 → 0.0.9

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.
@@ -3,6 +3,10 @@
3
3
  transmission-rss is basically a workaround for transmission's lack of the
4
4
  ability to monitor RSS feeds and automatically add enclosed torrent links.
5
5
 
6
+ It works with transmission-daemon and transmission-gtk (if the web frontend is
7
+ enabled in the settings dialog). Sites like seriesly.com and ezrss.it are suited
8
+ well as feed sources.
9
+
6
10
  As it's done with poems, I devote this very artful and romantic piece of code to
7
11
  the single most delightful human being: Ann.
8
12
 
@@ -51,6 +55,6 @@ and coult be omitted). The default +log_target+ is STDERR.
51
55
 
52
56
  == TODO
53
57
 
54
- * Timeout and error handling for aggregation and transmission communication
58
+ * Timeout and error handling in +Aggregator+ and +Client+
55
59
  * Drop privileges
56
60
  * Option to stop seeding after full download
@@ -1,7 +1,7 @@
1
1
  $:.unshift( File.dirname( __FILE__ ) )
2
2
 
3
3
  module TransmissionRSS
4
- VERSION = '0.0.8'
4
+ VERSION = '0.0.9'
5
5
  end
6
6
 
7
7
  Dir.glob( $:.first + '/**/*.rb' ).each do |file|
@@ -56,17 +56,17 @@ class TransmissionRSS::Aggregator
56
56
  end
57
57
 
58
58
  items.each do |item|
59
- item.links.each do |link|
59
+ link = item.link
60
+
61
+ if( link.class != String )
60
62
  link = link.href
63
+ end
61
64
 
62
- if( not seen?( link ) )
63
- on_new_item( link )
64
- @log.add( 'on_new_item event ' + link )
65
+ if( not seen?( link ) )
66
+ on_new_item( link )
67
+ @log.add( 'on_new_item event ' + link )
65
68
 
66
- add_seen( link )
67
- # else
68
- # @log.add( 'already seen ' + link )
69
- end
69
+ add_seen( link )
70
70
  end
71
71
  end
72
72
  end
@@ -12,12 +12,12 @@ class TransmissionRSS::Client
12
12
  @port = port
13
13
 
14
14
  @log = Log.instance
15
+
16
+ @sessionid = getSessionID
15
17
  end
16
18
 
17
19
  # Get transmission session id by simple GET.
18
20
  def getSessionID
19
- @log.add( 'getSessionID called' )
20
-
21
21
  get = Net::HTTP::Get.new(
22
22
  '/transmission/rpc'
23
23
  )
@@ -49,13 +49,11 @@ class TransmissionRSS::Client
49
49
 
50
50
  # POST json packed torrent add command.
51
51
  def addTorrent( torrentFile, paused = false )
52
- @log.add( 'addTorrent called' )
53
-
54
52
  post = Net::HTTP::Post.new(
55
53
  '/transmission/rpc',
56
54
  initheader = {
57
55
  'Content-Type' => 'application/json',
58
- 'X-Transmission-Session-Id' => getSessionID
56
+ 'X-Transmission-Session-Id' => @sessionid
59
57
  }
60
58
  )
61
59
 
@@ -38,7 +38,7 @@ class TransmissionRSS::Log
38
38
  @target.puts( line )
39
39
  end
40
40
 
41
- sleep( 0.5 )
41
+ sleep( 0.1 )
42
42
  end
43
43
  end
44
44
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transmission-rss
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - henning mueller