musicfix 0.2.1 → 0.2.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 +4 -4
- data/CHANGELOG +4 -0
- data/README +1 -8
- data/bin/musicfix +3 -40
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e792b326cffb949b864fe9d5fbe45e6d06fc936
|
4
|
+
data.tar.gz: d7f1c5aa51cdbb2e33bbc6e07b19a7c486d8ab21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b69c1d74cb26bf528340ca8401e69a02fa0b0b0daa3425a90583f1b73e8cf6e1e2decf3b01eb53acf72e550ea992d1f778a92584c44de8dd757ad02f45da8dc0
|
7
|
+
data.tar.gz: 3a4f59622b7ff59c04a633fcd1c8732076c7d6cc7e867cd226dbdb8bedf67d7feafd45d7996cf9dad2e4986e7ab6fdbfae0d4b15ad6b78c8b7e0439bb6af5c7c
|
data/CHANGELOG
CHANGED
data/README
CHANGED
@@ -17,7 +17,7 @@ to the program. Enjoy!
|
|
17
17
|
# Usage
|
18
18
|
|
19
19
|
$ musicfix
|
20
|
-
Usage: musicfix [fake] relid
|
20
|
+
Usage: musicfix [fake] relid
|
21
21
|
musicfix [fake] dump relid [relfile]
|
22
22
|
musicfix [fake] load [relfile]
|
23
23
|
musicfix [fake] tags [relfile]
|
@@ -26,13 +26,6 @@ The common path is to just give the release id:
|
|
26
26
|
|
27
27
|
$ musicfix 1234
|
28
28
|
|
29
|
-
More sophisticated track selection can be performed by providing
|
30
|
-
a tracks selector command line argument of the form:
|
31
|
-
|
32
|
-
"1--3,5,8"
|
33
|
-
"A2--A4,B3"
|
34
|
-
"1-8--1-9,1-10--1-11"
|
35
|
-
|
36
29
|
Alternatively, YAML metadata files can be used (`release.yaml` by default)
|
37
30
|
in order to dump information from Discogs.com and/or load the information
|
38
31
|
from file. This way you can generate a base release file, edit to
|
data/bin/musicfix
CHANGED
@@ -24,7 +24,7 @@ def mkartist al
|
|
24
24
|
nl.join ' & '
|
25
25
|
end
|
26
26
|
|
27
|
-
# Convert "3" to (
|
27
|
+
# Convert "3" to ("", "03")
|
28
28
|
# Convert "A" to ("A", "1")
|
29
29
|
# Convert "A3" to ("A", "3")
|
30
30
|
# Convert "2.3" to ("2", "03")
|
@@ -35,7 +35,7 @@ def mkdiscnum pos
|
|
35
35
|
d, n = np.split '#'
|
36
36
|
if not n
|
37
37
|
n = d
|
38
|
-
d =
|
38
|
+
d = ''
|
39
39
|
else
|
40
40
|
d = d.gsub /\D/, ''
|
41
41
|
end
|
@@ -88,26 +88,6 @@ def getimages rel
|
|
88
88
|
imgs
|
89
89
|
end
|
90
90
|
|
91
|
-
# Construct position list from tracks filter
|
92
|
-
# The string "1--3,5,8" becomes ["1", "2", "3", "5", "8"]
|
93
|
-
# The string "A2--A4,B3" becomes ["A2", "A3", "A4", "B3"]
|
94
|
-
# The string "1-8--1-9,1-10--1-11" becomes ["1-8", "1-9", "1-10", "1-11"]
|
95
|
-
# Returns nil on error
|
96
|
-
def mkposlist tracks
|
97
|
-
pl = tracks.split(",").map do |r|
|
98
|
-
r = r.split("--")
|
99
|
-
return nil if r.include? ""
|
100
|
-
r = case r.length
|
101
|
-
when 1 then r
|
102
|
-
when 2 then (r[0] .. r[1]).map {|i| i}
|
103
|
-
else return nil
|
104
|
-
end
|
105
|
-
return nil if r.empty?
|
106
|
-
r
|
107
|
-
end
|
108
|
-
pl.flatten
|
109
|
-
end
|
110
|
-
|
111
91
|
# Formats we care about and their abbreviations
|
112
92
|
# http://www.discogs.com/search/#more_facets_format_exact
|
113
93
|
# Ignore "Vinyl" in favor of "LP"/"EP"/'7"'/'10"'/'12"' descriptions
|
@@ -184,7 +164,7 @@ end
|
|
184
164
|
|
185
165
|
# Parse command line
|
186
166
|
usage = ''
|
187
|
-
usage << "Usage: musicfix [fake] relid
|
167
|
+
usage << "Usage: musicfix [fake] relid\n"
|
188
168
|
usage << " musicfix [fake] dump relid [relfile]\n"
|
189
169
|
usage << " musicfix [fake] load [relfile]\n"
|
190
170
|
usage << " musicfix [fake] tags [relfile]\n"
|
@@ -201,7 +181,6 @@ when 'tags' then
|
|
201
181
|
relfile = ARGV[1] || 'release.yaml'
|
202
182
|
else
|
203
183
|
relid = ARGV[0]
|
204
|
-
tracks = ARGV[1] || nil
|
205
184
|
end
|
206
185
|
|
207
186
|
# Default configuration
|
@@ -337,19 +316,6 @@ else
|
|
337
316
|
end
|
338
317
|
# Tracklist can contain dummy header tracks, strip them
|
339
318
|
tl = r['tracklist'].select {|t| t['position'] != ''}
|
340
|
-
# Apply tracks filter if given
|
341
|
-
if tracks then
|
342
|
-
pl = mkposlist tracks
|
343
|
-
unless pl
|
344
|
-
STDERR.puts "Invalid tracks filter: #{tracks}"
|
345
|
-
exit 1
|
346
|
-
end
|
347
|
-
tl = tl.select {|t| pl.include? t['position']}
|
348
|
-
if tl.empty?
|
349
|
-
STDERR.puts "Filter returned no tracks: #{tracks}"
|
350
|
-
exit 1
|
351
|
-
end
|
352
|
-
end
|
353
319
|
# Gather release-wide data
|
354
320
|
rel = {}
|
355
321
|
rel['artist'] = mkartist r['artists']
|
@@ -363,9 +329,6 @@ else
|
|
363
329
|
if r['genres'] then r['genres'].first end
|
364
330
|
rel['format'] = mkformat r['formats'].first
|
365
331
|
rel['comment'] = "Discogs: #{r['id']}"
|
366
|
-
if tracks then
|
367
|
-
rel['comment'] += ", tracks: #{tracks}"
|
368
|
-
end
|
369
332
|
imgs = getimages(r)
|
370
333
|
rel['images'] = if imgs then imgs.first(cfg['nimg']) end
|
371
334
|
rel['tracklist'] = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: musicfix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lazaros Koromilas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stringex
|