Skip to content

Commit

Permalink
Normalise tag names, use boxed Length (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
devoxin committed Apr 27, 2024
1 parent 9f36aad commit 588b0ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class OggMetadata implements AudioTrackInfoProvider {
private static final String ARTIST_FIELD = "ARTIST";

private final Map<String, String> tags;
private final long length;
private final Long length;

/**
* @param tags Map of OGG metadata with OGG-specific keys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import static java.nio.charset.StandardCharsets.UTF_8;
Expand Down Expand Up @@ -54,7 +55,7 @@ public static Map<String, String> parse(ByteBuffer tagBuffer, boolean truncated)
private static void storeTagToMap(Map<String, String> tags, byte[] data) {
for (int i = 0; i < data.length; i++) {
if (data[i] == '=') {
tags.put(new String(data, 0, i, UTF_8), new String(data, i + 1, data.length - i - 1, UTF_8));
tags.put(new String(data, 0, i, UTF_8).toUpperCase(Locale.ROOT), new String(data, i + 1, data.length - i - 1, UTF_8));
break;
}
}
Expand Down

0 comments on commit 588b0ad

Please sign in to comment.