transmission-rss 1.2.0 → 1.2.1
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 +4 -4
- data/lib/transmission-rss/seen_file.rb +9 -30
- data/lib/transmission-rss/version.rb +1 -1
- metadata +26 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e93a561f40bd628318cf507101b393624547251369fc6cc0557f280afaabf194
|
|
4
|
+
data.tar.gz: f743d335aac56c1130ae2fd6c85f6d6a2f8ee0cd91ad8128df0309d97b880de9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
14
|
-
@legacy_path = legacy_path || default_legacy_path
|
|
15
|
-
@path = path || default_path
|
|
11
|
+
def_delegators :@seen, :size, :to_a
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
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?(
|
|
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.
|
|
58
|
+
FileUtils.mkdir_p(File.dirname(path))
|
|
59
|
+
FileUtils.touch(path)
|
|
81
60
|
end
|
|
82
61
|
end
|
|
83
62
|
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.
|
|
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:
|
|
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.
|
|
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: []
|