id3_tags 0.0.7 → 0.0.8
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/lib/id3_tags/m4a/fields_setter.rb +18 -1
- data/lib/id3_tags/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 802c7ffb439a67bb25e01809ad5388b80e607fdd
|
4
|
+
data.tar.gz: 8eafdba8abc7a6df7667285360e7e5d363c4ef71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d02baad053437c9b1a22498f074e1b7d22501d721189a8b407a2d8a7b99956def9b2e30349387c13f7e4143f5682d96abcb4cdf0155b0876e6b74bcc42b353a0
|
7
|
+
data.tar.gz: e61c8bc9e55d4dc446ab9ed24f555519da65b94db4bb0818962263f509b549b62116b232306dee508ad5d7cbd2914496a8095f9364e7815228adfa8fb1149d9b
|
@@ -23,7 +23,8 @@ module Id3Tags
|
|
23
23
|
TagLib::MP4::Item.from_bool content
|
24
24
|
when :pair
|
25
25
|
return unless content[:number]
|
26
|
-
|
26
|
+
pair = content.values_at :number, :count
|
27
|
+
TagLib::MP4::Item.from_int_pair int_pair_for(pair)
|
27
28
|
when :image
|
28
29
|
return unless content[:data]
|
29
30
|
mime_type = case content[:mime_type]
|
@@ -35,5 +36,21 @@ module Id3Tags
|
|
35
36
|
TagLib::MP4::Item.from_cover_art_list [cover_art]
|
36
37
|
end
|
37
38
|
end
|
39
|
+
|
40
|
+
# Return a *valid* int pair to build a TagLib::MP4::Item object
|
41
|
+
#
|
42
|
+
# @param [Array] pair an array of two elements
|
43
|
+
# @return [Array] a valid pair to use in TagLib::MP4::Item.from_int_pair
|
44
|
+
#
|
45
|
+
# @example int_pair_for([1, 2)] #=> [1, 2]
|
46
|
+
# @example int_pair_for([0, nil)] #=> [0, 0]
|
47
|
+
#
|
48
|
+
# @note This function helps writing tags with pairs that only have one
|
49
|
+
# value set. A common case is tracks with a *track number* and
|
50
|
+
# without a *track count*. This information is stored in M4A files
|
51
|
+
# by setting the *track count* to 0 (and not to 'nil').
|
52
|
+
def int_pair_for(pair)
|
53
|
+
pair.map{|n| n || 0}
|
54
|
+
end
|
38
55
|
end
|
39
56
|
end
|
data/lib/id3_tags/version.rb
CHANGED