taglib-wasm 1.2.2 → 1.3.1
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/dist/index.browser.js +238 -91
- package/dist/simple.browser.js +238 -91
- package/dist/src/constants/complex-properties.d.ts +0 -14
- package/dist/src/constants/complex-properties.d.ts.map +1 -1
- package/dist/src/msgpack/encoder.d.ts +6 -0
- package/dist/src/msgpack/encoder.d.ts.map +1 -1
- package/dist/src/msgpack/encoder.js +12 -0
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts +3 -1
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
- package/dist/src/runtime/wasi-adapter/file-handle.js +17 -0
- package/dist/src/runtime/wasi-memory.d.ts +0 -5
- package/dist/src/runtime/wasi-memory.d.ts.map +1 -1
- package/dist/src/runtime/wasi-memory.js +1 -8
- package/dist/src/simple/tag-operations.d.ts.map +1 -1
- package/dist/src/simple/tag-operations.js +1 -0
- package/dist/src/taglib/audio-file-base.d.ts.map +1 -1
- package/dist/src/taglib/audio-file-base.js +21 -1
- package/dist/src/taglib/audio-file-impl.d.ts +3 -1
- package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
- package/dist/src/taglib/audio-file-impl.js +37 -39
- package/dist/src/taglib/audio-file-interface.d.ts +8 -1
- package/dist/src/taglib/audio-file-interface.d.ts.map +1 -1
- package/dist/src/taglib/embind-adapter.d.ts.map +1 -1
- package/dist/src/taglib/embind-adapter.js +18 -0
- package/dist/src/taglib/extra-state-registry.d.ts +26 -0
- package/dist/src/taglib/extra-state-registry.d.ts.map +1 -0
- package/dist/src/taglib/extra-state-registry.js +59 -0
- package/dist/src/taglib/mutable-tag.d.ts +7 -0
- package/dist/src/taglib/mutable-tag.d.ts.map +1 -1
- package/dist/src/taglib/save-reconstruct.d.ts +13 -0
- package/dist/src/taglib/save-reconstruct.d.ts.map +1 -0
- package/dist/src/taglib/save-reconstruct.js +39 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/wasm.d.ts +14 -0
- package/dist/src/wasm.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/simple.browser.js
CHANGED
|
@@ -561,60 +561,6 @@ var init_platform_io_browser_stub = __esm({
|
|
|
561
561
|
}
|
|
562
562
|
});
|
|
563
563
|
|
|
564
|
-
// src/utils/file.ts
|
|
565
|
-
async function readFileData(file) {
|
|
566
|
-
if (file instanceof Uint8Array) return file;
|
|
567
|
-
if (file instanceof ArrayBuffer) return new Uint8Array(file);
|
|
568
|
-
if (typeof File !== "undefined" && file instanceof File) {
|
|
569
|
-
return new Uint8Array(await file.arrayBuffer());
|
|
570
|
-
}
|
|
571
|
-
if (typeof file === "string") {
|
|
572
|
-
try {
|
|
573
|
-
return await getPlatformIO().readFile(file);
|
|
574
|
-
} catch (error) {
|
|
575
|
-
if (error instanceof EnvironmentError) throw error;
|
|
576
|
-
throw new FileOperationError("read", error.message, file);
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
const inputType = Object.prototype.toString.call(file);
|
|
580
|
-
throw new FileOperationError(
|
|
581
|
-
"read",
|
|
582
|
-
`Invalid file input type: ${inputType}. Expected string path, Uint8Array, ArrayBuffer, or File object.`
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
async function getFileSize(path) {
|
|
586
|
-
try {
|
|
587
|
-
const s = await getPlatformIO().stat(path);
|
|
588
|
-
return s.size;
|
|
589
|
-
} catch (error) {
|
|
590
|
-
if (error instanceof EnvironmentError) throw error;
|
|
591
|
-
throw new FileOperationError("stat", error.message, path);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
async function readPartialFileData(path, headerSize, footerSize) {
|
|
595
|
-
const io = getPlatformIO();
|
|
596
|
-
if (!io.readPartial) {
|
|
597
|
-
throw new EnvironmentError(
|
|
598
|
-
"current runtime",
|
|
599
|
-
"does not support partial file reading",
|
|
600
|
-
"filesystem access with seek support"
|
|
601
|
-
);
|
|
602
|
-
}
|
|
603
|
-
try {
|
|
604
|
-
return await io.readPartial(path, headerSize, footerSize);
|
|
605
|
-
} catch (error) {
|
|
606
|
-
if (error instanceof EnvironmentError) throw error;
|
|
607
|
-
throw new FileOperationError("read", error.message, path);
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
var init_file = __esm({
|
|
611
|
-
"src/utils/file.ts"() {
|
|
612
|
-
"use strict";
|
|
613
|
-
init_errors2();
|
|
614
|
-
init_platform_io_browser_stub();
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
|
|
618
564
|
// src/utils/write.ts
|
|
619
565
|
async function writeFileData(path, data) {
|
|
620
566
|
try {
|
|
@@ -1375,12 +1321,14 @@ var init_properties = __esm({
|
|
|
1375
1321
|
});
|
|
1376
1322
|
|
|
1377
1323
|
// src/taglib/audio-file-base.ts
|
|
1378
|
-
var BaseAudioFileImpl;
|
|
1324
|
+
var LYRICS_PROPERTY_KEY, LYRICS_WIRE_KEY, BaseAudioFileImpl;
|
|
1379
1325
|
var init_audio_file_base = __esm({
|
|
1380
1326
|
"src/taglib/audio-file-base.ts"() {
|
|
1381
1327
|
"use strict";
|
|
1382
1328
|
init_properties();
|
|
1383
1329
|
init_errors2();
|
|
1330
|
+
LYRICS_PROPERTY_KEY = "lyrics";
|
|
1331
|
+
LYRICS_WIRE_KEY = toTagLibKey(LYRICS_PROPERTY_KEY);
|
|
1384
1332
|
BaseAudioFileImpl = class {
|
|
1385
1333
|
constructor(module, fileHandle, sourcePath, originalSource, isPartiallyLoaded = false, partialLoadOptions) {
|
|
1386
1334
|
__publicField(this, "module", module);
|
|
@@ -1433,6 +1381,9 @@ var init_audio_file_base = __esm({
|
|
|
1433
1381
|
get track() {
|
|
1434
1382
|
return data.track;
|
|
1435
1383
|
},
|
|
1384
|
+
get date() {
|
|
1385
|
+
return handle.getProperty("DATE") || void 0;
|
|
1386
|
+
},
|
|
1436
1387
|
setTitle: (value) => {
|
|
1437
1388
|
handle.setTagData({ title: value });
|
|
1438
1389
|
data = handle.getTagData();
|
|
@@ -1467,6 +1418,15 @@ var init_audio_file_base = __esm({
|
|
|
1467
1418
|
handle.setTagData({ track: value });
|
|
1468
1419
|
data = handle.getTagData();
|
|
1469
1420
|
return tag;
|
|
1421
|
+
},
|
|
1422
|
+
setDate: (value) => {
|
|
1423
|
+
if (value === "") {
|
|
1424
|
+
handle.setTagData({ year: 0 });
|
|
1425
|
+
} else {
|
|
1426
|
+
handle.setProperty("DATE", value);
|
|
1427
|
+
}
|
|
1428
|
+
data = handle.getTagData();
|
|
1429
|
+
return tag;
|
|
1470
1430
|
}
|
|
1471
1431
|
};
|
|
1472
1432
|
return tag;
|
|
@@ -1478,13 +1438,19 @@ var init_audio_file_base = __esm({
|
|
|
1478
1438
|
return this.cachedAudioProperties ?? void 0;
|
|
1479
1439
|
}
|
|
1480
1440
|
properties() {
|
|
1481
|
-
|
|
1441
|
+
const remapped = remapKeysFromTagLib(this.handle.getProperties());
|
|
1442
|
+
delete remapped[LYRICS_PROPERTY_KEY];
|
|
1443
|
+
return remapped;
|
|
1482
1444
|
}
|
|
1483
1445
|
setProperties(properties) {
|
|
1484
1446
|
const translated = {};
|
|
1485
1447
|
for (const [key, values] of Object.entries(properties)) {
|
|
1486
1448
|
if (values !== void 0) translated[toTagLibKey(key)] = values;
|
|
1487
1449
|
}
|
|
1450
|
+
if (!(LYRICS_WIRE_KEY in translated)) {
|
|
1451
|
+
const existing = this.handle.getProperties()[LYRICS_WIRE_KEY];
|
|
1452
|
+
if (existing !== void 0) translated[LYRICS_WIRE_KEY] = existing;
|
|
1453
|
+
}
|
|
1488
1454
|
this.handle.setProperties(translated);
|
|
1489
1455
|
}
|
|
1490
1456
|
getProperty(key) {
|
|
@@ -1533,6 +1499,60 @@ var init_audio_file_base = __esm({
|
|
|
1533
1499
|
}
|
|
1534
1500
|
});
|
|
1535
1501
|
|
|
1502
|
+
// src/utils/file.ts
|
|
1503
|
+
async function readFileData(file) {
|
|
1504
|
+
if (file instanceof Uint8Array) return file;
|
|
1505
|
+
if (file instanceof ArrayBuffer) return new Uint8Array(file);
|
|
1506
|
+
if (typeof File !== "undefined" && file instanceof File) {
|
|
1507
|
+
return new Uint8Array(await file.arrayBuffer());
|
|
1508
|
+
}
|
|
1509
|
+
if (typeof file === "string") {
|
|
1510
|
+
try {
|
|
1511
|
+
return await getPlatformIO().readFile(file);
|
|
1512
|
+
} catch (error) {
|
|
1513
|
+
if (error instanceof EnvironmentError) throw error;
|
|
1514
|
+
throw new FileOperationError("read", error.message, file);
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
const inputType = Object.prototype.toString.call(file);
|
|
1518
|
+
throw new FileOperationError(
|
|
1519
|
+
"read",
|
|
1520
|
+
`Invalid file input type: ${inputType}. Expected string path, Uint8Array, ArrayBuffer, or File object.`
|
|
1521
|
+
);
|
|
1522
|
+
}
|
|
1523
|
+
async function getFileSize(path) {
|
|
1524
|
+
try {
|
|
1525
|
+
const s = await getPlatformIO().stat(path);
|
|
1526
|
+
return s.size;
|
|
1527
|
+
} catch (error) {
|
|
1528
|
+
if (error instanceof EnvironmentError) throw error;
|
|
1529
|
+
throw new FileOperationError("stat", error.message, path);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
async function readPartialFileData(path, headerSize, footerSize) {
|
|
1533
|
+
const io = getPlatformIO();
|
|
1534
|
+
if (!io.readPartial) {
|
|
1535
|
+
throw new EnvironmentError(
|
|
1536
|
+
"current runtime",
|
|
1537
|
+
"does not support partial file reading",
|
|
1538
|
+
"filesystem access with seek support"
|
|
1539
|
+
);
|
|
1540
|
+
}
|
|
1541
|
+
try {
|
|
1542
|
+
return await io.readPartial(path, headerSize, footerSize);
|
|
1543
|
+
} catch (error) {
|
|
1544
|
+
if (error instanceof EnvironmentError) throw error;
|
|
1545
|
+
throw new FileOperationError("read", error.message, path);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
var init_file = __esm({
|
|
1549
|
+
"src/utils/file.ts"() {
|
|
1550
|
+
"use strict";
|
|
1551
|
+
init_errors2();
|
|
1552
|
+
init_platform_io_browser_stub();
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
|
|
1536
1556
|
// src/taglib/embind-adapter.ts
|
|
1537
1557
|
function isValidBitrateMode(value) {
|
|
1538
1558
|
return value === "CBR" || value === "VBR" || value === "ABR";
|
|
@@ -1579,6 +1599,24 @@ function wrapEmbindHandle(raw) {
|
|
|
1579
1599
|
data ?? null
|
|
1580
1600
|
);
|
|
1581
1601
|
},
|
|
1602
|
+
// Emscripten exposes USLT only through the PropertyMap "LYRICS" key (no
|
|
1603
|
+
// dedicated Embind binding), so bridge get/setLyrics to get/setProperties.
|
|
1604
|
+
// Text only — language/description are not surfaced by the PropertyMap.
|
|
1605
|
+
getLyrics() {
|
|
1606
|
+
const props = raw.getProperties();
|
|
1607
|
+
return (props["LYRICS"] ?? []).map((text) => ({
|
|
1608
|
+
text,
|
|
1609
|
+
description: "",
|
|
1610
|
+
language: ""
|
|
1611
|
+
}));
|
|
1612
|
+
},
|
|
1613
|
+
setLyrics(lyrics) {
|
|
1614
|
+
const handle = raw;
|
|
1615
|
+
const props = handle.getProperties();
|
|
1616
|
+
if (lyrics.length > 0) props["LYRICS"] = lyrics.map((l) => l.text);
|
|
1617
|
+
else delete props["LYRICS"];
|
|
1618
|
+
handle.setProperties(props);
|
|
1619
|
+
},
|
|
1582
1620
|
hasId3Tags() {
|
|
1583
1621
|
const v = raw.hasId3Tags();
|
|
1584
1622
|
if (!v || typeof v !== "object") return { v1: false, v2: false };
|
|
@@ -1628,6 +1666,112 @@ var init_embind_adapter = __esm({
|
|
|
1628
1666
|
}
|
|
1629
1667
|
});
|
|
1630
1668
|
|
|
1669
|
+
// src/taglib/extra-state-registry.ts
|
|
1670
|
+
function chapterStyle(chapters) {
|
|
1671
|
+
const s = chapters[0]?.source;
|
|
1672
|
+
return s === "nero" || s === "both" ? s : "quicktime";
|
|
1673
|
+
}
|
|
1674
|
+
function copyExtraState(target, source, sourceComplete) {
|
|
1675
|
+
for (const field of EXTRA_FIELDS) {
|
|
1676
|
+
field.copy(target, source, sourceComplete);
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
var EXTRA_FIELDS;
|
|
1680
|
+
var init_extra_state_registry = __esm({
|
|
1681
|
+
"src/taglib/extra-state-registry.ts"() {
|
|
1682
|
+
"use strict";
|
|
1683
|
+
EXTRA_FIELDS = [
|
|
1684
|
+
{
|
|
1685
|
+
name: "pictures",
|
|
1686
|
+
copy(target, source, complete) {
|
|
1687
|
+
const v = source.getPictures();
|
|
1688
|
+
if (complete || v.length > 0) target.setPictures(v);
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
name: "ratings",
|
|
1693
|
+
copy(target, source, complete) {
|
|
1694
|
+
const v = source.getRatings();
|
|
1695
|
+
if (complete || v.length > 0) target.setRatings(v);
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
name: "lyrics",
|
|
1700
|
+
copy(target, source, complete) {
|
|
1701
|
+
const v = source.getLyrics();
|
|
1702
|
+
if (complete || v.length > 0) target.setLyrics(v);
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
{
|
|
1706
|
+
name: "chapters",
|
|
1707
|
+
copy(target, source, complete) {
|
|
1708
|
+
const v = source.getChapters();
|
|
1709
|
+
if (complete || v.length > 0) target.setChapters(v, chapterStyle(v));
|
|
1710
|
+
}
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
name: "bextData",
|
|
1714
|
+
copy(target, source, complete) {
|
|
1715
|
+
const v = source.getBextData();
|
|
1716
|
+
if (v !== void 0) target.setBextData(v);
|
|
1717
|
+
else if (complete) target.setBextData(null);
|
|
1718
|
+
}
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
name: "ixml",
|
|
1722
|
+
copy(target, source, complete) {
|
|
1723
|
+
const v = source.getIxml();
|
|
1724
|
+
if (v !== void 0) target.setIxml(v);
|
|
1725
|
+
else if (complete) target.setIxml(null);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
];
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
|
|
1732
|
+
// src/taglib/save-reconstruct.ts
|
|
1733
|
+
function copyEditedState(target, source, sourceComplete) {
|
|
1734
|
+
target.setTagData(source.getTagData());
|
|
1735
|
+
target.setProperties(
|
|
1736
|
+
sourceComplete ? source.getProperties() : { ...target.getProperties(), ...source.getProperties() }
|
|
1737
|
+
);
|
|
1738
|
+
copyExtraState(target, source, sourceComplete);
|
|
1739
|
+
}
|
|
1740
|
+
async function saveViaFreshHandle(module, editing, source, targetPath, sourceComplete) {
|
|
1741
|
+
const rawFullHandle = module.createFileHandle();
|
|
1742
|
+
const fullFileHandle = module.isWasi ? rawFullHandle : wrapEmbindHandle(rawFullHandle);
|
|
1743
|
+
try {
|
|
1744
|
+
{
|
|
1745
|
+
const data = await readFileData(source);
|
|
1746
|
+
if (!fullFileHandle.loadFromBuffer(data)) {
|
|
1747
|
+
throw new InvalidFormatError(
|
|
1748
|
+
"Failed to load full audio file for saving"
|
|
1749
|
+
);
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
copyEditedState(fullFileHandle, editing, sourceComplete);
|
|
1753
|
+
if (!fullFileHandle.save()) {
|
|
1754
|
+
throw new FileOperationError(
|
|
1755
|
+
"save",
|
|
1756
|
+
"Failed to save changes to full file"
|
|
1757
|
+
);
|
|
1758
|
+
}
|
|
1759
|
+
await writeFileData(targetPath, fullFileHandle.getBuffer());
|
|
1760
|
+
} finally {
|
|
1761
|
+
fullFileHandle.destroy();
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
var init_save_reconstruct = __esm({
|
|
1765
|
+
"src/taglib/save-reconstruct.ts"() {
|
|
1766
|
+
"use strict";
|
|
1767
|
+
init_errors2();
|
|
1768
|
+
init_file();
|
|
1769
|
+
init_write();
|
|
1770
|
+
init_embind_adapter();
|
|
1771
|
+
init_extra_state_registry();
|
|
1772
|
+
}
|
|
1773
|
+
});
|
|
1774
|
+
|
|
1631
1775
|
// src/taglib/audio-file-impl.ts
|
|
1632
1776
|
function sortChapters(list) {
|
|
1633
1777
|
return [...list].sort((a, b) => a.startTimeMs - b.startTimeMs);
|
|
@@ -1657,10 +1801,9 @@ var init_audio_file_impl = __esm({
|
|
|
1657
1801
|
init_types2();
|
|
1658
1802
|
init_audio_file_bwf();
|
|
1659
1803
|
init_errors2();
|
|
1660
|
-
init_file();
|
|
1661
1804
|
init_write();
|
|
1662
1805
|
init_audio_file_base();
|
|
1663
|
-
|
|
1806
|
+
init_save_reconstruct();
|
|
1664
1807
|
AudioFileImpl = class extends BaseAudioFileImpl {
|
|
1665
1808
|
constructor(module, fileHandle, sourcePath, originalSource, isPartiallyLoaded = false, partialLoadOptions) {
|
|
1666
1809
|
super(
|
|
@@ -1706,38 +1849,23 @@ var init_audio_file_impl = __esm({
|
|
|
1706
1849
|
);
|
|
1707
1850
|
}
|
|
1708
1851
|
if (this.isPartiallyLoaded && this.originalSource) {
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
if (!success) {
|
|
1717
|
-
throw new InvalidFormatError(
|
|
1718
|
-
"Failed to load full audio file for saving"
|
|
1719
|
-
);
|
|
1720
|
-
}
|
|
1721
|
-
fullFileHandle.setTagData(this.handle.getTagData());
|
|
1722
|
-
fullFileHandle.setProperties(this.handle.getProperties());
|
|
1723
|
-
fullFileHandle.setPictures(this.handle.getPictures());
|
|
1724
|
-
const bextBytes = this.handle.getBextData();
|
|
1725
|
-
if (bextBytes !== void 0) fullFileHandle.setBextData(bextBytes);
|
|
1726
|
-
const ixmlStr = this.handle.getIxml();
|
|
1727
|
-
if (ixmlStr !== void 0) fullFileHandle.setIxml(ixmlStr);
|
|
1728
|
-
if (!fullFileHandle.save()) {
|
|
1729
|
-
throw new FileOperationError(
|
|
1730
|
-
"save",
|
|
1731
|
-
"Failed to save changes to full file"
|
|
1732
|
-
);
|
|
1733
|
-
}
|
|
1734
|
-
const buffer = fullFileHandle.getBuffer();
|
|
1735
|
-
await writeFileData(targetPath, buffer);
|
|
1736
|
-
} finally {
|
|
1737
|
-
fullFileHandle.destroy();
|
|
1738
|
-
}
|
|
1852
|
+
await saveViaFreshHandle(
|
|
1853
|
+
this.module,
|
|
1854
|
+
this.handle,
|
|
1855
|
+
this.originalSource,
|
|
1856
|
+
targetPath,
|
|
1857
|
+
false
|
|
1858
|
+
);
|
|
1739
1859
|
this.isPartiallyLoaded = false;
|
|
1740
1860
|
this.originalSource = void 0;
|
|
1861
|
+
} else if (this.module.isWasi && this.sourcePath && targetPath !== this.sourcePath) {
|
|
1862
|
+
await saveViaFreshHandle(
|
|
1863
|
+
this.module,
|
|
1864
|
+
this.handle,
|
|
1865
|
+
this.sourcePath,
|
|
1866
|
+
targetPath,
|
|
1867
|
+
true
|
|
1868
|
+
);
|
|
1741
1869
|
} else {
|
|
1742
1870
|
if (!this.save()) {
|
|
1743
1871
|
throw new FileOperationError(
|
|
@@ -1799,13 +1927,16 @@ var init_audio_file_impl = __esm({
|
|
|
1799
1927
|
}
|
|
1800
1928
|
const sorted = sortChapters(chapters);
|
|
1801
1929
|
const trackEndMs = this.audioProperties()?.durationMs;
|
|
1930
|
+
const style = options?.mp4ChapterStyle ?? "quicktime";
|
|
1931
|
+
const source = fmt === "MP4" ? style : "id3";
|
|
1802
1932
|
const raw = sorted.map((c, i) => ({
|
|
1803
1933
|
id: c.id,
|
|
1804
1934
|
startTimeMs: c.startTimeMs,
|
|
1805
1935
|
endTimeMs: inferEndTimeMs(sorted, i, trackEndMs) ?? c.startTimeMs,
|
|
1806
|
-
title: c.title
|
|
1936
|
+
title: c.title,
|
|
1937
|
+
source
|
|
1807
1938
|
}));
|
|
1808
|
-
this.handle.setChapters(raw,
|
|
1939
|
+
this.handle.setChapters(raw, style);
|
|
1809
1940
|
}
|
|
1810
1941
|
getBext() {
|
|
1811
1942
|
return getBext(this.handle);
|
|
@@ -1841,6 +1972,21 @@ var init_audio_file_impl = __esm({
|
|
|
1841
1972
|
counter: r.counter ?? 0
|
|
1842
1973
|
})));
|
|
1843
1974
|
}
|
|
1975
|
+
getLyrics() {
|
|
1976
|
+
return this.handle.getLyrics().map((l) => {
|
|
1977
|
+
const out = { text: l.text };
|
|
1978
|
+
if (l.description) out.description = l.description;
|
|
1979
|
+
if (l.language) out.language = l.language;
|
|
1980
|
+
return out;
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
setLyrics(lyrics) {
|
|
1984
|
+
this.handle.setLyrics(lyrics.map((l) => ({
|
|
1985
|
+
text: l.text,
|
|
1986
|
+
description: l.description ?? "",
|
|
1987
|
+
language: l.language ?? ""
|
|
1988
|
+
})));
|
|
1989
|
+
}
|
|
1844
1990
|
getRating() {
|
|
1845
1991
|
const ratings = this.getRatings();
|
|
1846
1992
|
return ratings.length > 0 ? ratings[0].rating : void 0;
|
|
@@ -2014,7 +2160,7 @@ var VERSION;
|
|
|
2014
2160
|
var init_version = __esm({
|
|
2015
2161
|
"src/version.ts"() {
|
|
2016
2162
|
"use strict";
|
|
2017
|
-
VERSION = "1.
|
|
2163
|
+
VERSION = "1.3.1";
|
|
2018
2164
|
}
|
|
2019
2165
|
});
|
|
2020
2166
|
|
|
@@ -2426,6 +2572,7 @@ async function clearTags(file) {
|
|
|
2426
2572
|
return withAudioFileSave(file, (audioFile) => {
|
|
2427
2573
|
audioFile.setProperties({});
|
|
2428
2574
|
audioFile.removePictures();
|
|
2575
|
+
audioFile.setLyrics([]);
|
|
2429
2576
|
});
|
|
2430
2577
|
}
|
|
2431
2578
|
|
|
@@ -87,20 +87,6 @@ export interface ComplexPropertyValueMap {
|
|
|
87
87
|
* Union type of all valid complex property keys.
|
|
88
88
|
*/
|
|
89
89
|
export type ComplexPropertyKey = keyof ComplexPropertyValueMap;
|
|
90
|
-
/**
|
|
91
|
-
* Complex property metadata interface.
|
|
92
|
-
*/
|
|
93
|
-
export interface ComplexPropertyMetadata {
|
|
94
|
-
key: string;
|
|
95
|
-
description: string;
|
|
96
|
-
type: "binary" | "object";
|
|
97
|
-
supportedFormats: readonly string[];
|
|
98
|
-
mappings: Record<string, string | {
|
|
99
|
-
frame?: string;
|
|
100
|
-
atom?: string;
|
|
101
|
-
description?: string;
|
|
102
|
-
}>;
|
|
103
|
-
}
|
|
104
90
|
/**
|
|
105
91
|
* Rich metadata object for complex properties.
|
|
106
92
|
* Contains descriptions, format support info, and underlying format mappings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"complex-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/complex-properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACrB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,uBAAuB;IACtC,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,uBAAuB,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"complex-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/complex-properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACrB,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,uBAAuB;IACtC,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,MAAM,EAAE,cAAc,CAAC;IACvB,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,uBAAuB,CAAC;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4CrB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,CAAC,IAAI,kBAAkB,GAAG,CAAC;CACtC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,EAAE,qBAKzB,CAAC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/** MessagePack encoder — converts JS objects to binary MessagePack for the C API. */
|
|
2
2
|
import { type EncoderOptions } from "@msgpack/msgpack";
|
|
3
3
|
import type { AudioProperties, ExtendedTag, Picture, PropertyMap } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Structured (non-text-property) keys carried verbatim through the msgpack
|
|
6
|
+
* boundary. The reconstruct registry (`extra-state-registry.ts`) must cover the
|
|
7
|
+
* data fields here; `extra-state-registry.test.ts` enforces that cross-check.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PASSTHROUGH_KEYS: Set<string>;
|
|
4
10
|
export declare function encodeTagData(tagData: ExtendedTag): Uint8Array;
|
|
5
11
|
export declare function encodeAudioProperties(audioProps: AudioProperties): Uint8Array;
|
|
6
12
|
export declare function encodePropertyMap(propertyMap: PropertyMap): Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../../src/msgpack/encoder.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,OAAO,EACP,WAAW,EACZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../../src/msgpack/encoder.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAA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EAAE,OAAO,GAAG;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAaA"}
|
|
@@ -20,6 +20,12 @@ const MSGPACK_ENCODE_OPTIONS = {
|
|
|
20
20
|
maxDepth: 32,
|
|
21
21
|
extensionCodec: void 0
|
|
22
22
|
};
|
|
23
|
+
function lyricsTexts(value) {
|
|
24
|
+
const entries = Array.isArray(value) ? value : [value];
|
|
25
|
+
return entries.map(
|
|
26
|
+
(entry) => typeof entry === "string" ? entry : String(entry?.text ?? "")
|
|
27
|
+
).filter((text) => text !== "");
|
|
28
|
+
}
|
|
23
29
|
function encodeTagData(tagData) {
|
|
24
30
|
try {
|
|
25
31
|
const dateVal = tagData.date;
|
|
@@ -27,6 +33,11 @@ function encodeTagData(tagData) {
|
|
|
27
33
|
const remapped = {};
|
|
28
34
|
for (const [key, value] of Object.entries(tagData)) {
|
|
29
35
|
if (key === "year" && hasDate) continue;
|
|
36
|
+
if (key === "lyrics") {
|
|
37
|
+
const texts = lyricsTexts(value);
|
|
38
|
+
if (texts.length > 0) remapped["LYRICS"] = texts;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
30
41
|
if (PASSTHROUGH_KEYS.has(key)) {
|
|
31
42
|
remapped[key] = value;
|
|
32
43
|
} else {
|
|
@@ -215,6 +226,7 @@ function compareEncodingEfficiency(data) {
|
|
|
215
226
|
};
|
|
216
227
|
}
|
|
217
228
|
export {
|
|
229
|
+
PASSTHROUGH_KEYS,
|
|
218
230
|
canEncodeToMessagePack,
|
|
219
231
|
compareEncodingEfficiency,
|
|
220
232
|
encodeAudioProperties,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview WASI-based FileHandle implementation
|
|
3
3
|
*/
|
|
4
|
-
import type { FileHandle, RawChapter, RawPicture } from "../../wasm.js";
|
|
4
|
+
import type { FileHandle, RawChapter, RawLyrics, RawPicture } from "../../wasm.js";
|
|
5
5
|
import type { BasicTagData } from "../../types/tags.js";
|
|
6
6
|
import type { AudioProperties } from "../../types.js";
|
|
7
7
|
import type { WasiModule } from "../wasmer-sdk-loader/types.js";
|
|
@@ -59,6 +59,8 @@ export declare class WasiFileHandle implements FileHandle {
|
|
|
59
59
|
email?: string;
|
|
60
60
|
counter?: number;
|
|
61
61
|
}[]): void;
|
|
62
|
+
getLyrics(): RawLyrics[];
|
|
63
|
+
setLyrics(lyrics: RawLyrics[]): void;
|
|
62
64
|
destroy(): void;
|
|
63
65
|
}
|
|
64
66
|
//# sourceMappingURL=file-handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-handle.d.ts","sourceRoot":"","sources":["../../../../src/runtime/wasi-adapter/file-handle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"file-handle.d.ts","sourceRoot":"","sources":["../../../../src/runtime/wasi-adapter/file-handle.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAkEhE,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,SAAS,CAAS;gBAEd,UAAU,EAAE,UAAU;IAIlC,OAAO,CAAC,iBAAiB;IAQzB,cAAc,CAAC,MAAM,E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AAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKlC,UAAU,IAAI;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,OAAO,CAAA;KAAE;IAQ1C,YAAY,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IA+BtD,UAAU,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE;IAOlE,UAAU,CACR,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,GAC9D,IAAI;IAaP,SAAS,IAAI,SAAS,EAAE;IAoBxB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI;IAKpC,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -371,6 +371,23 @@ class WasiFileHandle {
|
|
|
371
371
|
ratings: normalizedRatings
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
|
+
getLyrics() {
|
|
375
|
+
this.checkNotDestroyed();
|
|
376
|
+
const value = this.tagData?.lyrics;
|
|
377
|
+
if (value === void 0 || value === null) return [];
|
|
378
|
+
const entries = Array.isArray(value) ? value : [value];
|
|
379
|
+
return entries.map(
|
|
380
|
+
(entry) => typeof entry === "string" ? { text: entry, description: "", language: "" } : {
|
|
381
|
+
text: entry?.text ?? "",
|
|
382
|
+
description: entry?.description ?? "",
|
|
383
|
+
language: entry?.language ?? ""
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
setLyrics(lyrics) {
|
|
388
|
+
this.checkNotDestroyed();
|
|
389
|
+
this.tagData = { ...this.tagData, lyrics };
|
|
390
|
+
}
|
|
374
391
|
destroy() {
|
|
375
392
|
this.fileData = null;
|
|
376
393
|
this.tagData = null;
|
|
@@ -106,9 +106,4 @@ export declare class WasmMemoryError extends TagLibError {
|
|
|
106
106
|
readonly errorCode?: number | undefined;
|
|
107
107
|
constructor(message: string, operation: string, errorCode?: number | undefined);
|
|
108
108
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Refresh heap views after potential memory growth
|
|
111
|
-
* Call this if you suspect the WASM module grew its memory
|
|
112
|
-
*/
|
|
113
|
-
export declare function refreshHeapViews(wasm: WasmExports, currentViews: ReturnType<typeof heapViews>): ReturnType<typeof heapViews>;
|
|
114
109
|
//# sourceMappingURL=wasi-memory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasi-memory.d.ts","sourceRoot":"","sources":["../../../src/runtime/wasi-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,cAAc;;;;;;;CAO3C,CAAC;AAEH;;;GAGG;AACH,qBAAa,SAAS;;gBAKR,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAW3C,IAAI,GAAG,IAAI,MAAM,CAEhB;IACD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,IAAI;IAU1C;;OAEG;IACH,IAAI,CAAC,GAAG,SAAa,EAAE,MAAM,SAAI,GAAG,UAAU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EAAE,MAAM;gBAFlC,OAAO,EAAE,MAAM,EACC,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,MAAM,YAAA;CAWrC"}
|
|
@@ -189,16 +189,9 @@ class WasmMemoryError extends TagLibError {
|
|
|
189
189
|
Object.setPrototypeOf(this, WasmMemoryError.prototype);
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
function refreshHeapViews(wasm, currentViews) {
|
|
193
|
-
if (currentViews.u8.buffer !== wasm.memory.buffer) {
|
|
194
|
-
return heapViews(wasm.memory);
|
|
195
|
-
}
|
|
196
|
-
return currentViews;
|
|
197
|
-
}
|
|
198
192
|
export {
|
|
199
193
|
WasmAlloc,
|
|
200
194
|
WasmArena,
|
|
201
195
|
WasmMemoryError,
|
|
202
|
-
heapViews
|
|
203
|
-
refreshHeapViews
|
|
196
|
+
heapViews
|
|
204
197
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-operations.d.ts","sourceRoot":"","sources":["../../../src/simple/tag-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EACR,QAAQ,EACT,MAAM,aAAa,CAAC;AAcrB;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,WAAW,CAAC,CAKtB;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAY1B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAW/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"tag-operations.d.ts","sourceRoot":"","sources":["../../../src/simple/tag-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EACR,QAAQ,EACT,MAAM,aAAa,CAAC;AAcrB;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,WAAW,CAAC,CAKtB;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAY1B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAW/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,CAAC,CAWrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-file-base.d.ts","sourceRoot":"","sources":["../../../src/taglib/audio-file-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"audio-file-base.d.ts","sourceRoot":"","sources":["../../../src/taglib/audio-file-base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAYhE;;;;;GAKG;AACH,8BAAsB,iBAAiB;IASnC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY;IARzC,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACxC,SAAS,CAAC,qBAAqB,EAAE,eAAe,GAAG,IAAI,CAAQ;IAC/D,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IACvC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,IAAI,CAAC;IACpE,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAS;IAC7C,SAAS,CAAC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