Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OGG metadata extraction #101

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading