music_metadata_score 0.0.1 → 0.0.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 +8 -8
- data/lib/music_metadata_score/score.rb +17 -6
- data/lib/music_metadata_score/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmI2MWM0YTY1ZGViNzc4ZmNhYTk0ZDYyYzNiM2JlYWVjNTlhOWE5ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZWZjMTM2OGFhMGRkMGNlMWQyMGQ4YjMyNjIzZDdjNTEyYjE5ZTFiNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmQ2Y2IzYWY0NjgyMjdiOTVkMjc5MGU1NTBkNGI5MGE0ZTc5NmM0YTg3MWI0
|
10
|
+
NDhlMWQwZmVhYTAxNjNlMTI1MGNiYzNhOTljZjM2YzE3MjBkNWI3MTRiNzk4
|
11
|
+
ZDAzOWNiYWU5MTllNmRiOGVhMGRkMDM5MWUzMDg3NDEzYWIxYWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzhiZGMyOWIwNDA1MTk5MWRjNGVhNGVmYWQxZjQyNTUxMmM0ZWI3MzkyYmY3
|
14
|
+
MGU3NjUzMDViOWRmNTBiY2NkMjFhZTAwZGE5NTAxOWRlOTViOTRmMzliOWZi
|
15
|
+
NjJmMzcwYmM0NGQ1YmMyZGVhMzEzZTA4ZDNiM2IxMGY1OTk2ZWI=
|
@@ -1,5 +1,4 @@
|
|
1
1
|
class Score
|
2
|
-
# Errors
|
3
2
|
|
4
3
|
# Product level scores
|
5
4
|
def self.product_score(metadata)
|
@@ -178,7 +177,7 @@ class Score
|
|
178
177
|
corrected_metadata = Score.product_fields_corrected(metadata)
|
179
178
|
metadata.each do |m|
|
180
179
|
error = Score.missing_or_corrected(m[0].to_s, m[1], corrected_metadata[m[0]])
|
181
|
-
array << error if error
|
180
|
+
array << "Product " + error if error
|
182
181
|
end
|
183
182
|
array
|
184
183
|
end
|
@@ -205,14 +204,26 @@ class Score
|
|
205
204
|
end
|
206
205
|
|
207
206
|
def self.missing_or_corrected(field, original, corrected)
|
208
|
-
|
209
|
-
|
207
|
+
field = Score.format_field_name(field)
|
208
|
+
is_or_are = Score.is_or_are(field)
|
209
|
+
if original && original != "" && original != [] || original == false
|
210
|
+
if original == corrected || corrected == ''
|
211
|
+
nil
|
212
|
+
else
|
213
|
+
"#{field} #{is_or_are} incorrect. It should be #{corrected}"
|
214
|
+
end
|
215
|
+
elsif field == 'Version' || field == 'Featuring Artists'
|
210
216
|
nil
|
211
217
|
else
|
212
|
-
"#{
|
218
|
+
"#{field} #{is_or_are} missing"
|
213
219
|
end
|
220
|
+
end
|
221
|
+
|
222
|
+
def self.is_or_are(field)
|
223
|
+
if field[field.length - 1].downcase == 's'
|
224
|
+
'are'
|
214
225
|
else
|
215
|
-
|
226
|
+
'is'
|
216
227
|
end
|
217
228
|
end
|
218
229
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: music_metadata_score
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tomallen400
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|