taglib-wasm 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +72 -64
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/assertClassBrand.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldGet2.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/classPrivateFieldSet2.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/defineProperty.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/typeof.js +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/usingCtx.js +57 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/bwf/bext.d.ts.map +1 -0
- package/dist/bwf/bext.js +119 -0
- package/dist/{src/constants → constants}/additional-properties.d.ts.map +1 -1
- package/dist/constants/additional-properties.js +270 -0
- package/dist/constants/basic-properties.d.ts.map +1 -0
- package/dist/constants/basic-properties.js +128 -0
- package/dist/constants/complex-properties.d.ts.map +1 -0
- package/dist/constants/complex-properties.js +1 -0
- package/dist/constants/format-mappings.d.ts.map +1 -0
- package/dist/constants/format-mappings.js +58 -0
- package/dist/{src/constants → constants}/general-extended-properties.d.ts.map +1 -1
- package/dist/constants/general-extended-properties.js +272 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/properties.d.ts +43 -0
- package/dist/constants/properties.d.ts.map +1 -0
- package/dist/constants/properties.js +105 -0
- package/dist/constants/property-types.d.ts.map +1 -0
- package/dist/constants/property-types.js +1 -0
- package/dist/{src/constants → constants}/specialized-properties.d.ts.map +1 -1
- package/dist/constants/specialized-properties.js +335 -0
- package/dist/{src/constants → constants}/utilities.d.ts +1 -1
- package/dist/constants/utilities.d.ts.map +1 -0
- package/dist/constants/utilities.js +50 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/{src/deno-compile.d.ts → deno-compile.d.ts} +8 -2
- package/dist/deno-compile.d.ts.map +1 -0
- package/dist/deno-compile.js +113 -0
- package/dist/disc-folder.d.ts +4 -4
- package/dist/disc-folder.d.ts.map +1 -1
- package/dist/disc-folder.js +596 -544
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +66 -0
- package/dist/errors/classes.d.ts.map +1 -0
- package/dist/errors/classes.js +164 -0
- package/dist/errors/guards.d.ts.map +1 -0
- package/dist/errors/guards.js +26 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +4 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +5 -0
- package/dist/file-utils/copy-and-find.d.ts.map +1 -0
- package/dist/file-utils/copy-and-find.js +107 -0
- package/dist/file-utils/export-operations.d.ts.map +1 -0
- package/dist/file-utils/export-operations.js +84 -0
- package/dist/file-utils/import-operations.d.ts.map +1 -0
- package/dist/file-utils/import-operations.js +109 -0
- package/dist/file-utils/index.d.ts.map +1 -0
- package/dist/file-utils/index.js +5 -0
- package/dist/file-utils/mime-detection.d.ts.map +1 -0
- package/dist/file-utils/mime-detection.js +44 -0
- package/dist/folder-api/album-corroborate.d.ts.map +1 -0
- package/dist/folder-api/album-corroborate.js +35 -0
- package/dist/folder-api/album-discs.d.ts.map +1 -0
- package/dist/folder-api/album-discs.js +119 -0
- package/dist/folder-api/album-grouping.d.ts.map +1 -0
- package/dist/folder-api/album-grouping.js +161 -0
- package/dist/folder-api/album-identity.d.ts.map +1 -0
- package/dist/folder-api/album-identity.js +165 -0
- package/dist/folder-api/album-types.d.ts.map +1 -0
- package/dist/folder-api/album-types.js +1 -0
- package/dist/folder-api/directory-walker.d.ts.map +1 -0
- package/dist/folder-api/directory-walker.js +27 -0
- package/dist/folder-api/file-processors.d.ts.map +1 -0
- package/dist/folder-api/file-processors.js +52 -0
- package/dist/folder-api/folder-disc.d.ts.map +1 -0
- package/dist/folder-api/folder-disc.js +166 -0
- package/dist/folder-api/folder-operations.d.ts.map +1 -0
- package/dist/folder-api/folder-operations.js +69 -0
- package/dist/folder-api/index.d.ts.map +1 -0
- package/dist/{src/folder-api → folder-api}/index.js +1 -8
- package/dist/folder-api/scan-for-albums.d.ts.map +1 -0
- package/dist/folder-api/scan-for-albums.js +25 -0
- package/dist/folder-api/scan-operations.d.ts.map +1 -0
- package/dist/folder-api/scan-operations.js +79 -0
- package/dist/folder-api/types.d.ts.map +1 -0
- package/dist/folder-api/types.js +21 -0
- package/dist/folder.d.ts +1 -1
- package/dist/folder.d.ts.map +1 -1
- package/dist/folder.js +7 -2
- package/dist/global.d.js +1 -0
- package/dist/index.browser.d.ts +29 -30
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +4106 -4479
- package/dist/index.d.ts +26 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -185
- package/dist/msgpack/decoder.d.ts.map +1 -0
- package/dist/msgpack/decoder.js +177 -0
- package/dist/msgpack/encoder.d.ts.map +1 -0
- package/dist/msgpack/encoder.js +211 -0
- package/dist/msgpack/index.d.ts.map +1 -0
- package/dist/msgpack/index.js +5 -0
- package/dist/{src/msgpack → msgpack}/types.d.ts +1 -1
- package/dist/msgpack/types.d.ts.map +1 -0
- package/dist/msgpack/types.js +13 -0
- package/dist/msgpack/utils.d.ts.map +1 -0
- package/dist/msgpack/utils.js +116 -0
- package/dist/rating.d.ts +1 -1
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +2 -2
- package/dist/runtime/deno-detect.d.ts +19 -0
- package/dist/runtime/deno-detect.d.ts.map +1 -0
- package/dist/runtime/deno-detect.js +26 -0
- package/dist/{src/runtime → runtime}/detector.d.ts +2 -0
- package/dist/runtime/detector.d.ts.map +1 -0
- package/dist/runtime/detector.js +173 -0
- package/dist/runtime/loader-types.d.ts.map +1 -0
- package/dist/runtime/loader-types.js +23 -0
- package/dist/runtime/module-loader-browser.d.ts.map +1 -0
- package/dist/runtime/module-loader-browser.js +33 -0
- package/dist/runtime/module-loader.d.ts.map +1 -0
- package/dist/runtime/module-loader.js +119 -0
- package/dist/runtime/platform-io.d.ts.map +1 -0
- package/dist/runtime/platform-io.js +168 -0
- package/dist/runtime/unified-loader/index.d.ts.map +1 -0
- package/dist/{src/runtime → runtime}/unified-loader/index.js +1 -7
- package/dist/runtime/unified-loader/loader.d.ts.map +1 -0
- package/dist/runtime/unified-loader/loader.js +64 -0
- package/dist/runtime/unified-loader/module-loading.d.ts.map +1 -0
- package/dist/runtime/unified-loader/module-loading.js +90 -0
- package/dist/runtime/unified-loader/module-selection.d.ts.map +1 -0
- package/dist/runtime/unified-loader/module-selection.js +25 -0
- package/dist/runtime/unified-loader/types.d.ts.map +1 -0
- package/dist/runtime/unified-loader/types.js +24 -0
- package/dist/runtime/wasi-adapter/adapter.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/adapter.js +114 -0
- package/dist/runtime/wasi-adapter/audio-properties.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/audio-properties.js +120 -0
- package/dist/runtime/wasi-adapter/file-handle.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/file-handle.js +181 -0
- package/dist/runtime/wasi-adapter/handle-state.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/handle-state.js +48 -0
- package/dist/runtime/wasi-adapter/index.d.ts.map +1 -0
- package/dist/{src/runtime → runtime}/wasi-adapter/index.js +1 -3
- package/dist/runtime/wasi-adapter/mp4-items.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/mp4-items.js +97 -0
- package/dist/runtime/wasi-adapter/path-open.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/path-open.js +101 -0
- package/dist/runtime/wasi-adapter/property-surface.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/property-surface.js +96 -0
- package/dist/runtime/wasi-adapter/structured-fields.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/structured-fields.js +144 -0
- package/dist/runtime/wasi-adapter/tag-keys.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/tag-keys.js +65 -0
- package/dist/runtime/wasi-adapter/wasm-io.d.ts.map +1 -0
- package/dist/runtime/wasi-adapter/wasm-io.js +154 -0
- package/dist/runtime/wasi-fs-deno.d.ts.map +1 -0
- package/dist/runtime/wasi-fs-deno.js +25 -0
- package/dist/runtime/wasi-fs-node.d.ts.map +1 -0
- package/dist/runtime/wasi-fs-node.js +58 -0
- package/dist/runtime/wasi-fs-provider.d.ts.map +1 -0
- package/dist/runtime/wasi-fs-provider.js +1 -0
- package/dist/runtime/wasi-host-loader.d.ts.map +1 -0
- package/dist/runtime/wasi-host-loader.js +101 -0
- package/dist/runtime/wasi-host.d.ts.map +1 -0
- package/dist/runtime/wasi-host.js +199 -0
- package/dist/runtime/wasi-memory.d.ts.map +1 -0
- package/dist/runtime/wasi-memory.js +179 -0
- package/dist/runtime/wasmer-sdk-loader/types.d.ts.map +1 -0
- package/dist/runtime/wasmer-sdk-loader/types.js +15 -0
- package/dist/simple/batch-operations.d.ts.map +1 -0
- package/dist/simple/batch-operations.js +245 -0
- package/dist/simple/checksum-operations.d.ts.map +1 -0
- package/dist/simple/checksum-operations.js +28 -0
- package/dist/simple/config.d.ts.map +1 -0
- package/dist/simple/config.js +17 -0
- package/dist/simple/index.d.ts.map +1 -0
- package/dist/simple/index.js +8 -0
- package/dist/simple/picture-operations.d.ts.map +1 -0
- package/dist/simple/picture-operations.js +132 -0
- package/dist/simple/tag-operations.d.ts.map +1 -0
- package/dist/simple/tag-operations.js +125 -0
- package/dist/simple/with-audio-file.d.ts.map +1 -0
- package/dist/simple/with-audio-file.js +28 -0
- package/dist/simple.browser.d.ts +2 -2
- package/dist/simple.browser.d.ts.map +1 -1
- package/dist/simple.browser.js +3405 -3692
- package/dist/simple.d.ts +1 -1
- package/dist/simple.d.ts.map +1 -1
- package/dist/simple.js +8 -2
- package/dist/taglib/audio-file-base.d.ts.map +1 -0
- package/dist/taglib/audio-file-base.js +166 -0
- package/dist/taglib/audio-file-bwf.d.ts.map +1 -0
- package/dist/taglib/audio-file-bwf.js +33 -0
- package/dist/taglib/audio-file-checksum.d.ts.map +1 -0
- package/dist/taglib/audio-file-checksum.js +90 -0
- package/dist/taglib/audio-file-impl.d.ts.map +1 -0
- package/dist/taglib/audio-file-impl.js +234 -0
- package/dist/taglib/audio-file-interface.d.ts.map +1 -0
- package/dist/taglib/audio-file-interface.js +1 -0
- package/dist/taglib/auto-dispose.d.ts.map +1 -0
- package/dist/taglib/auto-dispose.js +34 -0
- package/dist/taglib/embind-adapter.d.ts.map +1 -0
- package/dist/taglib/embind-adapter.js +138 -0
- package/dist/taglib/extra-state-registry.d.ts.map +1 -0
- package/dist/taglib/extra-state-registry.js +72 -0
- package/dist/{src/taglib → taglib}/id3v2-frames.d.ts +0 -1
- package/dist/taglib/id3v2-frames.d.ts.map +1 -0
- package/dist/taglib/id3v2-frames.js +25 -0
- package/dist/taglib/index.d.ts.map +1 -0
- package/dist/taglib/index.js +7 -0
- package/dist/taglib/load-audio-data.d.ts.map +1 -0
- package/dist/taglib/load-audio-data.js +54 -0
- package/dist/taglib/media-ranges.d.ts.map +1 -0
- package/dist/taglib/media-ranges.js +309 -0
- package/dist/taglib/metadata-extent.d.ts.map +1 -0
- package/dist/taglib/metadata-extent.js +394 -0
- package/dist/taglib/mp4-item-names.d.ts.map +1 -0
- package/dist/taglib/mp4-item-names.js +14 -0
- package/dist/taglib/mutable-tag-impl.d.ts.map +1 -0
- package/dist/taglib/mutable-tag-impl.js +81 -0
- package/dist/taglib/mutable-tag.d.ts.map +1 -0
- package/dist/taglib/mutable-tag.js +1 -0
- package/dist/taglib/save-reconstruct.d.ts.map +1 -0
- package/dist/taglib/save-reconstruct.js +53 -0
- package/dist/taglib/taglib-class.d.ts.map +1 -0
- package/dist/taglib/taglib-class.js +146 -0
- package/dist/taglib-wasi.wasm +0 -0
- package/dist/taglib.d.ts.map +1 -0
- package/dist/taglib.js +7 -0
- package/dist/{src/types → types}/audio-formats.d.ts +5 -1
- package/dist/types/audio-formats.d.ts.map +1 -0
- package/dist/types/audio-formats.js +6 -0
- package/dist/types/bwf.d.ts.map +1 -0
- package/dist/types/bwf.js +1 -0
- package/dist/types/chapters.d.ts.map +1 -0
- package/dist/types/chapters.js +1 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +1 -0
- package/dist/types/format-property-keys.d.ts.map +1 -0
- package/dist/types/format-property-keys.js +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +9 -0
- package/dist/types/metadata-mappings.d.ts.map +1 -0
- package/dist/types/metadata-mappings.js +323 -0
- package/dist/types/pictures.d.ts.map +1 -0
- package/dist/types/pictures.js +79 -0
- package/dist/types/tags.d.ts.map +1 -0
- package/dist/types/tags.js +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +43 -0
- package/dist/utils/mirror-fields.d.ts.map +1 -0
- package/dist/utils/mirror-fields.js +107 -0
- package/dist/utils/node-fs.d.ts.map +1 -0
- package/dist/utils/node-fs.js +36 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +52 -0
- package/dist/utils/rating.d.ts.map +1 -0
- package/dist/utils/rating.js +150 -0
- package/dist/utils/tag-mapping.d.ts.map +1 -0
- package/dist/utils/tag-mapping.js +207 -0
- package/dist/utils/write.d.ts.map +1 -0
- package/dist/utils/write.js +18 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/dist/wasm.d.ts.map +1 -0
- package/dist/wasm.js +1 -0
- package/dist/web-utils/canvas.d.ts.map +1 -0
- package/dist/web-utils/canvas.js +97 -0
- package/dist/web-utils/data-url.d.ts.map +1 -0
- package/dist/web-utils/data-url.js +54 -0
- package/dist/web-utils/dom-integration.d.ts.map +1 -0
- package/dist/web-utils/dom-integration.js +105 -0
- package/dist/web-utils/index.d.ts.map +1 -0
- package/dist/web-utils/index.js +4 -0
- package/dist/web.browser.d.ts +5 -5
- package/dist/web.browser.d.ts.map +1 -1
- package/dist/web.browser.js +3169 -3411
- package/dist/web.d.ts +1 -1
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +5 -2
- package/package.json +136 -100
- package/dist/src/bwf/bext.d.ts.map +0 -1
- package/dist/src/bwf/bext.js +0 -126
- package/dist/src/constants/additional-properties.js +0 -204
- package/dist/src/constants/basic-properties.d.ts.map +0 -1
- package/dist/src/constants/basic-properties.js +0 -89
- package/dist/src/constants/complex-properties.d.ts.map +0 -1
- package/dist/src/constants/complex-properties.js +0 -0
- package/dist/src/constants/format-mappings.d.ts.map +0 -1
- package/dist/src/constants/format-mappings.js +0 -54
- package/dist/src/constants/general-extended-properties.js +0 -254
- package/dist/src/constants/index.d.ts.map +0 -1
- package/dist/src/constants/index.js +0 -4
- package/dist/src/constants/properties.d.ts +0 -877
- package/dist/src/constants/properties.d.ts.map +0 -1
- package/dist/src/constants/properties.js +0 -95
- package/dist/src/constants/property-types.d.ts.map +0 -1
- package/dist/src/constants/property-types.js +0 -0
- package/dist/src/constants/specialized-properties.js +0 -223
- package/dist/src/constants/utilities.d.ts.map +0 -1
- package/dist/src/constants/utilities.js +0 -33
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -1
- package/dist/src/deno-compile.d.ts.map +0 -1
- package/dist/src/deno-compile.js +0 -75
- package/dist/src/errors/base.d.ts.map +0 -1
- package/dist/src/errors/base.js +0 -49
- package/dist/src/errors/classes.d.ts.map +0 -1
- package/dist/src/errors/classes.js +0 -170
- package/dist/src/errors/guards.d.ts.map +0 -1
- package/dist/src/errors/guards.js +0 -39
- package/dist/src/errors/index.d.ts.map +0 -1
- package/dist/src/errors/index.js +0 -39
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js +0 -1
- package/dist/src/file-utils/copy-and-find.d.ts.map +0 -1
- package/dist/src/file-utils/copy-and-find.js +0 -89
- package/dist/src/file-utils/export-operations.d.ts.map +0 -1
- package/dist/src/file-utils/export-operations.js +0 -40
- package/dist/src/file-utils/import-operations.d.ts.map +0 -1
- package/dist/src/file-utils/import-operations.js +0 -42
- package/dist/src/file-utils/index.d.ts.map +0 -1
- package/dist/src/file-utils/index.js +0 -26
- package/dist/src/file-utils/mime-detection.d.ts.map +0 -1
- package/dist/src/file-utils/mime-detection.js +0 -45
- package/dist/src/folder-api/album-corroborate.d.ts.map +0 -1
- package/dist/src/folder-api/album-corroborate.js +0 -36
- package/dist/src/folder-api/album-discs.d.ts.map +0 -1
- package/dist/src/folder-api/album-discs.js +0 -122
- package/dist/src/folder-api/album-grouping.d.ts.map +0 -1
- package/dist/src/folder-api/album-grouping.js +0 -118
- package/dist/src/folder-api/album-identity.d.ts.map +0 -1
- package/dist/src/folder-api/album-identity.js +0 -151
- package/dist/src/folder-api/album-types.d.ts.map +0 -1
- package/dist/src/folder-api/album-types.js +0 -0
- package/dist/src/folder-api/directory-walker.d.ts.map +0 -1
- package/dist/src/folder-api/directory-walker.js +0 -35
- package/dist/src/folder-api/file-processors.d.ts.map +0 -1
- package/dist/src/folder-api/file-processors.js +0 -63
- package/dist/src/folder-api/folder-disc.d.ts.map +0 -1
- package/dist/src/folder-api/folder-disc.js +0 -169
- package/dist/src/folder-api/folder-operations.d.ts.map +0 -1
- package/dist/src/folder-api/folder-operations.js +0 -54
- package/dist/src/folder-api/index.d.ts.map +0 -1
- package/dist/src/folder-api/scan-for-albums.d.ts.map +0 -1
- package/dist/src/folder-api/scan-for-albums.js +0 -20
- package/dist/src/folder-api/scan-operations.d.ts.map +0 -1
- package/dist/src/folder-api/scan-operations.js +0 -77
- package/dist/src/folder-api/types.d.ts.map +0 -1
- package/dist/src/folder-api/types.js +0 -21
- package/dist/src/msgpack/decoder.d.ts.map +0 -1
- package/dist/src/msgpack/decoder.js +0 -215
- package/dist/src/msgpack/encoder.d.ts.map +0 -1
- package/dist/src/msgpack/encoder.js +0 -249
- package/dist/src/msgpack/index.d.ts.map +0 -1
- package/dist/src/msgpack/index.js +0 -56
- package/dist/src/msgpack/types.d.ts.map +0 -1
- package/dist/src/msgpack/types.js +0 -12
- package/dist/src/msgpack/utils.d.ts.map +0 -1
- package/dist/src/msgpack/utils.js +0 -134
- package/dist/src/runtime/deno-detect.d.ts +0 -8
- package/dist/src/runtime/deno-detect.d.ts.map +0 -1
- package/dist/src/runtime/deno-detect.js +0 -6
- package/dist/src/runtime/detector.d.ts.map +0 -1
- package/dist/src/runtime/detector.js +0 -181
- package/dist/src/runtime/loader-types.d.ts.map +0 -1
- package/dist/src/runtime/loader-types.js +0 -10
- package/dist/src/runtime/module-loader-browser.d.ts.map +0 -1
- package/dist/src/runtime/module-loader-browser.js +0 -37
- package/dist/src/runtime/module-loader.d.ts.map +0 -1
- package/dist/src/runtime/module-loader.js +0 -119
- package/dist/src/runtime/platform-io.d.ts.map +0 -1
- package/dist/src/runtime/platform-io.js +0 -188
- package/dist/src/runtime/unified-loader/index.d.ts.map +0 -1
- package/dist/src/runtime/unified-loader/loader.d.ts.map +0 -1
- package/dist/src/runtime/unified-loader/loader.js +0 -84
- package/dist/src/runtime/unified-loader/module-loading.d.ts.map +0 -1
- package/dist/src/runtime/unified-loader/module-loading.js +0 -122
- package/dist/src/runtime/unified-loader/module-selection.d.ts.map +0 -1
- package/dist/src/runtime/unified-loader/module-selection.js +0 -41
- package/dist/src/runtime/unified-loader/types.d.ts.map +0 -1
- package/dist/src/runtime/unified-loader/types.js +0 -25
- package/dist/src/runtime/wasi-adapter/adapter.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/adapter.js +0 -130
- package/dist/src/runtime/wasi-adapter/audio-properties.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/audio-properties.js +0 -102
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/file-handle.js +0 -197
- package/dist/src/runtime/wasi-adapter/handle-state.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/handle-state.js +0 -58
- package/dist/src/runtime/wasi-adapter/index.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/mp4-items.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/mp4-items.js +0 -80
- package/dist/src/runtime/wasi-adapter/path-open.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/path-open.js +0 -76
- package/dist/src/runtime/wasi-adapter/property-surface.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/property-surface.js +0 -104
- package/dist/src/runtime/wasi-adapter/structured-fields.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/structured-fields.js +0 -139
- package/dist/src/runtime/wasi-adapter/tag-keys.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/tag-keys.js +0 -46
- package/dist/src/runtime/wasi-adapter/wasm-io.d.ts.map +0 -1
- package/dist/src/runtime/wasi-adapter/wasm-io.js +0 -257
- package/dist/src/runtime/wasi-fs-deno.d.ts.map +0 -1
- package/dist/src/runtime/wasi-fs-deno.js +0 -26
- package/dist/src/runtime/wasi-fs-node.d.ts.map +0 -1
- package/dist/src/runtime/wasi-fs-node.js +0 -66
- package/dist/src/runtime/wasi-fs-provider.d.ts.map +0 -1
- package/dist/src/runtime/wasi-fs-provider.js +0 -0
- package/dist/src/runtime/wasi-host-loader.d.ts.map +0 -1
- package/dist/src/runtime/wasi-host-loader.js +0 -114
- package/dist/src/runtime/wasi-host.d.ts.map +0 -1
- package/dist/src/runtime/wasi-host.js +0 -202
- package/dist/src/runtime/wasi-memory.d.ts.map +0 -1
- package/dist/src/runtime/wasi-memory.js +0 -197
- package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +0 -1
- package/dist/src/runtime/wasmer-sdk-loader/types.js +0 -12
- package/dist/src/simple/batch-operations.d.ts.map +0 -1
- package/dist/src/simple/batch-operations.js +0 -186
- package/dist/src/simple/checksum-operations.d.ts.map +0 -1
- package/dist/src/simple/checksum-operations.js +0 -7
- package/dist/src/simple/config.d.ts.map +0 -1
- package/dist/src/simple/config.js +0 -18
- package/dist/src/simple/index.d.ts.map +0 -1
- package/dist/src/simple/index.js +0 -60
- package/dist/src/simple/picture-operations.d.ts.map +0 -1
- package/dist/src/simple/picture-operations.js +0 -68
- package/dist/src/simple/tag-operations.d.ts.map +0 -1
- package/dist/src/simple/tag-operations.js +0 -90
- package/dist/src/simple/with-audio-file.d.ts.map +0 -1
- package/dist/src/simple/with-audio-file.js +0 -39
- package/dist/src/taglib/audio-file-base.d.ts.map +0 -1
- package/dist/src/taglib/audio-file-base.js +0 -187
- package/dist/src/taglib/audio-file-bwf.d.ts.map +0 -1
- package/dist/src/taglib/audio-file-bwf.js +0 -41
- package/dist/src/taglib/audio-file-checksum.d.ts.map +0 -1
- package/dist/src/taglib/audio-file-checksum.js +0 -77
- package/dist/src/taglib/audio-file-impl.d.ts.map +0 -1
- package/dist/src/taglib/audio-file-impl.js +0 -317
- package/dist/src/taglib/audio-file-interface.d.ts.map +0 -1
- package/dist/src/taglib/audio-file-interface.js +0 -0
- package/dist/src/taglib/auto-dispose.d.ts.map +0 -1
- package/dist/src/taglib/auto-dispose.js +0 -13
- package/dist/src/taglib/embind-adapter.d.ts.map +0 -1
- package/dist/src/taglib/embind-adapter.js +0 -141
- package/dist/src/taglib/extra-state-registry.d.ts.map +0 -1
- package/dist/src/taglib/extra-state-registry.js +0 -78
- package/dist/src/taglib/id3v2-frames.d.ts.map +0 -1
- package/dist/src/taglib/id3v2-frames.js +0 -42
- package/dist/src/taglib/index.d.ts.map +0 -1
- package/dist/src/taglib/index.js +0 -41
- package/dist/src/taglib/load-audio-data.d.ts.map +0 -1
- package/dist/src/taglib/load-audio-data.js +0 -51
- package/dist/src/taglib/media-ranges.d.ts.map +0 -1
- package/dist/src/taglib/media-ranges.js +0 -192
- package/dist/src/taglib/metadata-extent.d.ts.map +0 -1
- package/dist/src/taglib/metadata-extent.js +0 -189
- package/dist/src/taglib/mp4-item-names.d.ts.map +0 -1
- package/dist/src/taglib/mp4-item-names.js +0 -4
- package/dist/src/taglib/mutable-tag-impl.d.ts.map +0 -1
- package/dist/src/taglib/mutable-tag-impl.js +0 -88
- package/dist/src/taglib/mutable-tag.d.ts.map +0 -1
- package/dist/src/taglib/mutable-tag.js +0 -0
- package/dist/src/taglib/save-reconstruct.d.ts.map +0 -1
- package/dist/src/taglib/save-reconstruct.js +0 -43
- package/dist/src/taglib/taglib-class.d.ts.map +0 -1
- package/dist/src/taglib/taglib-class.js +0 -195
- package/dist/src/taglib.d.ts.map +0 -1
- package/dist/src/taglib.js +0 -1
- package/dist/src/types/audio-formats.d.ts.map +0 -1
- package/dist/src/types/audio-formats.js +0 -6
- package/dist/src/types/bwf.d.ts.map +0 -1
- package/dist/src/types/bwf.js +0 -0
- package/dist/src/types/chapters.d.ts.map +0 -1
- package/dist/src/types/chapters.js +0 -0
- package/dist/src/types/config.d.ts.map +0 -1
- package/dist/src/types/config.js +0 -0
- package/dist/src/types/format-property-keys.d.ts.map +0 -1
- package/dist/src/types/format-property-keys.js +0 -0
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -8
- package/dist/src/types/metadata-mappings.d.ts.map +0 -1
- package/dist/src/types/metadata-mappings.js +0 -252
- package/dist/src/types/pictures.d.ts.map +0 -1
- package/dist/src/types/pictures.js +0 -64
- package/dist/src/types/tags.d.ts.map +0 -1
- package/dist/src/types/tags.js +0 -0
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -1
- package/dist/src/utils/file.d.ts.map +0 -1
- package/dist/src/utils/file.js +0 -52
- package/dist/src/utils/mirror-fields.d.ts.map +0 -1
- package/dist/src/utils/mirror-fields.js +0 -75
- package/dist/src/utils/node-fs.d.ts.map +0 -1
- package/dist/src/utils/node-fs.js +0 -22
- package/dist/src/utils/path.d.ts.map +0 -1
- package/dist/src/utils/path.js +0 -36
- package/dist/src/utils/rating.d.ts.map +0 -1
- package/dist/src/utils/rating.js +0 -73
- package/dist/src/utils/tag-mapping.d.ts.map +0 -1
- package/dist/src/utils/tag-mapping.js +0 -214
- package/dist/src/utils/write.d.ts.map +0 -1
- package/dist/src/utils/write.js +0 -17
- package/dist/src/version.d.ts +0 -2
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -4
- package/dist/src/wasm.d.ts.map +0 -1
- package/dist/src/wasm.js +0 -0
- package/dist/src/web-utils/canvas.d.ts.map +0 -1
- package/dist/src/web-utils/canvas.js +0 -60
- package/dist/src/web-utils/data-url.d.ts.map +0 -1
- package/dist/src/web-utils/data-url.js +0 -34
- package/dist/src/web-utils/dom-integration.d.ts.map +0 -1
- package/dist/src/web-utils/dom-integration.js +0 -53
- package/dist/src/web-utils/index.d.ts.map +0 -1
- package/dist/src/web-utils/index.js +0 -21
- /package/dist/{src/bwf → bwf}/bext.d.ts +0 -0
- /package/dist/{src/constants → constants}/additional-properties.d.ts +0 -0
- /package/dist/{src/constants → constants}/basic-properties.d.ts +0 -0
- /package/dist/{src/constants → constants}/complex-properties.d.ts +0 -0
- /package/dist/{src/constants → constants}/format-mappings.d.ts +0 -0
- /package/dist/{src/constants → constants}/general-extended-properties.d.ts +0 -0
- /package/dist/{src/constants → constants}/index.d.ts +0 -0
- /package/dist/{src/constants → constants}/property-types.d.ts +0 -0
- /package/dist/{src/constants → constants}/specialized-properties.d.ts +0 -0
- /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
- /package/dist/{src/errors → errors}/base.d.ts +0 -0
- /package/dist/{src/errors → errors}/classes.d.ts +0 -0
- /package/dist/{src/errors → errors}/guards.d.ts +0 -0
- /package/dist/{src/errors → errors}/index.d.ts +0 -0
- /package/dist/{src/errors.d.ts → errors.d.ts} +0 -0
- /package/dist/{src/file-utils → file-utils}/copy-and-find.d.ts +0 -0
- /package/dist/{src/file-utils → file-utils}/export-operations.d.ts +0 -0
- /package/dist/{src/file-utils → file-utils}/import-operations.d.ts +0 -0
- /package/dist/{src/file-utils → file-utils}/index.d.ts +0 -0
- /package/dist/{src/file-utils → file-utils}/mime-detection.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/album-corroborate.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/album-discs.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/album-grouping.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/album-identity.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/album-types.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/directory-walker.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/file-processors.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/folder-disc.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/folder-operations.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/index.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/scan-for-albums.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/scan-operations.d.ts +0 -0
- /package/dist/{src/folder-api → folder-api}/types.d.ts +0 -0
- /package/dist/{src/msgpack → msgpack}/decoder.d.ts +0 -0
- /package/dist/{src/msgpack → msgpack}/encoder.d.ts +0 -0
- /package/dist/{src/msgpack → msgpack}/index.d.ts +0 -0
- /package/dist/{src/msgpack → msgpack}/utils.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/loader-types.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/module-loader-browser.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/module-loader.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/platform-io.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/unified-loader/index.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/unified-loader/loader.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/unified-loader/module-loading.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/unified-loader/module-selection.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/unified-loader/types.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/adapter.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/audio-properties.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/file-handle.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/handle-state.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/index.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/mp4-items.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/path-open.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/property-surface.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/structured-fields.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/tag-keys.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-adapter/wasm-io.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-fs-deno.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-fs-node.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-fs-provider.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-host-loader.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-host.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasi-memory.d.ts +0 -0
- /package/dist/{src/runtime → runtime}/wasmer-sdk-loader/types.d.ts +0 -0
- /package/dist/{src/simple → simple}/batch-operations.d.ts +0 -0
- /package/dist/{src/simple → simple}/checksum-operations.d.ts +0 -0
- /package/dist/{src/simple → simple}/config.d.ts +0 -0
- /package/dist/{src/simple → simple}/index.d.ts +0 -0
- /package/dist/{src/simple → simple}/picture-operations.d.ts +0 -0
- /package/dist/{src/simple → simple}/tag-operations.d.ts +0 -0
- /package/dist/{src/simple → simple}/with-audio-file.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/audio-file-base.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/audio-file-bwf.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/audio-file-checksum.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/audio-file-impl.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/audio-file-interface.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/auto-dispose.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/embind-adapter.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/extra-state-registry.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/index.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/load-audio-data.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/media-ranges.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/metadata-extent.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/mp4-item-names.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/mutable-tag-impl.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/mutable-tag.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/save-reconstruct.d.ts +0 -0
- /package/dist/{src/taglib → taglib}/taglib-class.d.ts +0 -0
- /package/dist/{src/taglib.d.ts → taglib.d.ts} +0 -0
- /package/dist/{src/types → types}/bwf.d.ts +0 -0
- /package/dist/{src/types → types}/chapters.d.ts +0 -0
- /package/dist/{src/types → types}/config.d.ts +0 -0
- /package/dist/{src/types → types}/format-property-keys.d.ts +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
- /package/dist/{src/types → types}/metadata-mappings.d.ts +0 -0
- /package/dist/{src/types → types}/pictures.d.ts +0 -0
- /package/dist/{src/types → types}/tags.d.ts +0 -0
- /package/dist/{src/types.d.ts → types.d.ts} +0 -0
- /package/dist/{src/utils → utils}/file.d.ts +0 -0
- /package/dist/{src/utils → utils}/mirror-fields.d.ts +0 -0
- /package/dist/{src/utils → utils}/node-fs.d.ts +0 -0
- /package/dist/{src/utils → utils}/path.d.ts +0 -0
- /package/dist/{src/utils → utils}/rating.d.ts +0 -0
- /package/dist/{src/utils → utils}/tag-mapping.d.ts +0 -0
- /package/dist/{src/utils → utils}/write.d.ts +0 -0
- /package/dist/{src/wasm.d.ts → wasm.d.ts} +0 -0
- /package/dist/{src/web-utils → web-utils}/canvas.d.ts +0 -0
- /package/dist/{src/web-utils → web-utils}/data-url.d.ts +0 -0
- /package/dist/{src/web-utils → web-utils}/dom-integration.d.ts +0 -0
- /package/dist/{src/web-utils → web-utils}/index.d.ts +0 -0
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { SUPPORTED_FORMATS, TagLibError } from "./base.js";
|
|
5
|
-
function errorMessage(error) {
|
|
6
|
-
return error instanceof Error ? error.message : String(error);
|
|
7
|
-
}
|
|
8
|
-
function createErrorMessage(prefix, details) {
|
|
9
|
-
return `${prefix}: ${details}`;
|
|
10
|
-
}
|
|
11
|
-
function formatFileSize(bytes) {
|
|
12
|
-
if (bytes < 1024) return `${bytes} bytes`;
|
|
13
|
-
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
14
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
15
|
-
}
|
|
16
|
-
class TagLibInitializationError extends TagLibError {
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new TagLibInitializationError
|
|
19
|
-
* @param message - Description of the initialization failure
|
|
20
|
-
* @param details - Additional context about the error
|
|
21
|
-
*/
|
|
22
|
-
constructor(message, details) {
|
|
23
|
-
super(
|
|
24
|
-
"INITIALIZATION",
|
|
25
|
-
createErrorMessage("Failed to initialize TagLib Wasm module", message),
|
|
26
|
-
details
|
|
27
|
-
);
|
|
28
|
-
this.name = "TagLibInitializationError";
|
|
29
|
-
Object.setPrototypeOf(this, TagLibInitializationError.prototype);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
class InvalidFormatError extends TagLibError {
|
|
33
|
-
/**
|
|
34
|
-
* Creates a new InvalidFormatError
|
|
35
|
-
* @param message - Description of the format error
|
|
36
|
-
* @param bufferSize - Size of the audio buffer in bytes
|
|
37
|
-
* @param details - Additional context about the error
|
|
38
|
-
*/
|
|
39
|
-
constructor(message, bufferSize, details) {
|
|
40
|
-
const errorDetails = [`Invalid audio file format: ${message}`];
|
|
41
|
-
if (bufferSize !== void 0) {
|
|
42
|
-
errorDetails.push(`Buffer size: ${formatFileSize(bufferSize)}`);
|
|
43
|
-
if (bufferSize < 1024) {
|
|
44
|
-
errorDetails.push(
|
|
45
|
-
"Audio files must be at least 1KB to contain valid headers."
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
super(
|
|
50
|
-
"INVALID_FORMAT",
|
|
51
|
-
errorDetails.join(". "),
|
|
52
|
-
{ ...details, bufferSize }
|
|
53
|
-
);
|
|
54
|
-
__publicField(this, "bufferSize", bufferSize);
|
|
55
|
-
this.name = "InvalidFormatError";
|
|
56
|
-
Object.setPrototypeOf(this, InvalidFormatError.prototype);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
class UnsupportedFormatError extends TagLibError {
|
|
60
|
-
/**
|
|
61
|
-
* Creates a new UnsupportedFormatError
|
|
62
|
-
* @param format - The unsupported format that was encountered
|
|
63
|
-
* @param supportedFormats - List of formats that are supported
|
|
64
|
-
* @param details - Additional context about the error
|
|
65
|
-
*/
|
|
66
|
-
constructor(format, supportedFormats = SUPPORTED_FORMATS, details) {
|
|
67
|
-
super(
|
|
68
|
-
"UNSUPPORTED_FORMAT",
|
|
69
|
-
`Unsupported audio format: ${format}. Supported formats: ${supportedFormats.join(", ")}`,
|
|
70
|
-
{ ...details, format, supportedFormats }
|
|
71
|
-
);
|
|
72
|
-
__publicField(this, "format", format);
|
|
73
|
-
__publicField(this, "supportedFormats", supportedFormats);
|
|
74
|
-
this.name = "UnsupportedFormatError";
|
|
75
|
-
Object.setPrototypeOf(this, UnsupportedFormatError.prototype);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
class FileOperationError extends TagLibError {
|
|
79
|
-
/**
|
|
80
|
-
* Creates a new FileOperationError
|
|
81
|
-
* @param operation - The file operation that failed
|
|
82
|
-
* @param message - Description of the failure
|
|
83
|
-
* @param path - File path involved in the operation
|
|
84
|
-
* @param details - Additional context about the error
|
|
85
|
-
*/
|
|
86
|
-
constructor(operation, message, path, details) {
|
|
87
|
-
const errorDetails = [`Failed to ${operation} file`];
|
|
88
|
-
if (path) {
|
|
89
|
-
errorDetails.push(`Path: ${path}`);
|
|
90
|
-
}
|
|
91
|
-
errorDetails.push(message);
|
|
92
|
-
super(
|
|
93
|
-
"FILE_OPERATION",
|
|
94
|
-
errorDetails.join(". "),
|
|
95
|
-
{ ...details, operation, path }
|
|
96
|
-
);
|
|
97
|
-
__publicField(this, "operation", operation);
|
|
98
|
-
__publicField(this, "path", path);
|
|
99
|
-
this.name = "FileOperationError";
|
|
100
|
-
Object.setPrototypeOf(this, FileOperationError.prototype);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
class MetadataError extends TagLibError {
|
|
104
|
-
/**
|
|
105
|
-
* Creates a new MetadataError
|
|
106
|
-
* @param operation - The metadata operation that failed
|
|
107
|
-
* @param message - Description of the failure
|
|
108
|
-
* @param field - The metadata field involved
|
|
109
|
-
* @param details - Additional context about the error
|
|
110
|
-
*/
|
|
111
|
-
constructor(operation, message, field, details) {
|
|
112
|
-
const errorDetails = [`Failed to ${operation} metadata`];
|
|
113
|
-
if (field) {
|
|
114
|
-
errorDetails.push(`Field: ${field}`);
|
|
115
|
-
}
|
|
116
|
-
errorDetails.push(message);
|
|
117
|
-
super(
|
|
118
|
-
"METADATA",
|
|
119
|
-
errorDetails.join(". "),
|
|
120
|
-
{ ...details, operation, field }
|
|
121
|
-
);
|
|
122
|
-
__publicField(this, "operation", operation);
|
|
123
|
-
__publicField(this, "field", field);
|
|
124
|
-
this.name = "MetadataError";
|
|
125
|
-
Object.setPrototypeOf(this, MetadataError.prototype);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
class MemoryError extends TagLibError {
|
|
129
|
-
/**
|
|
130
|
-
* Creates a new MemoryError
|
|
131
|
-
* @param message - Description of the memory failure
|
|
132
|
-
* @param details - Additional context about the error
|
|
133
|
-
*/
|
|
134
|
-
constructor(message, details) {
|
|
135
|
-
super(
|
|
136
|
-
"MEMORY",
|
|
137
|
-
createErrorMessage("Memory allocation failed", message),
|
|
138
|
-
details
|
|
139
|
-
);
|
|
140
|
-
this.name = "MemoryError";
|
|
141
|
-
Object.setPrototypeOf(this, MemoryError.prototype);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
class EnvironmentError extends TagLibError {
|
|
145
|
-
/**
|
|
146
|
-
* Creates a new EnvironmentError
|
|
147
|
-
* @param environment - The runtime environment name
|
|
148
|
-
* @param reason - Why the environment is incompatible
|
|
149
|
-
* @param requiredFeature - The feature that is missing
|
|
150
|
-
*/
|
|
151
|
-
constructor(environment, reason, requiredFeature) {
|
|
152
|
-
const message = requiredFeature ? `Environment '${environment}' ${reason}. Required feature: ${requiredFeature}.` : `Environment '${environment}' ${reason}.`;
|
|
153
|
-
super("ENVIRONMENT", message);
|
|
154
|
-
__publicField(this, "environment", environment);
|
|
155
|
-
__publicField(this, "reason", reason);
|
|
156
|
-
__publicField(this, "requiredFeature", requiredFeature);
|
|
157
|
-
this.name = "EnvironmentError";
|
|
158
|
-
Object.setPrototypeOf(this, EnvironmentError.prototype);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
export {
|
|
162
|
-
EnvironmentError,
|
|
163
|
-
FileOperationError,
|
|
164
|
-
InvalidFormatError,
|
|
165
|
-
MemoryError,
|
|
166
|
-
MetadataError,
|
|
167
|
-
TagLibInitializationError,
|
|
168
|
-
UnsupportedFormatError,
|
|
169
|
-
errorMessage
|
|
170
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../../src/errors/guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAEtB,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kBAAkB,CAE7B;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,sBAAsB,CAEjC;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,kBAAkB,CAE7B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { TagLibError } from "./base.js";
|
|
2
|
-
import {
|
|
3
|
-
EnvironmentError,
|
|
4
|
-
FileOperationError,
|
|
5
|
-
InvalidFormatError,
|
|
6
|
-
MemoryError,
|
|
7
|
-
MetadataError,
|
|
8
|
-
UnsupportedFormatError
|
|
9
|
-
} from "./classes.js";
|
|
10
|
-
function isTagLibError(error) {
|
|
11
|
-
return error instanceof TagLibError;
|
|
12
|
-
}
|
|
13
|
-
function isInvalidFormatError(error) {
|
|
14
|
-
return error instanceof InvalidFormatError;
|
|
15
|
-
}
|
|
16
|
-
function isUnsupportedFormatError(error) {
|
|
17
|
-
return error instanceof UnsupportedFormatError;
|
|
18
|
-
}
|
|
19
|
-
function isFileOperationError(error) {
|
|
20
|
-
return error instanceof FileOperationError;
|
|
21
|
-
}
|
|
22
|
-
function isMetadataError(error) {
|
|
23
|
-
return error instanceof MetadataError;
|
|
24
|
-
}
|
|
25
|
-
function isMemoryError(error) {
|
|
26
|
-
return error instanceof MemoryError;
|
|
27
|
-
}
|
|
28
|
-
function isEnvironmentError(error) {
|
|
29
|
-
return error instanceof EnvironmentError;
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
isEnvironmentError,
|
|
33
|
-
isFileOperationError,
|
|
34
|
-
isInvalidFormatError,
|
|
35
|
-
isMemoryError,
|
|
36
|
-
isMetadataError,
|
|
37
|
-
isTagLibError,
|
|
38
|
-
isUnsupportedFormatError
|
|
39
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3D,YAAY,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,aAAa,EACb,wBAAwB,GACzB,MAAM,aAAa,CAAC"}
|
package/dist/src/errors/index.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { SUPPORTED_FORMATS, TagLibError } from "./base.js";
|
|
2
|
-
import {
|
|
3
|
-
EnvironmentError,
|
|
4
|
-
errorMessage,
|
|
5
|
-
FileOperationError,
|
|
6
|
-
InvalidFormatError,
|
|
7
|
-
MemoryError,
|
|
8
|
-
MetadataError,
|
|
9
|
-
TagLibInitializationError,
|
|
10
|
-
UnsupportedFormatError
|
|
11
|
-
} from "./classes.js";
|
|
12
|
-
import {
|
|
13
|
-
isEnvironmentError,
|
|
14
|
-
isFileOperationError,
|
|
15
|
-
isInvalidFormatError,
|
|
16
|
-
isMemoryError,
|
|
17
|
-
isMetadataError,
|
|
18
|
-
isTagLibError,
|
|
19
|
-
isUnsupportedFormatError
|
|
20
|
-
} from "./guards.js";
|
|
21
|
-
export {
|
|
22
|
-
EnvironmentError,
|
|
23
|
-
FileOperationError,
|
|
24
|
-
InvalidFormatError,
|
|
25
|
-
MemoryError,
|
|
26
|
-
MetadataError,
|
|
27
|
-
SUPPORTED_FORMATS,
|
|
28
|
-
TagLibError,
|
|
29
|
-
TagLibInitializationError,
|
|
30
|
-
UnsupportedFormatError,
|
|
31
|
-
errorMessage,
|
|
32
|
-
isEnvironmentError,
|
|
33
|
-
isFileOperationError,
|
|
34
|
-
isInvalidFormatError,
|
|
35
|
-
isMemoryError,
|
|
36
|
-
isMetadataError,
|
|
37
|
-
isTagLibError,
|
|
38
|
-
isUnsupportedFormatError
|
|
39
|
-
};
|
package/dist/src/errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,mBAAmB,CAAC"}
|
package/dist/src/errors.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./errors/index.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy-and-find.d.ts","sourceRoot":"","sources":["../../../src/file-utils/copy-and-find.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,OAAO,CAAC;CACd,GACL,OAAO,CAAC,IAAI,CAAC,CA6Bf;AA2BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC,CAiCD"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { MetadataError } from "../errors/classes.js";
|
|
2
|
-
import {
|
|
3
|
-
applyCoverArt,
|
|
4
|
-
applyPictures,
|
|
5
|
-
readCoverArt,
|
|
6
|
-
readPictures
|
|
7
|
-
} from "../simple/index.js";
|
|
8
|
-
import { readFileData } from "../utils/file.js";
|
|
9
|
-
import { writeFileData } from "../utils/write.js";
|
|
10
|
-
async function copyCoverArt(sourcePath, targetPath, options = {}) {
|
|
11
|
-
if (options.copyAll) {
|
|
12
|
-
const pictures = await readPictures(sourcePath);
|
|
13
|
-
if (pictures.length === 0) {
|
|
14
|
-
throw new MetadataError("read", `No pictures found. Path: ${sourcePath}`);
|
|
15
|
-
}
|
|
16
|
-
const modifiedBuffer = await applyPictures(targetPath, pictures);
|
|
17
|
-
await writeFileData(targetPath, modifiedBuffer);
|
|
18
|
-
} else {
|
|
19
|
-
const coverData = await readCoverArt(sourcePath);
|
|
20
|
-
if (!coverData) {
|
|
21
|
-
throw new MetadataError(
|
|
22
|
-
"read",
|
|
23
|
-
`No cover art found. Path: ${sourcePath}`
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
const pictures = await readPictures(sourcePath);
|
|
27
|
-
const coverPicture = pictures.find(
|
|
28
|
-
(p) => p.type === "FrontCover"
|
|
29
|
-
) ?? pictures[0];
|
|
30
|
-
const modifiedBuffer = await applyCoverArt(
|
|
31
|
-
targetPath,
|
|
32
|
-
coverData,
|
|
33
|
-
coverPicture.mimeType
|
|
34
|
-
);
|
|
35
|
-
await writeFileData(targetPath, modifiedBuffer);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function fileExists(path) {
|
|
39
|
-
try {
|
|
40
|
-
const data = await readFileData(path);
|
|
41
|
-
return data.length > 0;
|
|
42
|
-
} catch {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async function findCoverFile(dir, names, extensions) {
|
|
47
|
-
for (const name of names) {
|
|
48
|
-
for (const ext of extensions) {
|
|
49
|
-
const path = `${dir}${name}.${ext}`;
|
|
50
|
-
if (await fileExists(path)) {
|
|
51
|
-
return path;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return void 0;
|
|
56
|
-
}
|
|
57
|
-
async function findCoverArtFiles(audioPath) {
|
|
58
|
-
const dir = audioPath.substring(0, audioPath.lastIndexOf("/") + 1);
|
|
59
|
-
const extensions = ["jpg", "jpeg", "png", "gif", "webp"];
|
|
60
|
-
const found = {};
|
|
61
|
-
const frontPath = await findCoverFile(
|
|
62
|
-
dir,
|
|
63
|
-
["cover", "front", "Cover", "Front"],
|
|
64
|
-
extensions
|
|
65
|
-
);
|
|
66
|
-
if (frontPath) found.front = frontPath;
|
|
67
|
-
const folderPath = await findCoverFile(
|
|
68
|
-
dir,
|
|
69
|
-
["folder", "Folder"],
|
|
70
|
-
extensions
|
|
71
|
-
);
|
|
72
|
-
if (folderPath) found.folder = folderPath;
|
|
73
|
-
const otherNames = ["album", "artwork", "Album", "Artwork"];
|
|
74
|
-
for (const name of otherNames) {
|
|
75
|
-
const path = await findCoverFile(dir, [name], extensions);
|
|
76
|
-
if (path) found[name.toLowerCase()] = path;
|
|
77
|
-
}
|
|
78
|
-
const backPath = await findCoverFile(
|
|
79
|
-
dir,
|
|
80
|
-
["back", "Back", "back-cover", "Back-Cover"],
|
|
81
|
-
extensions
|
|
82
|
-
);
|
|
83
|
-
if (backPath) found.back = backPath;
|
|
84
|
-
return found;
|
|
85
|
-
}
|
|
86
|
-
export {
|
|
87
|
-
copyCoverArt,
|
|
88
|
-
findCoverArtFiles
|
|
89
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-operations.d.ts","sourceRoot":"","sources":["../../../src/file-utils/export-operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAMxD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACrD,GACL,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { MetadataError } from "../errors/classes.js";
|
|
2
|
-
import { readCoverArt, readPictures } from "../simple/index.js";
|
|
3
|
-
import { writeFileData } from "../utils/write.js";
|
|
4
|
-
import { generatePictureFilename } from "./mime-detection.js";
|
|
5
|
-
import { joinPath as join } from "../utils/path.js";
|
|
6
|
-
async function exportCoverArt(audioPath, imagePath) {
|
|
7
|
-
const coverData = await readCoverArt(audioPath);
|
|
8
|
-
if (!coverData) {
|
|
9
|
-
throw new MetadataError("read", `No cover art found. Path: ${audioPath}`);
|
|
10
|
-
}
|
|
11
|
-
await writeFileData(imagePath, coverData);
|
|
12
|
-
}
|
|
13
|
-
async function exportPictureByType(audioPath, imagePath, type) {
|
|
14
|
-
const pictures = await readPictures(audioPath);
|
|
15
|
-
const picture = pictures.find((pic) => pic.type === type);
|
|
16
|
-
if (!picture) {
|
|
17
|
-
throw new MetadataError(
|
|
18
|
-
"read",
|
|
19
|
-
`No picture of type ${type} found. Path: ${audioPath}`
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
await writeFileData(imagePath, picture.data);
|
|
23
|
-
}
|
|
24
|
-
async function exportAllPictures(audioPath, outputDir, options = {}) {
|
|
25
|
-
const pictures = await readPictures(audioPath);
|
|
26
|
-
const exportedPaths = [];
|
|
27
|
-
for (let i = 0; i < pictures.length; i++) {
|
|
28
|
-
const picture = pictures[i];
|
|
29
|
-
const filename = options.nameFormat ? options.nameFormat(picture, i) : generatePictureFilename(picture, i);
|
|
30
|
-
const fullPath = join(outputDir, filename);
|
|
31
|
-
await writeFileData(fullPath, picture.data);
|
|
32
|
-
exportedPaths.push(fullPath);
|
|
33
|
-
}
|
|
34
|
-
return exportedPaths;
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
37
|
-
exportAllPictures,
|
|
38
|
-
exportCoverArt,
|
|
39
|
-
exportPictureByType
|
|
40
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import-operations.d.ts","sourceRoot":"","sources":["../../../src/file-utils/import-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAOxD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,IAAI,CAAC,CAMf;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,WAAW,EACjB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,WAA0B,EAChC,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,OAAO,CAAC,CAUlB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { applyCoverArt, replacePictureByType } from "../simple/index.js";
|
|
2
|
-
import { readFileData } from "../utils/file.js";
|
|
3
|
-
import { writeFileData } from "../utils/write.js";
|
|
4
|
-
import { detectMimeType } from "./mime-detection.js";
|
|
5
|
-
import { basename } from "../utils/path.js";
|
|
6
|
-
async function importCoverArt(audioPath, imagePath, options = {}) {
|
|
7
|
-
const imageData = await readFileData(imagePath);
|
|
8
|
-
const mimeType = detectMimeType(imagePath, options.mimeType);
|
|
9
|
-
const modifiedBuffer = await applyCoverArt(audioPath, imageData, mimeType);
|
|
10
|
-
await writeFileData(audioPath, modifiedBuffer);
|
|
11
|
-
}
|
|
12
|
-
async function importPictureWithType(audioPath, imagePath, type, options = {}) {
|
|
13
|
-
const imageData = await readFileData(imagePath);
|
|
14
|
-
const mimeType = detectMimeType(imagePath, options.mimeType);
|
|
15
|
-
const picture = {
|
|
16
|
-
mimeType,
|
|
17
|
-
data: imageData,
|
|
18
|
-
type,
|
|
19
|
-
...options.description !== void 0 ? { description: options.description } : {}
|
|
20
|
-
};
|
|
21
|
-
const modifiedBuffer = await replacePictureByType(audioPath, picture);
|
|
22
|
-
await writeFileData(audioPath, modifiedBuffer);
|
|
23
|
-
}
|
|
24
|
-
async function loadPictureFromFile(imagePath, type = "FrontCover", options = {}) {
|
|
25
|
-
const data = await readFileData(imagePath);
|
|
26
|
-
const mimeType = detectMimeType(imagePath, options.mimeType);
|
|
27
|
-
return {
|
|
28
|
-
mimeType,
|
|
29
|
-
data,
|
|
30
|
-
type,
|
|
31
|
-
description: options.description ?? basename(imagePath)
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
async function savePictureToFile(picture, imagePath) {
|
|
35
|
-
await writeFileData(imagePath, picture.data);
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
importCoverArt,
|
|
39
|
-
importPictureWithType,
|
|
40
|
-
loadPictureFromFile,
|
|
41
|
-
savePictureToFile
|
|
42
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file-utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { detectMimeType, generatePictureFilename } from "./mime-detection.js";
|
|
2
|
-
import {
|
|
3
|
-
exportAllPictures,
|
|
4
|
-
exportCoverArt,
|
|
5
|
-
exportPictureByType
|
|
6
|
-
} from "./export-operations.js";
|
|
7
|
-
import {
|
|
8
|
-
importCoverArt,
|
|
9
|
-
importPictureWithType,
|
|
10
|
-
loadPictureFromFile,
|
|
11
|
-
savePictureToFile
|
|
12
|
-
} from "./import-operations.js";
|
|
13
|
-
import { copyCoverArt, findCoverArtFiles } from "./copy-and-find.js";
|
|
14
|
-
export {
|
|
15
|
-
copyCoverArt,
|
|
16
|
-
detectMimeType,
|
|
17
|
-
exportAllPictures,
|
|
18
|
-
exportCoverArt,
|
|
19
|
-
exportPictureByType,
|
|
20
|
-
findCoverArtFiles,
|
|
21
|
-
generatePictureFilename,
|
|
22
|
-
importCoverArt,
|
|
23
|
-
importPictureWithType,
|
|
24
|
-
loadPictureFromFile,
|
|
25
|
-
savePictureToFile
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mime-detection.d.ts","sourceRoot":"","sources":["../../../src/file-utils/mime-detection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,aAAa,CAAC;AAWxD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAItE;AA0BD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,MAAM,GACZ,MAAM,CAIR"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const MIME_TYPES = {
|
|
2
|
-
"jpg": "image/jpeg",
|
|
3
|
-
"jpeg": "image/jpeg",
|
|
4
|
-
"png": "image/png",
|
|
5
|
-
"gif": "image/gif",
|
|
6
|
-
"webp": "image/webp",
|
|
7
|
-
"bmp": "image/bmp"
|
|
8
|
-
};
|
|
9
|
-
function detectMimeType(path, override) {
|
|
10
|
-
if (override) return override;
|
|
11
|
-
const ext = path.split(".").pop()?.toLowerCase();
|
|
12
|
-
return MIME_TYPES[ext ?? ""] ?? "image/jpeg";
|
|
13
|
-
}
|
|
14
|
-
const PICTURE_TYPE_FILENAMES = {
|
|
15
|
-
Other: "other",
|
|
16
|
-
FileIcon: "file-icon",
|
|
17
|
-
OtherFileIcon: "other-file-icon",
|
|
18
|
-
FrontCover: "front-cover",
|
|
19
|
-
BackCover: "back-cover",
|
|
20
|
-
LeafletPage: "leaflet",
|
|
21
|
-
Media: "media",
|
|
22
|
-
LeadArtist: "lead-artist",
|
|
23
|
-
Artist: "artist",
|
|
24
|
-
Conductor: "conductor",
|
|
25
|
-
Band: "band",
|
|
26
|
-
Composer: "composer",
|
|
27
|
-
Lyricist: "lyricist",
|
|
28
|
-
RecordingLocation: "recording-location",
|
|
29
|
-
DuringRecording: "during-recording",
|
|
30
|
-
DuringPerformance: "during-performance",
|
|
31
|
-
MovieScreenCapture: "screen-capture",
|
|
32
|
-
ColouredFish: "fish",
|
|
33
|
-
Illustration: "illustration",
|
|
34
|
-
BandLogo: "band-logo",
|
|
35
|
-
PublisherLogo: "publisher-logo"
|
|
36
|
-
};
|
|
37
|
-
function generatePictureFilename(picture, index) {
|
|
38
|
-
const typeName = PICTURE_TYPE_FILENAMES[picture.type] ?? "other";
|
|
39
|
-
const ext = picture.mimeType.split("/")[1] ?? "jpg";
|
|
40
|
-
return `${typeName}-${index + 1}.${ext}`;
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
detectMimeType,
|
|
44
|
-
generatePictureFilename
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"album-corroborate.d.ts","sourceRoot":"","sources":["../../../src/folder-api/album-corroborate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElE,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAI1D,CAAC;AAEF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAoC1E"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { basename } from "../utils/path.js";
|
|
2
|
-
import { parseDiscName } from "./folder-disc.js";
|
|
3
|
-
const CONFIDENCE_RANK = {
|
|
4
|
-
low: 0,
|
|
5
|
-
medium: 1,
|
|
6
|
-
high: 2
|
|
7
|
-
};
|
|
8
|
-
function corroborated(parse, siblings) {
|
|
9
|
-
if (!parse.gated && parse.kind === "exact") return true;
|
|
10
|
-
if (siblings.length === 0) return false;
|
|
11
|
-
const siblingParses = siblings.map((s) => parseDiscName(basename(s))).filter((p) => p !== void 0);
|
|
12
|
-
const hasExactSibling = siblingParses.some(
|
|
13
|
-
(p) => !p.gated && p.kind === "exact"
|
|
14
|
-
);
|
|
15
|
-
const hasNumberedSibling = siblingParses.some(
|
|
16
|
-
(p) => p.number !== void 0
|
|
17
|
-
);
|
|
18
|
-
if (parse.number !== void 0 && hasNumberedSibling) return true;
|
|
19
|
-
if (!parse.gated && parse.kind === "embedded" && hasExactSibling) return true;
|
|
20
|
-
if (!parse.gated && parse.kind === "volume" && hasNumberedSibling) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
if (parse.sideLetter) {
|
|
24
|
-
return siblingParses.some((p) => p.sideLetter);
|
|
25
|
-
}
|
|
26
|
-
if (parse.kind === "bonus" || parse.kind === "bare") {
|
|
27
|
-
const numberedCount = siblingParses.filter((p) => p.number !== void 0).length;
|
|
28
|
-
if (numberedCount >= 2) return true;
|
|
29
|
-
if (parse.number !== void 0 && hasNumberedSibling) return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
CONFIDENCE_RANK,
|
|
35
|
-
corroborated
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"album-discs.d.ts","sourceRoot":"","sources":["../../../src/folder-api/album-discs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAEhB,UAAU,EAEX,MAAM,kBAAkB,CAAC;AAE1B,uEAAuE;AACvE,wBAAgB,aAAa,CAC3B,MAAM,EAAE,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAC,GACrD,UAAU,EAAE,CAoKd"}
|