From 94f8aac8407ab37322e3f255447e80dec2fb5f28 Mon Sep 17 00:00:00 2001 From: Keita Kita Date: Thu, 23 Feb 2023 20:25:32 +0900 Subject: [PATCH] ID3v2: Change default number from 1 to 0 for track and disk --- src/id3/v2/tag.rs | 2 +- tests/files/mpeg.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/id3/v2/tag.rs b/src/id3/v2/tag.rs index 7f626346..0bcd46d7 100644 --- a/src/id3/v2/tag.rs +++ b/src/id3/v2/tag.rs @@ -27,7 +27,7 @@ const V4_MULTI_VALUE_SEPARATOR: char = '\0'; const NUMBER_PAIR_SEPARATOR: char = '/'; // This is used as the default number of track and disk. -const DEFAULT_NUMBER_IN_PAIR: u32 = 1; +const DEFAULT_NUMBER_IN_PAIR: u32 = 0; // These keys have the part of the number pair. const NUMBER_PAIR_KEYS: &[ItemKey] = &[ diff --git a/tests/files/mpeg.rs b/tests/files/mpeg.rs index 0e0ff9da..02440b38 100644 --- a/tests/files/mpeg.rs +++ b/tests/files/mpeg.rs @@ -240,9 +240,9 @@ fn save_total_of_track_and_disk_to_id3v2() { let tag = tagged_file.tag(TagType::ID3v2).unwrap(); - assert_eq!(tag.track().unwrap(), 1); + assert_eq!(tag.track().unwrap(), 0); assert_eq!(tag.track_total().unwrap(), track_total); - assert_eq!(tag.disk().unwrap(), 1); + assert_eq!(tag.disk().unwrap(), 0); assert_eq!(tag.disk_total().unwrap(), disk_total); }