id3tag 0.14.2 → 1.0.0
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/id3tag/frames/v2/text_frame.rb +9 -1
- data/lib/id3tag/string_util.rb +8 -0
- data/lib/id3tag/unsynchronization.rb +3 -3
- data/lib/id3tag/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 011333bf23567c8f51e7229c2c821acda9666e31c40d5b39a93ad2c5a226134d
|
4
|
+
data.tar.gz: 077f4efc53c1fca9760a893b1b70bf94a157ce1b20e6079d5be743e9576abbaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b8d016a28c5e7e1b1438b64db2e615071bb107ee4b163b8d96002d11081e45dc47d2119d2aad30d66eb9c06d6649a61f951c271766ce17513aefa7c136e60cd
|
7
|
+
data.tar.gz: 5551c6c5bf45487f82489781dc6ff287bcbb73a248e95a81a1f8886bcdf8c51bf71fe6ee6fb870639508fa77c834a4e26736293a7c6c0cd1aa7386cc64342f2e
|
@@ -11,7 +11,15 @@ module ID3Tag
|
|
11
11
|
}
|
12
12
|
|
13
13
|
def content
|
14
|
-
@content ||=
|
14
|
+
@content ||= if @major_version_number >= 4
|
15
|
+
StringUtil.chomp_null_byte(encoded_content)
|
16
|
+
else
|
17
|
+
StringUtil.cut_at_null_byte(encoded_content)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def contents
|
22
|
+
@contents ||= StringUtil.split_by_null_bytes(content)
|
15
23
|
end
|
16
24
|
|
17
25
|
def inspectable_content
|
data/lib/id3tag/string_util.rb
CHANGED
@@ -40,5 +40,13 @@ module ID3Tag
|
|
40
40
|
end
|
41
41
|
[before.pack(UTF_8_DIRECTIVE), after.pack(UTF_8_DIRECTIVE)]
|
42
42
|
end
|
43
|
+
|
44
|
+
def self.split_by_null_bytes(string)
|
45
|
+
string.split(NULL_BYTE)
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.chomp_null_byte(string)
|
49
|
+
string.chomp(NULL_BYTE)
|
50
|
+
end
|
43
51
|
end
|
44
52
|
end
|
@@ -10,7 +10,7 @@ module ID3Tag
|
|
10
10
|
current_byte = input_bytes.next
|
11
11
|
output_bytes << current_byte
|
12
12
|
next_byte = input_bytes.peek
|
13
|
-
if (current_byte == 255) && (next_byte
|
13
|
+
if (current_byte == 255) && ((next_byte >= 224) || (next_byte == 0))
|
14
14
|
output_bytes << 0
|
15
15
|
end
|
16
16
|
end
|
@@ -20,8 +20,8 @@ module ID3Tag
|
|
20
20
|
prev_byte = nil
|
21
21
|
loop do
|
22
22
|
current_byte = input_bytes.next
|
23
|
-
next_byte = input_bytes.peek rescue
|
24
|
-
unless (prev_byte == 255) && (current_byte == 0) && (next_byte
|
23
|
+
next_byte = input_bytes.peek rescue nil
|
24
|
+
unless (prev_byte == 255) && (current_byte == 0) && (next_byte != nil) && ((next_byte >= 224) || (next_byte == 0))
|
25
25
|
output_bytes << current_byte
|
26
26
|
end
|
27
27
|
prev_byte = current_byte
|
data/lib/id3tag/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: id3tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krists Ozols
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
|
-
rubygems_version: 3.3.
|
178
|
+
rubygems_version: 3.3.5
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Native Ruby ID3 tag reader that aims for 100% coverage of ID3v2.x and ID3v1.x
|