Skip to content

Commit 3fd1373

Browse files
committed
Bump christophwurst/id3parser to 0.1.4
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
1 parent fd0d5d7 commit 3fd1373

File tree

11 files changed

+76
-44
lines changed

11 files changed

+76
-44
lines changed

christophwurst/id3parser/src/getID3/Tags/getid3_id3v2.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,17 +1870,14 @@ public function ParseID3v2Frame(&$parsedFrame) {
18701870
$frame_offset = 0;
18711871
$parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4));
18721872
$frame_offset += 4;
1873-
$rg_track_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
1874-
$frame_offset += 2;
1875-
$rg_album_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
1876-
$parsedFrame['raw']['track']['name'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 0, 3));
1877-
$parsedFrame['raw']['track']['originator'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 3, 3));
1878-
$parsedFrame['raw']['track']['signbit'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 6, 1));
1879-
$parsedFrame['raw']['track']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 7, 9));
1880-
$parsedFrame['raw']['album']['name'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 0, 3));
1881-
$parsedFrame['raw']['album']['originator'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 3, 3));
1882-
$parsedFrame['raw']['album']['signbit'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 6, 1));
1883-
$parsedFrame['raw']['album']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 7, 9));
1873+
foreach (array('track','album') as $rgad_entry_type) {
1874+
$rg_adjustment_word = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
1875+
$frame_offset += 2;
1876+
$parsedFrame['raw'][$rgad_entry_type]['name'] = ($rg_adjustment_word & 0xE000) >> 13;
1877+
$parsedFrame['raw'][$rgad_entry_type]['originator'] = ($rg_adjustment_word & 0x1C00) >> 10;
1878+
$parsedFrame['raw'][$rgad_entry_type]['signbit'] = ($rg_adjustment_word & 0x0200) >> 9;
1879+
$parsedFrame['raw'][$rgad_entry_type]['adjustment'] = ($rg_adjustment_word & 0x0100);
1880+
}
18841881
$parsedFrame['track']['name'] = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']);
18851882
$parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']);
18861883
$parsedFrame['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['track']['adjustment'], $parsedFrame['raw']['track']['signbit']);

christophwurst/id3parser/src/getID3/getid3_lib.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,20 @@ public static function BigEndian2String($number, $minbytes=1, $synchsafe=false,
295295

296296

297297
public static function Dec2Bin($number) {
298+
if (!is_numeric($number)) {
299+
// https://github.com/JamesHeinrich/getID3/issues/299
300+
trigger_error('TypeError: Dec2Bin(): Argument #1 ($number) must be numeric, '.gettype($number).' given', E_USER_WARNING);
301+
return '';
302+
}
303+
$bytes = array();
298304
while ($number >= 256) {
299-
$bytes[] = (($number / 256) - (floor($number / 256))) * 256;
305+
$bytes[] = (int) (($number / 256) - (floor($number / 256))) * 256;
300306
$number = floor($number / 256);
301307
}
302-
$bytes[] = $number;
308+
$bytes[] = (int) $number;
303309
$binstring = '';
304-
for ($i = 0; $i < count($bytes); $i++) {
305-
$binstring = (($i == count($bytes) - 1) ? decbin($bytes[$i]) : str_pad(decbin($bytes[$i]), 8, '0', STR_PAD_LEFT)).$binstring;
310+
foreach ($bytes as $i => $byte) {
311+
$binstring = (($i == count($bytes) - 1) ? decbin($byte) : str_pad(decbin($byte), 8, '0', STR_PAD_LEFT)).$binstring;
306312
}
307313
return $binstring;
308314
}
@@ -1147,7 +1153,7 @@ public static function trimNullByte($string) {
11471153
* @param string $suffix If the name component ends in suffix this will also be cut off.
11481154
* @return string
11491155
*/
1150-
public static function mb_basename($path, $suffix = null) {
1156+
public static function mb_basename($path, $suffix = '') {
11511157
$splited = preg_split('#/#', rtrim($path, '/ '));
11521158
return substr(basename('X'.$splited[count($splited) - 1], $suffix), 1);
11531159
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"php": "^7.3|^8.0",
1717
"aws/aws-sdk-php": "^3.35",
1818
"bantu/ini-get-wrapper": "v1.0.1",
19-
"christophwurst/id3parser": "^0.1.1",
19+
"christophwurst/id3parser": "^0.1.4",
2020
"cweagans/composer-patches": "^1.7",
2121
"deepdiver/zipstreamer": "2.0.0",
2222
"deepdiver1975/tarstreamer": "v2.0.0",

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

composer/ClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function getFallbackDirsPsr4()
149149

150150
/**
151151
* @return string[] Array of classname => path
152-
* @psalm-var array<string, string>
152+
* @psalm-return array<string, string>
153153
*/
154154
public function getClassMap()
155155
{

composer/autoload_classmap.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,15 @@
21222122
'Pimple\\Psr11\\ServiceLocator' => $vendorDir . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php',
21232123
'Pimple\\ServiceIterator' => $vendorDir . '/pimple/pimple/src/Pimple/ServiceIterator.php',
21242124
'Pimple\\ServiceProviderInterface' => $vendorDir . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php',
2125+
'Pimple\\Tests\\Fixtures\\Invokable' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php',
2126+
'Pimple\\Tests\\Fixtures\\NonInvokable' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php',
2127+
'Pimple\\Tests\\Fixtures\\PimpleServiceProvider' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php',
2128+
'Pimple\\Tests\\Fixtures\\Service' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php',
2129+
'Pimple\\Tests\\PimpleServiceProviderInterfaceTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php',
2130+
'Pimple\\Tests\\PimpleTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php',
2131+
'Pimple\\Tests\\Psr11\\ContainerTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php',
2132+
'Pimple\\Tests\\Psr11\\ServiceLocatorTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php',
2133+
'Pimple\\Tests\\ServiceIteratorTest' => $vendorDir . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php',
21252134
'Psr\\Container\\ContainerExceptionInterface' => $vendorDir . '/psr/container/src/ContainerExceptionInterface.php',
21262135
'Psr\\Container\\ContainerInterface' => $vendorDir . '/psr/container/src/ContainerInterface.php',
21272136
'Psr\\Container\\NotFoundExceptionInterface' => $vendorDir . '/psr/container/src/NotFoundExceptionInterface.php',
@@ -2153,6 +2162,9 @@
21532162
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
21542163
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
21552164
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
2165+
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
2166+
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
2167+
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
21562168
'Punic\\Calendar' => $vendorDir . '/punic/punic/code/Calendar.php',
21572169
'Punic\\Comparer' => $vendorDir . '/punic/punic/code/Comparer.php',
21582170
'Punic\\Currency' => $vendorDir . '/punic/punic/code/Currency.php',

composer/autoload_real.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,16 @@ public static function getLoader()
6060
}
6161
}
6262

63+
/**
64+
* @param string $fileIdentifier
65+
* @param string $file
66+
* @return void
67+
*/
6368
function composerRequire2f23f73bc0cc116b4b1eee1521aa8652($fileIdentifier, $file)
6469
{
6570
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66-
require $file;
67-
6871
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
72+
73+
require $file;
6974
}
7075
}

composer/autoload_static.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,6 +2767,15 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
27672767
'Pimple\\Psr11\\ServiceLocator' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php',
27682768
'Pimple\\ServiceIterator' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/ServiceIterator.php',
27692769
'Pimple\\ServiceProviderInterface' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/ServiceProviderInterface.php',
2770+
'Pimple\\Tests\\Fixtures\\Invokable' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/Invokable.php',
2771+
'Pimple\\Tests\\Fixtures\\NonInvokable' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/NonInvokable.php',
2772+
'Pimple\\Tests\\Fixtures\\PimpleServiceProvider' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php',
2773+
'Pimple\\Tests\\Fixtures\\Service' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Fixtures/Service.php',
2774+
'Pimple\\Tests\\PimpleServiceProviderInterfaceTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/PimpleServiceProviderInterfaceTest.php',
2775+
'Pimple\\Tests\\PimpleTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/PimpleTest.php',
2776+
'Pimple\\Tests\\Psr11\\ContainerTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Psr11/ContainerTest.php',
2777+
'Pimple\\Tests\\Psr11\\ServiceLocatorTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/Psr11/ServiceLocatorTest.php',
2778+
'Pimple\\Tests\\ServiceIteratorTest' => __DIR__ . '/..' . '/pimple/pimple/src/Pimple/Tests/ServiceIteratorTest.php',
27702779
'Psr\\Container\\ContainerExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerExceptionInterface.php',
27712780
'Psr\\Container\\ContainerInterface' => __DIR__ . '/..' . '/psr/container/src/ContainerInterface.php',
27722781
'Psr\\Container\\NotFoundExceptionInterface' => __DIR__ . '/..' . '/psr/container/src/NotFoundExceptionInterface.php',
@@ -2798,6 +2807,9 @@ class ComposerStaticInit2f23f73bc0cc116b4b1eee1521aa8652
27982807
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
27992808
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
28002809
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
2810+
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
2811+
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
2812+
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
28012813
'Punic\\Calendar' => __DIR__ . '/..' . '/punic/punic/code/Calendar.php',
28022814
'Punic\\Comparer' => __DIR__ . '/..' . '/punic/punic/code/Comparer.php',
28032815
'Punic\\Currency' => __DIR__ . '/..' . '/punic/punic/code/Currency.php',

composer/installed.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,23 @@
255255
},
256256
{
257257
"name": "christophwurst/id3parser",
258-
"version": "v0.1.2",
259-
"version_normalized": "0.1.2.0",
258+
"version": "v0.1.4",
259+
"version_normalized": "0.1.4.0",
260260
"source": {
261261
"type": "git",
262262
"url": "https://github.com/ChristophWurst/ID3Parser.git",
263-
"reference": "d7f5e9e7db69a24e3111a2033cbdf640f9456f2f"
263+
"reference": "050c9d81ea89b0cf53e23a27efc4e1840f9ab260"
264264
},
265265
"dist": {
266266
"type": "zip",
267-
"url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/d7f5e9e7db69a24e3111a2033cbdf640f9456f2f",
268-
"reference": "d7f5e9e7db69a24e3111a2033cbdf640f9456f2f",
267+
"url": "https://api.github.com/repos/ChristophWurst/ID3Parser/zipball/050c9d81ea89b0cf53e23a27efc4e1840f9ab260",
268+
"reference": "050c9d81ea89b0cf53e23a27efc4e1840f9ab260",
269269
"shasum": ""
270270
},
271271
"require": {
272272
"php": ">=5.4.0"
273273
},
274-
"time": "2021-02-09T08:04:08+00:00",
274+
"time": "2021-11-29T15:02:22+00:00",
275275
"type": "library",
276276
"installation-source": "dist",
277277
"autoload": {
@@ -292,7 +292,7 @@
292292
],
293293
"support": {
294294
"issues": "https://github.com/ChristophWurst/ID3Parser/issues",
295-
"source": "https://github.com/ChristophWurst/ID3Parser/tree/v0.1.2"
295+
"source": "https://github.com/ChristophWurst/ID3Parser/tree/v0.1.4"
296296
},
297297
"install-path": "../christophwurst/id3parser"
298298
},
@@ -6399,6 +6399,6 @@
63996399
"install-path": "../web-auth/webauthn-lib"
64006400
}
64016401
],
6402-
"dev": false,
6402+
"dev": true,
64036403
"dev-package-names": []
64046404
}

composer/installed.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
'type' => 'library',
66
'install_path' => __DIR__ . '/../',
77
'aliases' => array(),
8-
'reference' => 'bf2bcdc22908b96ef44ef8c44f647a5a4cf803b6',
8+
'reference' => 'fd0d5d72f48315cc4f51342dc2d9e82d1dafe0e8',
99
'name' => 'nextcloud/3rdparty',
10-
'dev' => false,
10+
'dev' => true,
1111
),
1212
'versions' => array(
1313
'aws/aws-sdk-php' => array(
@@ -47,12 +47,12 @@
4747
'dev_requirement' => false,
4848
),
4949
'christophwurst/id3parser' => array(
50-
'pretty_version' => 'v0.1.2',
51-
'version' => '0.1.2.0',
50+
'pretty_version' => 'v0.1.4',
51+
'version' => '0.1.4.0',
5252
'type' => 'library',
5353
'install_path' => __DIR__ . '/../christophwurst/id3parser',
5454
'aliases' => array(),
55-
'reference' => 'd7f5e9e7db69a24e3111a2033cbdf640f9456f2f',
55+
'reference' => '050c9d81ea89b0cf53e23a27efc4e1840f9ab260',
5656
'dev_requirement' => false,
5757
),
5858
'composer/package-versions-deprecated' => array(
@@ -304,7 +304,7 @@
304304
'type' => 'library',
305305
'install_path' => __DIR__ . '/../',
306306
'aliases' => array(),
307-
'reference' => 'bf2bcdc22908b96ef44ef8c44f647a5a4cf803b6',
307+
'reference' => 'fd0d5d72f48315cc4f51342dc2d9e82d1dafe0e8',
308308
'dev_requirement' => false,
309309
),
310310
'nextcloud/lognormalizer' => array(

0 commit comments

Comments
 (0)