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

v4.0.0 #35

Merged
merged 15 commits into from
Oct 3, 2024
Merged

v4.0.0 #35

merged 15 commits into from
Oct 3, 2024

Conversation

ewilan-riviere
Copy link
Contributor

@ewilan-riviere ewilan-riviere commented Oct 3, 2024

BREAKING CHANGES

  • internal architecture has been totally redesigned
  • get() static method is now read() (old method is still available)
  • update() method is now write() (old method is still available)
  • getAudio() is now getMetadata()
  • getStat() has been removed, you can find getLastAccessAt(), getCreatedAt(), getModifiedAt() into getMetadata()
  • getWriter() has been removed, only used when write() method is called
  • getReader() is now getId3Reader()
  • getPodcastDescription() is now getSynopsis()
  • getStik() has been removed (you can find it in getRaw() method or with getRawKey('stik'))
  • cover contents is now base64 encoded into AudioCover object
  • toArray() has been revised to return a more structured array
  • getDuration() is now float
  • add getDurationHuman() to get human readable duration
  • add getTrackNumberInt() to get track number as integer
  • add getDiscNumberInt()
  • getTags() is now getRawAll() as multidimensional array
  • new method getRaw() will return main format as array
  • new method getRawKey('ANY_KEY') will return specific key from main format
  • getAudioFormats() has been removed
  • getExtras() has been removed (duplicate of getRawAll(), getRaw() or toArray())
  • writer() can now use tag('ANY_KEY', 'ANY_VALUE') to update directly any tag without use tags()
  • writer() method tags() has been modified, it's not native method of getID3 anymore, just an array of tags
  • add getQuicktime() to AudioMetadata to get quicktime tags, with chapters for audiobooks

AudioCover

  • now contents are stored as base64 encoded string
  • new getContents() method to get contents, default is raw string (binary) and you can get base64 encoded string with true parameter
  • new getMimeType() method to get mime type of the cover
  • new getWidth() method to get width of the cover
  • new getHeight() method to get height of the cover
  • new toArray() method to get cover as array

AudioMetadata

  • getFilesize() is now getFileSize()
  • add getSizeHuman() to get human readable size with decimal precision
  • add getDataFormat() to get data format like mp3
  • remove getDurationReadable() because it's now into Audio::class
  • getLossless() is now isLossless()
  • add getCodec() to get codec of the file, like LAME
  • add getEncoderOptions() to get encoder options of the file, like CBR
  • add getVersion() to get version of JamesHeinrich/getID3
  • add getAvDataOffset() to get offset of audio/video data
  • add getAvDataEnd() to get end of audio/video data
  • add getFilePath() to get file path, like /path/to
  • add getFilename() to get filename, like file.mp3
  • add getLastAccessAt(), getCreatedAt(), getModifiedAt() from stat() function
  • add toArray() method to get metadata as array

Fix

- Renamed `getRawTagsAll` to `getRawAll`
- Renamed `getRawTags` to `getRaw`
- Renamed `getRawTagsKey` to `getRawKey`
- Updated method signatures and return types to match changes

Refactor Id3Writer class

- Removed unused `$options` parameter from constructor
- Updated `year` method to accept `string|int` parameter and convert it to `int`

Update AudiobookTest and README.md

- Updated assertions to use renamed methods in Audio and Audiobook classes
- Added new assertions for additional raw tags in AudiobookTest

Fix styling

- Removed commented out code in WriterTest
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 95.67527% with 57 lines in your changes missing coverage. Please review.

Project coverage is 95.80%. Comparing base (1f313ce) to head (8704a3b).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/Id3/Id3Reader.php 78.81% 25 Missing ⚠️
src/Id3/Id3Writer.php 93.46% 16 Missing ⚠️
src/Audio.php 95.40% 8 Missing ⚠️
src/Core/AudioCore.php 99.19% 2 Missing ⚠️
src/Id3/Reader/Id3Audio.php 92.00% 2 Missing ⚠️
src/Id3/Reader/Id3AudioQuicktimeChapter.php 93.33% 1 Missing ⚠️
src/Id3/Reader/Id3AudioTag.php 96.29% 1 Missing ⚠️
src/Id3/Reader/Id3Stream.php 94.44% 1 Missing ⚠️
src/Models/AudioCover.php 95.23% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #35      +/-   ##
============================================
+ Coverage     93.48%   95.80%   +2.32%     
+ Complexity      487      339     -148     
============================================
  Files             7       25      +18     
  Lines          1780     1383     -397     
============================================
- Hits           1664     1325     -339     
+ Misses          116       58      -58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ewilan-riviere ewilan-riviere merged commit 328abda into main Oct 3, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant