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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +4 -0
  3. data/README +1 -8
  4. data/bin/musicfix +3 -40
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 890508a345aad8d9c26c1e50dff7faa6cb7d2faf
4
- data.tar.gz: 99be89b678262a674b6bbcc4d224fa6c2828ceb6
3
+ metadata.gz: 3e792b326cffb949b864fe9d5fbe45e6d06fc936
4
+ data.tar.gz: d7f1c5aa51cdbb2e33bbc6e07b19a7c486d8ab21
5
5
  SHA512:
6
- metadata.gz: da02657a8cb1253c02f83b925678e3c7f825add8fdc8ed846544547b6a6cfbfd531308a3b94c6ba000ee13578faacb15cce5cf3bfbbee4916c9dc564cdaaaadc
7
- data.tar.gz: a0fb94bb582aa3ca6bfa478e9fca35cd30f36cb7e620669488854285786197d34adb5535d0b39fedfabc50f114c2e0385ca1616e9b9e9a5dc108f5b5c0cba508
6
+ metadata.gz: b69c1d74cb26bf528340ca8401e69a02fa0b0b0daa3425a90583f1b73e8cf6e1e2decf3b01eb53acf72e550ea992d1f778a92584c44de8dd757ad02f45da8dc0
7
+ data.tar.gz: 3a4f59622b7ff59c04a633fcd1c8732076c7d6cc7e867cd226dbdb8bedf67d7feafd45d7996cf9dad2e4986e7ab6fdbfae0d4b15ad6b78c8b7e0439bb6af5c7c
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.2
2
+ * Fix a numbering bug
3
+ * Removed tracks filtering
4
+
1
5
  ## 0.2.1
2
6
  * Updated license and license identifier in gem.
3
7
 
data/README CHANGED
@@ -17,7 +17,7 @@ to the program. Enjoy!
17
17
  # Usage
18
18
 
19
19
  $ musicfix
20
- Usage: musicfix [fake] relid [tracks]
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
@@ -24,7 +24,7 @@ def mkartist al
24
24
  nl.join ' & '
25
25
  end
26
26
 
27
- # Convert "3" to (nil, "03")
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 = nil
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 [tracks]\n"
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.1
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-08 00:00:00.000000000 Z
11
+ date: 2017-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stringex