transmission-rss 1.2.0 → 1.2.1

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: 6f26bb03512a57f35a06bfccceb95883c33b7338af3d00420a017d4b64f80a5d
4
- data.tar.gz: 6ab7a09ef74a105b0621325fc2d07562c3f9f6d960ac6ddddb1bd08b0e82c07a
3
+ metadata.gz: e93a561f40bd628318cf507101b393624547251369fc6cc0557f280afaabf194
4
+ data.tar.gz: f743d335aac56c1130ae2fd6c85f6d6a2f8ee0cd91ad8128df0309d97b880de9
5
5
  SHA512:
6
- metadata.gz: 96941ea4244382e2410e90b087262894441bfaa8c8f6236807c03396d2218ea692446b85c96db52607ce196757e5a230e8730ce366f97d5c39c78632648f16b9
7
- data.tar.gz: c7fa37fb891daf7d9afd40f178ec0cf2aba1e7db3d067fa5ca3ffd657577653356ca9f5423a7351e137529416b967f97ded8b63a5b84d8b82b5b2e40b1b2163a
6
+ metadata.gz: af81937243076628a610f49f6f28dfccbfeba3377964705c976e870f1e9c496ae9c03c50d16fb834823ccb258ccbe78bafd33502670e49900935ab1f0971d81f
7
+ data.tar.gz: c0e00180d4c23177d92d004ca08a8b53a40cb22bd09e6e3231acc7f0b60865c1750e236f72bcbc58aa1935193dd6364e82ef8ff408c1edc7af41c99e12e299b1
@@ -7,22 +7,19 @@ module TransmissionRSS
7
7
  # Persist seen torrent URLs
8
8
  class SeenFile
9
9
  extend ::Forwardable
10
-
11
- def_delegators :@seen, :size, :to_a
12
10
 
13
- def initialize(path = nil, legacy_path = nil)
14
- @legacy_path = legacy_path || default_legacy_path
15
- @path = path || default_path
11
+ def_delegators :@seen, :size, :to_a
16
12
 
17
- initialize_path!
18
- migrate!
13
+ def initialize(path = nil)
14
+ @path = path || default_path
15
+ initialize_path!(@path)
19
16
 
20
17
  @seen = Set.new(file_to_array(@path))
21
18
  end
22
19
 
23
20
  def add(url)
24
21
  hash = digest(url)
25
-
22
+
26
23
  return if @seen.include?(hash)
27
24
 
28
25
  @seen << hash
@@ -43,10 +40,6 @@ module TransmissionRSS
43
40
 
44
41
  private
45
42
 
46
- def default_legacy_path
47
- File.join(Etc.getpwuid.dir, '.config/transmission/seen-torrents.conf')
48
- end
49
-
50
43
  def default_path
51
44
  File.join(Etc.getpwuid.dir, '.config/transmission/seen')
52
45
  end
@@ -59,25 +52,11 @@ module TransmissionRSS
59
52
  open(path, 'r').readlines.map(&:chomp)
60
53
  end
61
54
 
62
- def initialize_path!
63
- return if File.exist?(@path)
64
-
65
- FileUtils.mkdir_p(File.dirname(@path))
66
- FileUtils.touch(@path)
67
- end
68
-
69
- def migrate!
70
- return unless File.exist?(@legacy_path)
71
-
72
- legacy_seen = file_to_array(@legacy_path)
73
- hashes = legacy_seen.map { |url| digest(url) }
74
-
75
- open(@path, 'w') do |f|
76
- f.write(hashes.join("\n"))
77
- f.write("\n")
78
- end
55
+ def initialize_path!(path)
56
+ return if File.exist?(path)
79
57
 
80
- FileUtils.rm_f(@legacy_path)
58
+ FileUtils.mkdir_p(File.dirname(path))
59
+ FileUtils.touch(path)
81
60
  end
82
61
  end
83
62
  end
@@ -1,3 +1,3 @@
1
1
  module TransmissionRSS
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transmission-rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - henning mueller
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-22 00:00:00.000000000 Z
11
+ date: 2021-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rss
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.2.9
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.2.9
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: open_uri_redirections
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +102,7 @@ homepage: https://rubygems.org/gems/transmission-rss
82
102
  licenses:
83
103
  - GPL-3.0
84
104
  metadata: {}
85
- post_install_message:
105
+ post_install_message:
86
106
  rdoc_options: []
87
107
  require_paths:
88
108
  - lib
@@ -97,8 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
117
  - !ruby/object:Gem::Version
98
118
  version: '0'
99
119
  requirements: []
100
- rubygems_version: 3.1.2
101
- signing_key:
120
+ rubygems_version: 3.2.22
121
+ signing_key:
102
122
  specification_version: 4
103
123
  summary: Adds torrents from rss feeds to transmission web frontend.
104
124
  test_files: []