From 2a98464bbe84b8b261623363c933bdbe1b39778f Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 27 May 2024 23:53:08 +0100 Subject: [PATCH] Put id3v1 genre_id in brackets as seen with id3v2 --- src/Mp3Info.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mp3Info.php b/src/Mp3Info.php index 791dab3..5ce4e87 100644 --- a/src/Mp3Info.php +++ b/src/Mp3Info.php @@ -437,9 +437,11 @@ class Mp3Info /** * Reads id3v1 tag. + * + * @link https://id3.org/ID3v1 * @return int Returns length of id3v1 tag. */ - private function readId3v1Body() + private function readId3v1Body(): int { $this->tags1['song'] = trim($this->fileObj->getBytes(30)); $this->tags1['artist'] = trim($this->fileObj->getBytes(30)); @@ -454,7 +456,7 @@ class Mp3Info // id3v1.0 $this->tags1['comment'] = trim($comment); } - $this->tags1['genre'] = ord($this->fileObj->getBytes(1)); + $this->tags1['genre'] = '(' . ord($this->fileObj->getBytes(1)) . ')'; return 128; }