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

v3.0.07 #31

Merged
merged 5 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ $audio->getCreationDate(); // `?string` to get creation date (audiobook)
$audio->getCopyright(); // `?string` to get copyright (audiobook)
$audio->getEncoding(); // `?string` to get encoding
$audio->getDescription(); // `?string` to get description (audiobook)
$audio->getPodcastDescription(); // `?string` to get podcast description (audiobook)
$audio->getLanguage(); // `?string` to get language
$audio->getLyrics(); // `?string` (audiobook)
$audio->getStik(); // `?string` (audiobook)
$audio->getDuration(); // `?float` to get duration in seconds
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kiwilan/php-audio",
"description": "PHP package to parse and update audio files metadata, with `JamesHeinrich/getID3`.",
"version": "3.0.06",
"version": "3.0.07",
"keywords": [
"audio",
"php",
Expand Down
2 changes: 1 addition & 1 deletion src/Models/AudioCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public static function fromQuicktime(Id3TagQuicktime $tag): AudioCore
// ignore the issue so the rest of the data will be available
}

if (!empty($parsedCreationDate)) {
if (! empty($parsedCreationDate)) {
$core->setCreationDate($parsedCreationDate->format('Y-m-d\TH:i:s\Z'));
$core->setYear((int) $parsedCreationDate->format('Y'));
}
Expand Down
14 changes: 14 additions & 0 deletions src/Models/Id3Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ public function description(?string $description): self
return $this;
}

public function podcastDescription(?string $podcastDescription): self
{
$this->core->setPodcastDescription($podcastDescription);

return $this;
}

public function language(?string $language): self
{
$this->core->setLanguage($language);

return $this;
}

public function lyrics(?string $lyrics): self
{
$this->core->setLyrics($lyrics);
Expand Down
9 changes: 9 additions & 0 deletions tests/WriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@
expect($tag->getCore()->getCover()->data())->toBe(base64_encode($content));
})->with([MP3_WRITER]);

// it('can change podcast description and language', function () {
// $audio = Audio::get(AUDIOBOOK);
// $tag = $audio->update()
// ->title('New Title')
// ->podcastDescription('New Podcast Description')
// ->language('New Language')
// ->save();
// });

// it('can not override tags', function (string $path) {
// $audio = Audio::get($path);

Expand Down