number_tunes 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/number_tunes +4 -1
- data/number_tunes.gemspec +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: 8b265f10bd878f4881341883ec21a2d12f2f2ae2a5a265fd28a349b9e71e6472
|
4
|
+
data.tar.gz: e1a3842510f5cdb798c4c3d041dafba74fe4ded9c3125d04be513793831932b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e59d36c78cd4331baf8708156deb23b9838afaeccdc77ae3dd32ce96148c3eb1b51a79f5712d4cdd5357e65d58ffc954c9225a494ee58e2890aba6331c234b
|
7
|
+
data.tar.gz: 651fbe0754b7c7b1e92c2dbeb9ba27d1900535515733904ea69c7b882d26c478e12a18bf175e87fec5e70ecdffed06412b5a79802a5f07152e0319acdf893989
|
data/exe/number_tunes
CHANGED
@@ -12,18 +12,21 @@ Dir.glob("#{dir}/**/*.{mp3,m4a}") do |path|
|
|
12
12
|
TagLib::FileRef.open(path) do |fileref|
|
13
13
|
next if fileref.null?
|
14
14
|
tag = fileref.tag
|
15
|
+
changed = false
|
15
16
|
if tag.title && tag.track > 0
|
16
17
|
prefix = format("%02d ", tag.track)
|
17
18
|
if !tag.title.start_with?(prefix)
|
18
19
|
tag.title = prefix + tag.title
|
20
|
+
changed = true
|
19
21
|
end
|
20
22
|
end
|
21
23
|
if tag.album && tag.year > 0
|
22
24
|
prefix = format("%04d ", tag.year)
|
23
25
|
if !tag.album.start_with?(prefix)
|
24
26
|
tag.album = prefix + tag.album
|
27
|
+
changed = true
|
25
28
|
end
|
26
29
|
end
|
27
|
-
fileref.save
|
30
|
+
fileref.save if changed
|
28
31
|
end
|
29
32
|
end
|
data/number_tunes.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: number_tunes
|
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
|
- Shugo Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: taglib-ruby
|