metal_archives 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/metal_archives/models/artist.rb +1 -1
- data/lib/metal_archives/models/band.rb +1 -1
- data/lib/metal_archives/models/base.rb +10 -3
- data/lib/metal_archives/models/release.rb +1 -1
- data/lib/metal_archives/parsers/artist.rb +1 -1
- data/lib/metal_archives/parsers/band.rb +1 -1
- data/lib/metal_archives/parsers/genre.rb +1 -1
- data/lib/metal_archives/parsers/parser.rb +2 -0
- data/lib/metal_archives/parsers/year.rb +2 -0
- data/lib/metal_archives/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39ec01fd7f1c69fc54d794cd58693912fd4c1ece0ca6f70c4281ba3b3d7cad4c
|
4
|
+
data.tar.gz: d518c8a15a0e5a9fbb26565696aeead06435a06f12dafcd586b54a4c50be5f3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15cf3a9ae549ff1a43aae068a83b16287c7a70ad95ee176e41dbccac78fe0884031bfff6ec1a4cdda098b7dcbcc7b720b1087cfd9fa3a6da39a766b805321720
|
7
|
+
data.tar.gz: f4738548bd36c4af3e97e6a666df23861a3a2bc969a1148d66fccf9cd2d404593f1fb77b3a63a61fa9f1a0325dd754173a7763424653c271abdbefcf201f2817
|
data/CHANGELOG.md
CHANGED
@@ -43,10 +43,10 @@ module MetalArchives
|
|
43
43
|
set(**assemble)
|
44
44
|
|
45
45
|
@loaded = true
|
46
|
-
MetalArchives.cache[id] = self
|
46
|
+
MetalArchives.cache[self.class.cache(id)] = self
|
47
47
|
rescue StandardError => e
|
48
48
|
# Don't cache invalid requests
|
49
|
-
MetalArchives.cache.delete id
|
49
|
+
MetalArchives.cache.delete self.class.cache(id)
|
50
50
|
raise e
|
51
51
|
end
|
52
52
|
|
@@ -61,7 +61,7 @@ module MetalArchives
|
|
61
61
|
# Whether or not the object is currently cached
|
62
62
|
#
|
63
63
|
def cached?
|
64
|
-
loaded? && MetalArchives.cache.include?(id)
|
64
|
+
loaded? && MetalArchives.cache.include?(self.class.cache(id))
|
65
65
|
end
|
66
66
|
|
67
67
|
##
|
@@ -94,6 +94,13 @@ module MetalArchives
|
|
94
94
|
@properties ||= {}
|
95
95
|
end
|
96
96
|
|
97
|
+
##
|
98
|
+
# Generate cache key for id
|
99
|
+
#
|
100
|
+
def cache(id)
|
101
|
+
"#{self.class.name}//#{id}"
|
102
|
+
end
|
103
|
+
|
97
104
|
protected
|
98
105
|
|
99
106
|
##
|
@@ -115,7 +115,7 @@ module MetalArchives
|
|
115
115
|
r = row.css(".member_in_band_role")
|
116
116
|
|
117
117
|
range = Parsers::Year.parse(r.xpath("text()").map(&:content).join.strip.gsub(/[\n\r\t]/, "").gsub(/.*\((.*)\)/, '\1'))
|
118
|
-
role = sanitize r.css("strong")
|
118
|
+
role = sanitize r.css("strong")&.first&.content
|
119
119
|
|
120
120
|
{
|
121
121
|
id: id,
|
@@ -25,7 +25,7 @@ module MetalArchives
|
|
25
25
|
def self.parse(input)
|
26
26
|
genres = []
|
27
27
|
# Split fields
|
28
|
-
input.split(
|
28
|
+
input.split(/[,;]/).each do |genre|
|
29
29
|
##
|
30
30
|
# Start with a single empty genre string. Split the genre by spaces
|
31
31
|
# and process each component. If a component does not have a slash,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metal_archives
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Dejonckheere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: countries
|