Compare commits

..

No commits in common. "2809f9e4952878ff15a3c011b87006e12a122fde" and "f3b9075a820fe2754a2132e0c324e3ad0e8a75cb" have entirely different histories.

4 changed files with 2 additions and 14 deletions

View File

@ -129,15 +129,3 @@ pub fn detect_audio_type(buffer: &[u8]) -> Result<AudioType, AudioError> {
Ok(AudioType::Unknown)
}
#[cfg(test)]
mod tests {
use crate::{detect_audio_type, AudioType};
#[test]
fn test_mp3() {
let mp3_data = include_bytes!("__fixtures__/mp3_with_id3v2.bin");
let result = detect_audio_type(mp3_data).expect("failed to parse mp3");
assert_eq!(result, AudioType::MP3);
}
}

View File

@ -67,7 +67,7 @@ fn get_ape_v2_size(buffer: &[u8], offset: usize) -> Result<usize, AudioError> {
pub fn get_header_metadata_size(buffer: &[u8], offset: usize) -> Result<usize, AudioError> {
let len = get_id3_header_size(buffer, offset)?;
if len != 0 {
if len == 0 {
Ok(len)
} else {
get_ape_v2_size(buffer, offset)

View File

@ -1,6 +1,6 @@
{
"name": "@unlock-music/crypto",
"version": "0.0.0-alpha.8",
"version": "0.0.0-alpha.7",
"description": "Project Unlock Music: 加解密支持库",
"scripts": {
"build": "node build.js",