kiwilan / php-audio

PHP package to parse and update audio files metadata, with JamesHeinrich/getID3.
MIT License
15 stars 0 forks source link

[Bug]: Setting one Tag will clear all other tags #34

Closed rsy12 closed 1 month ago

rsy12 commented 1 month ago

What happened?

I want only to update the genre tag. But if I do this all other tags are cleared. Is this possible to set only one tag to update ?

How to reproduce the bug

If I do this in the following way: $tag = $audio->update()->genre($newGenre)->save(); or $tag = $audio->update() ->tags([ 'genre' => $newGenre, ]) ->tagFormats(['id3v1','id3v2.4']) // optional ->save(); All tags are cleared:

After the update Call eyeD3 03.Eat_the_Music.mp3 /home/rsy/tmp/test/03.Eat_the_Music.mp3 [ 12.10 MB ]

Time: 05:11 MPEG1, Layer III [ 320 kb/s @ 48000 Hz - Stereo ]

ID3 v2.4: title: artist: album: track: genre: Adult Alternative Pop (id None)


Before the update call: eyeD3 03.Eat_the_Music.mp3 /home/rsy/tmp/test/03.Eat_the_Music.mp3 [ 12.10 MB ]

Time: 05:11 MPEG1, Layer III [ 320 kb/s @ 48000 Hz - Stereo ]

ID3 v2.3: title: Eat the Music artist: Kate Bush album: The Red Shoes album artist: Kate Bush composer: Kate Bush recording date: 1993 track: 3/12 genre: Adult alternative pop/rock (id None) Lyrics: [Description: ] [Lang: eng]

FRONT_COVER Image: [Size: 226557 bytes] [Type: image/jpeg] Description:

Package Version

3.0

PHP Version

8.3.6

Which operating systems does with happen with?

Linux

Notes

No response

ewilan-riviere commented 1 month ago

Thanks for report! Fixed in next major version this week.

ewilan-riviere commented 1 month ago

Can you try latest version and tell me if you can update your file?

rsy12 commented 1 month ago

Hello, thanks for the fast response. I have check the new code with my program. All works fine the changed genre is updated and all other fields left untouched. Thanks a lot for your work. Cheers Reinhard

ewilan-riviere commented 1 month ago

Thanks for your feedback !