kiwilan / php-audio Goto Github PK
View Code? Open in Web Editor NEWPHP package to parse and update audio files metadata, with JamesHeinrich/getID3.
License: MIT License
PHP package to parse and update audio files metadata, with JamesHeinrich/getID3.
License: MIT License
It seems that when an .mp3 file only has ID3v2 information and no v1, the following error is generated:
[30-Oct-2023 21:08:56 UTC] PHP Fatal error: Uncaught Error: Call to a member function comment() on null in site\vendor\kiwilan\php-audio\src\Models\AudioCore.php:430
Stack trace:
#0 sitet\vendor\kiwilan\php-audio\src\Audio.php(395): Kiwilan\Audio\Models\AudioCore::fromId3(NULL, Object(Kiwilan\Audio\Models\Id3AudioTagV2))
#1 site\vendor\kiwilan\php-audio\src\Audio.php(98): Kiwilan\Audio\Audio->parse()
#2 site\upload.php(112): Kiwilan\Audio\Audio::get('site/...')
#3 site\upload.php(407): newMetadata('site/...', 'Miss K8 - Infin...')
#4 {main}
thrown in site\vendor\kiwilan\php-audio\src\Models\AudioCore.php on line 430
The relevant line is:
php-audio/src/Models/AudioCore.php
Line 430 in 327e76d
fromId3(NULL, Object)
. Replacing the line with: comment: $v2 ? $v2->comment() : $v1->comment()
, works.
For now I think it happens when a .mp3 file only has only ID3v2 information and no v1.
3.0.02
8.2.11
Windows
Really nice work, thank you!
When trying to parse a specific date I get an error.
[2024-06-03 05:51:03] production.ERROR: Call to a member function format() on false {"exception":"[object] (Error(code: 0): Call to a member function format() on false at /app/vendor/kiwilan/php-audio/src/Models/AudioCore.php:543)
[stacktrace]
#0 /app/vendor/kiwilan/php-audio/src/Audio.php(420): Kiwilan\\Audio\\Models\\AudioCore::fromQuicktime()
#1 /app/vendor/kiwilan/php-audio/src/Audio.php(102): Kiwilan\\Audio\\Audio->parse()
Try a date that doesn't match the format specified in https://github.com/kiwilan/php-audio/blob/main/src/Models/AudioCore.php#L543
I get this with dates that don't include time like 2024-01-01
.
The following snippet can simulate the issue:
$creation_date = '2024-01-01';
$creation_date = date_create_from_format('Y-m-d\TH:i:s\Z', $creation_date);
var_dump($creation_date?->format('Y-m-d\TH:i:s\Z'));
v3.0.06
8.3
Linux
The date_create_from_format()
will return false when it can't parse the date according to the manual. In which case the null safe operator will not work because it's a boolean. I think this is not intended.
Up to now it only happened with quicktime format. Haven't dig the code in order to figure out why is that, so it might make sense to check if there are other snippets that could cause the same issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.