From 46338f0bcb48f78f23d31b15cdb89e4a0a0c63c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20P=C3=B6mp?= Date: Thu, 7 Nov 2024 18:07:38 +0100 Subject: [PATCH] build(ngx-utilities): try to fix metadata issue --- libs/ngx-utilities/tsconfig.lib.json | 3 +- .../AudioFormats/music-metadata-format.ts | 5 +- package-lock.json | 54 +++++++++++++++++-- package.json | 2 +- tsconfig.base.json | 3 ++ 5 files changed, 60 insertions(+), 7 deletions(-) diff --git a/libs/ngx-utilities/tsconfig.lib.json b/libs/ngx-utilities/tsconfig.lib.json index 77b13c67d..45710eea0 100644 --- a/libs/ngx-utilities/tsconfig.lib.json +++ b/libs/ngx-utilities/tsconfig.lib.json @@ -5,7 +5,8 @@ "declaration": true, "declarationMap": true, "inlineSources": true, - "types": [] + "types": [], + "composite": true }, "exclude": ["src/**/*.spec.ts", "jest.config.ts", "src/**/*.test.ts"], "include": ["src/**/*.ts"] diff --git a/libs/web-media/src/lib/audio/AudioFormats/music-metadata-format.ts b/libs/web-media/src/lib/audio/AudioFormats/music-metadata-format.ts index 3cc7f3255..72fc333a2 100644 --- a/libs/web-media/src/lib/audio/AudioFormats/music-metadata-format.ts +++ b/libs/web-media/src/lib/audio/AudioFormats/music-metadata-format.ts @@ -1,5 +1,5 @@ import { AudioFormat } from './audio-format'; -import { parseBlob } from 'music-metadata'; +import { MpegParser, parseBlob } from 'music-metadata-remastered'; export class MusicMetadataFormat extends AudioFormat { protected override _decoder: 'web-audio' | 'octra' = 'web-audio'; @@ -35,7 +35,8 @@ export class MusicMetadataFormat extends AudioFormat { override async readAudioInformation(buffer: ArrayBuffer) { const parsed = await parseBlob( - new File([buffer], this._filename, { type: this._mimeType }) + new File([buffer], this._filename, { type: this._mimeType }), + MpegParser ); const format = parsed.format; diff --git a/package-lock.json b/package-lock.json index 2c1b7f286..ccc217106 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "konva": "^9.3.15", "luxon": "^3.5.0", "modernizr": "^3.13.0", - "music-metadata": "file:../music-metadata", + "music-metadata-remastered": "file:../music-metadata-remastered", "ngrx-wieder": "^13.0.0", "ngx-jodit": "^3.1.3", "ngx-webstorage": "^18.0.0", @@ -127,6 +127,7 @@ }, "../music-metadata": { "version": "10.5.1", + "extraneous": true, "funding": [ { "type": "github", @@ -173,6 +174,53 @@ "node": ">=16.0.0" } }, + "../music-metadata-remastered": { + "name": "@music-metadata-remastered/source", + "version": "0.0.0", + "license": "MIT", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "@tokenizer/token": "^0.3.0", + "content-type": "^1.0.5", + "debug": "^4.3.7", + "file-type": "^19.6.0", + "media-typer": "^1.1.0", + "strtok3": "^9.0.1", + "token-types": "^6.0.0", + "uint8array-extras": "^1.4.0" + }, + "devDependencies": { + "@eslint/js": "^9.8.0", + "@nx/eslint": "20.0.8", + "@nx/eslint-plugin": "20.0.8", + "@nx/js": "20.0.8", + "@nx/vite": "20.0.8", + "@nx/web": "20.0.8", + "@swc-node/register": "~1.9.1", + "@swc/core": "~1.5.7", + "@swc/helpers": "~0.5.11", + "@types/chai": "^5.0.0", + "@types/chai-as-promised": "^8.0.1", + "@types/content-type": "^1.1.8", + "@types/debug": "^4.1.12", + "@types/media-typer": "^1.1.3", + "@types/mocha": "^10.0.9", + "@types/node": "18.16.9", + "@vitest/ui": "^1.3.1", + "eslint": "^9.8.0", + "eslint-config-prettier": "^9.0.0", + "nx": "20.0.8", + "prettier": "^2.6.2", + "tslib": "^2.3.0", + "typescript": "~5.5.2", + "typescript-eslint": "^8.0.0", + "vite": "^5.0.0", + "vite-plugin-dts": "~3.8.1", + "vitest": "^1.3.1" + } + }, "node_modules/@adobe/css-tools": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.0.tgz", @@ -21552,8 +21600,8 @@ "multicast-dns": "cli.js" } }, - "node_modules/music-metadata": { - "resolved": "../music-metadata", + "node_modules/music-metadata-remastered": { + "resolved": "../music-metadata-remastered", "link": true }, "node_modules/mute-stream": { diff --git a/package.json b/package.json index e790424f4..9cbd60a09 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "konva": "^9.3.15", "luxon": "^3.5.0", "modernizr": "^3.13.0", - "music-metadata": "file:../music-metadata", + "music-metadata-remastered": "file:../music-metadata-remastered", "ngrx-wieder": "^13.0.0", "ngx-jodit": "^3.1.3", "ngx-webstorage": "^18.0.0", diff --git a/tsconfig.base.json b/tsconfig.base.json index 148c85f0a..f8b1889a5 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -47,6 +47,9 @@ ], "@octra/web-media": [ "libs/web-media/src/index.ts" + ], + "music-metadata-remastered": [ + "node_modules/music-metadata-remastered" ] } },