Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Jun 4, 2024
2 parents a67a563 + 04469ec commit dc12188
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
run: vendor/bin/pest --coverage

- name: Send code coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: false
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.5.1
uses: dependabot/fetch-metadata@v2.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.3.0
uses: aglipanci/laravel-pint-action@2.4

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand All @@ -24,7 +24,7 @@ jobs:
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,47 @@

All notable changes to `php-audio` will be documented in this file.

## v3.0.06 - 2024-02-04

- Add `getAudioFormats()` to `Audio::class` to get an array with all audio formats of file.
- Add param to `getTags(?string $audioFormat = null)` to select a specific tag format, default will be maximum tags found.
- Add same param to `getTag(string $tag, ?string $audioFormat = null)` to select a specific tag format, default will be maximum tags found.
- Add `getPodcastDescription()` method to `Audio::class` to get the podcast description.
- Add `getLanguage()` method to `Audio::class` to get the language of the podcast.

## v3.0.05 - 2024-02-03

- Add `toArray()` method to `Audio::class` to get all properties without cover.
- Add `getTags()` method to `Audio::class` to get all tags as `array<string, string>`.
- Add `getTag(string $tag)` method to `Audio::class` to get a single tag.

## v3.0.04 - 2023-11-01

- `AudioCore`, fix `fromId3()` with `null` check `Id3AudioTagV1` and `Id3AudioTagV2`, issue #18 thanks to @cospin

## v3.0.03 - 2023-10-31

- `AudioCore`, `fromId3()` method comment bug, issue #18 thanks to @cospin
- `AudioMetadata`, add `path`, `dataformat`

## v3.0.02 - 2023-09-21

- Id3Writer: `trackNumber()` and `discNumber()` accept now integers (and strings)

## v3.0.01 - 2023-09-20

- Add `getContents()` to AudioCover
- Old method `getContent()` is deprecated

## 3.0.0 - 2023-08-08

### BREAKING CHANGES

- All simple getters have now `get` prefix. For example, `getTitle()` instead of `title()`, `getAlbum()` instead of `album()`, etc. It concerns all simple getters of `AudioCore`, `AudioCover`, `AudioMetadata`, `AudioStat`, `Id3Reader` classes.

> Why?
All these classes have some methods like setters or actions. To be consistent and clear, all simple getters have now `get` prefix.

## 2.0.0 - 2023-06-08

**BREAKING CHANGES**
Expand Down
13 changes: 10 additions & 3 deletions src/Models/AudioCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,16 @@ public static function fromQuicktime(Id3TagQuicktime $tag): AudioCore
if (strlen($creation_date) === 4) {
$core->setYear((int) $creation_date);
} else {
$creation_date = date_create_from_format('Y-m-d\TH:i:s\Z', $creation_date);
$core->setCreationDate($creation_date?->format('Y-m-d\TH:i:s\Z'));
$core->setYear((int) $creation_date?->format('Y'));
try {
$parsedCreationDate = new \DateTimeImmutable($creation_date);
} catch (\Exception $e) {
// ignore the issue so the rest of the data will be available
}

if (!empty($parsedCreationDate)) {
$core->setCreationDate($parsedCreationDate->format('Y-m-d\TH:i:s\Z'));
$core->setYear((int) $parsedCreationDate->format('Y'));
}
}
}

Expand Down

0 comments on commit dc12188

Please sign in to comment.