taglib-wasm 1.7.2 → 1.8.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 +106 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/simple.browser.js +106 -5
- package/dist/src/constants/properties.d.ts +56 -0
- package/dist/src/constants/properties.d.ts.map +1 -1
- package/dist/src/constants/properties.js +22 -0
- package/dist/src/constants/specialized-properties.d.ts +56 -0
- package/dist/src/constants/specialized-properties.d.ts.map +1 -1
- package/dist/src/constants/specialized-properties.js +51 -0
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
- package/dist/src/runtime/wasi-adapter/file-handle.js +3 -1
- package/dist/src/taglib/audio-file-base.d.ts.map +1 -1
- package/dist/src/taglib/audio-file-base.js +6 -3
- package/dist/src/types/metadata-mappings.d.ts +1 -1
- package/dist/src/types/metadata-mappings.d.ts.map +1 -1
- package/dist/src/types/metadata-mappings.js +20 -0
- package/dist/src/types/tags.d.ts +25 -0
- package/dist/src/types/tags.d.ts.map +1 -1
- package/dist/src/utils/tag-mapping.d.ts.map +1 -1
- package/dist/src/utils/tag-mapping.js +26 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/taglib-wasi.wasm +0 -0
- package/dist/taglib-web.wasm +0 -0
- package/package.json +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -1364,6 +1364,35 @@ var init_specialized_properties = __esm({
|
|
|
1364
1364
|
mp4: "----:com.apple.iTunes:MusicBrainz Release Group Id"
|
|
1365
1365
|
}
|
|
1366
1366
|
},
|
|
1367
|
+
releaseType: {
|
|
1368
|
+
key: "RELEASETYPE",
|
|
1369
|
+
description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE",
|
|
1370
|
+
type: "string",
|
|
1371
|
+
supportedFormats: [
|
|
1372
|
+
"ID3v2",
|
|
1373
|
+
"MP4",
|
|
1374
|
+
"Vorbis",
|
|
1375
|
+
"APE",
|
|
1376
|
+
"ASF",
|
|
1377
|
+
"Matroska"
|
|
1378
|
+
],
|
|
1379
|
+
mappings: {
|
|
1380
|
+
id3v2: { frame: "TXXX", description: "MusicBrainz Album Type" },
|
|
1381
|
+
vorbis: "RELEASETYPE",
|
|
1382
|
+
mp4: "----:com.apple.iTunes:MusicBrainz Album Type"
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
itunesAdvisory: {
|
|
1386
|
+
key: "ITUNESADVISORY",
|
|
1387
|
+
description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here",
|
|
1388
|
+
type: "string",
|
|
1389
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "APE", "ASF"],
|
|
1390
|
+
mappings: {
|
|
1391
|
+
id3v2: { frame: "TXXX", description: "ITUNESADVISORY" },
|
|
1392
|
+
vorbis: "ITUNESADVISORY",
|
|
1393
|
+
mp4: "----:com.apple.iTunes:ITUNESADVISORY"
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1367
1396
|
// ReplayGain Properties
|
|
1368
1397
|
replayGainTrackGain: {
|
|
1369
1398
|
key: "REPLAYGAIN_TRACK_GAIN",
|
|
@@ -1409,6 +1438,28 @@ var init_specialized_properties = __esm({
|
|
|
1409
1438
|
mp4: "----:com.apple.iTunes:replaygain_album_peak"
|
|
1410
1439
|
}
|
|
1411
1440
|
},
|
|
1441
|
+
r128TrackGain: {
|
|
1442
|
+
key: "R128_TRACK_GAIN",
|
|
1443
|
+
description: "EBU R128 track loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256, e.g. '-573' = -2.23828125 dB). readTags() converts to a decibel number (see ExtendedTag.r128TrackGain)",
|
|
1444
|
+
type: "string",
|
|
1445
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "ASF"],
|
|
1446
|
+
mappings: {
|
|
1447
|
+
id3v2: { frame: "TXXX", description: "R128_TRACK_GAIN" },
|
|
1448
|
+
vorbis: "R128_TRACK_GAIN",
|
|
1449
|
+
mp4: "----:com.apple.iTunes:R128_TRACK_GAIN"
|
|
1450
|
+
}
|
|
1451
|
+
},
|
|
1452
|
+
r128AlbumGain: {
|
|
1453
|
+
key: "R128_ALBUM_GAIN",
|
|
1454
|
+
description: "EBU R128 album loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256). readTags() converts to a decibel number",
|
|
1455
|
+
type: "string",
|
|
1456
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "ASF"],
|
|
1457
|
+
mappings: {
|
|
1458
|
+
id3v2: { frame: "TXXX", description: "R128_ALBUM_GAIN" },
|
|
1459
|
+
vorbis: "R128_ALBUM_GAIN",
|
|
1460
|
+
mp4: "----:com.apple.iTunes:R128_ALBUM_GAIN"
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1412
1463
|
// AcoustID Properties
|
|
1413
1464
|
acoustidFingerprint: {
|
|
1414
1465
|
key: "ACOUSTID_FINGERPRINT",
|
|
@@ -1489,11 +1540,13 @@ function fromTagLibKey(key) {
|
|
|
1489
1540
|
function remapKeysFromTagLib(obj) {
|
|
1490
1541
|
const result = {};
|
|
1491
1542
|
for (const [key, value] of Object.entries(obj)) {
|
|
1543
|
+
const canonical = READ_ALIASES[key];
|
|
1544
|
+
if (canonical !== void 0 && canonical in obj) continue;
|
|
1492
1545
|
result[fromTagLibKey(key)] = value;
|
|
1493
1546
|
}
|
|
1494
1547
|
return result;
|
|
1495
1548
|
}
|
|
1496
|
-
var PROPERTIES, _toTagLib, _fromTagLib, _mp4FreeformAtoms, _mp4AtomToWireKey;
|
|
1549
|
+
var PROPERTIES, _toTagLib, _fromTagLib, READ_ALIASES, _mp4FreeformAtoms, _mp4AtomToWireKey;
|
|
1497
1550
|
var init_properties = __esm({
|
|
1498
1551
|
"src/constants/properties.ts"() {
|
|
1499
1552
|
"use strict";
|
|
@@ -1517,6 +1570,26 @@ var init_properties = __esm({
|
|
|
1517
1570
|
_toTagLib["year"] = "DATE";
|
|
1518
1571
|
_toTagLib["track"] = "TRACKNUMBER";
|
|
1519
1572
|
_fromTagLib["disc"] = "discNumber";
|
|
1573
|
+
READ_ALIASES = {
|
|
1574
|
+
"ALBUM ARTIST": "ALBUMARTIST",
|
|
1575
|
+
ALBUM_ARTIST: "ALBUMARTIST",
|
|
1576
|
+
ORGANIZATION: "LABEL",
|
|
1577
|
+
PUBLISHER: "LABEL",
|
|
1578
|
+
UPC: "BARCODE",
|
|
1579
|
+
EAN: "BARCODE",
|
|
1580
|
+
GTIN: "BARCODE",
|
|
1581
|
+
TOTALTRACKS: "TRACKTOTAL",
|
|
1582
|
+
TOTALDISCS: "DISCTOTAL",
|
|
1583
|
+
MUSICBRAINZ_ALBUMTYPE: "RELEASETYPE",
|
|
1584
|
+
"MusicBrainz Album Type": "RELEASETYPE",
|
|
1585
|
+
CONTENTADVISORY: "ITUNESADVISORY",
|
|
1586
|
+
EXPLICIT: "ITUNESADVISORY"
|
|
1587
|
+
};
|
|
1588
|
+
for (const [alias, canonical] of Object.entries(READ_ALIASES)) {
|
|
1589
|
+
if (_fromTagLib[alias] === void 0) {
|
|
1590
|
+
_fromTagLib[alias] = _fromTagLib[canonical];
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1520
1593
|
_mp4FreeformAtoms = {};
|
|
1521
1594
|
for (const meta of Object.values(PROPERTIES)) {
|
|
1522
1595
|
const { key, mappings } = meta;
|
|
@@ -1718,7 +1791,9 @@ var init_audio_file_base = __esm({
|
|
|
1718
1791
|
setProperties(properties) {
|
|
1719
1792
|
const translated = {};
|
|
1720
1793
|
for (const [key, values] of Object.entries(properties)) {
|
|
1721
|
-
if (values !== void 0)
|
|
1794
|
+
if (values !== void 0) {
|
|
1795
|
+
translated[toTagLibKey(fromTagLibKey(key))] = values;
|
|
1796
|
+
}
|
|
1722
1797
|
}
|
|
1723
1798
|
if (!(LYRICS_WIRE_KEY in translated)) {
|
|
1724
1799
|
const existing = this.handle.getProperties()[LYRICS_WIRE_KEY];
|
|
@@ -1729,14 +1804,14 @@ var init_audio_file_base = __esm({
|
|
|
1729
1804
|
this.handle.setProperties(translated);
|
|
1730
1805
|
}
|
|
1731
1806
|
getProperty(key) {
|
|
1732
|
-
const value = this.handle.getProperty(toTagLibKey(key));
|
|
1807
|
+
const value = this.handle.getProperty(toTagLibKey(fromTagLibKey(key)));
|
|
1733
1808
|
if (value !== "") return value;
|
|
1734
1809
|
if (!this.isMP4()) return void 0;
|
|
1735
1810
|
const remapped = this.properties()[key]?.[0];
|
|
1736
1811
|
return remapped === "" ? void 0 : remapped;
|
|
1737
1812
|
}
|
|
1738
1813
|
setProperty(key, value) {
|
|
1739
|
-
const wireKey = toTagLibKey(key);
|
|
1814
|
+
const wireKey = toTagLibKey(fromTagLibKey(key));
|
|
1740
1815
|
const atomNames = mp4FreeformAtomNames([wireKey]);
|
|
1741
1816
|
if (atomNames.length > 0 && this.isMP4()) {
|
|
1742
1817
|
this.handle.setProperties({
|
|
@@ -2602,8 +2677,17 @@ function mapPropertiesToExtendedTag(props) {
|
|
|
2602
2677
|
const total = parseLeadingInt(raw.slice(slash + 1));
|
|
2603
2678
|
if (total !== void 0) tag[totalField] = total;
|
|
2604
2679
|
}
|
|
2680
|
+
if (tag.date === void 0) {
|
|
2681
|
+
const yearValues = props["YEAR"];
|
|
2682
|
+
if (yearValues !== void 0 && yearValues.length > 0) {
|
|
2683
|
+
const y = parseLeadingInt(yearValues[0]);
|
|
2684
|
+
if (y !== void 0) tag.year = y;
|
|
2685
|
+
tag.date = yearValues.length === 1 ? yearValues[0] : yearValues;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2605
2688
|
for (const [key, values] of Object.entries(props)) {
|
|
2606
2689
|
if (BASIC_PROPERTY_KEYS[key]) continue;
|
|
2690
|
+
if (key === "YEAR") continue;
|
|
2607
2691
|
if (!values || values.length === 0) continue;
|
|
2608
2692
|
const camelKey = fromTagLibKey(key);
|
|
2609
2693
|
if (NUMERIC_FIELDS.has(camelKey)) {
|
|
@@ -2611,6 +2695,14 @@ function mapPropertiesToExtendedTag(props) {
|
|
|
2611
2695
|
if (num !== void 0) tag[camelKey] = num;
|
|
2612
2696
|
} else if (camelKey === "compilation") {
|
|
2613
2697
|
tag[camelKey] = values[0] === "1";
|
|
2698
|
+
} else if (camelKey === "itunesAdvisory") {
|
|
2699
|
+
tag[camelKey] = values;
|
|
2700
|
+
if (values[0] === "1") tag.advisory = "explicit";
|
|
2701
|
+
else if (values[0] === "2") tag.advisory = "clean";
|
|
2702
|
+
else if (values[0] === "0") tag.advisory = "unspecified";
|
|
2703
|
+
} else if (camelKey === "r128TrackGain" || camelKey === "r128AlbumGain") {
|
|
2704
|
+
const raw = parseLeadingInt(values[0]);
|
|
2705
|
+
if (raw !== void 0) tag[camelKey] = raw / 256;
|
|
2614
2706
|
} else {
|
|
2615
2707
|
tag[camelKey] = values;
|
|
2616
2708
|
}
|
|
@@ -2621,6 +2713,9 @@ function mergeTagUpdates(file, tags) {
|
|
|
2621
2713
|
const currentProps = file.properties();
|
|
2622
2714
|
const newProps = normalizeTagInput(tags);
|
|
2623
2715
|
reconcilePairFields(currentProps, newProps, tags);
|
|
2716
|
+
if (newProps.date !== void 0 || newProps.year !== void 0) {
|
|
2717
|
+
currentProps.YEAR = [];
|
|
2718
|
+
}
|
|
2624
2719
|
file.setProperties({ ...currentProps, ...newProps });
|
|
2625
2720
|
}
|
|
2626
2721
|
function reconcilePairFields(currentProps, newProps, input) {
|
|
@@ -2672,8 +2767,14 @@ function normalizeTagInput(input) {
|
|
|
2672
2767
|
if (BASIC_FIELDS.has(field) || val === void 0) continue;
|
|
2673
2768
|
if (field === "compilation") {
|
|
2674
2769
|
props[field] = [val ? "1" : "0"];
|
|
2770
|
+
} else if (field === "advisory") {
|
|
2771
|
+
if (val === "explicit") props.itunesAdvisory = ["1"];
|
|
2772
|
+
else if (val === "clean") props.itunesAdvisory = ["2"];
|
|
2773
|
+
else if (val === "unspecified") props.itunesAdvisory = [];
|
|
2675
2774
|
} else if (NUMERIC_FIELDS.has(field)) {
|
|
2676
2775
|
props[field] = [String(val)];
|
|
2776
|
+
} else if (field === "r128TrackGain" || field === "r128AlbumGain") {
|
|
2777
|
+
props[field] = Array.isArray(val) ? val : [String(Math.round(val * 256))];
|
|
2677
2778
|
} else if (typeof val === "string") {
|
|
2678
2779
|
props[field] = [val];
|
|
2679
2780
|
} else if (Array.isArray(val)) {
|
|
@@ -2730,7 +2831,7 @@ var VERSION;
|
|
|
2730
2831
|
var init_version = __esm({
|
|
2731
2832
|
"src/version.ts"() {
|
|
2732
2833
|
"use strict";
|
|
2733
|
-
VERSION = "1.
|
|
2834
|
+
VERSION = "1.8.1";
|
|
2734
2835
|
}
|
|
2735
2836
|
});
|
|
2736
2837
|
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export { addPicture, applyCoverArt, applyPictures, applyTags, applyTagsToFile, t
|
|
|
43
43
|
export { FormatMappings, getAllProperties, getAllPropertyKeys, getAllTagNames, getPropertiesByFormat, getPropertyMetadata, isValidProperty, isValidTagName, PROPERTIES, Tags, } from "./src/constants.js";
|
|
44
44
|
export type { PropertyMetadata } from "./src/constants/property-types.js";
|
|
45
45
|
export { copyCoverArt, exportAllPictures, exportCoverArt, exportPictureByType, findCoverArtFiles, importCoverArt, importPictureWithType, loadPictureFromFile, savePictureToFile, } from "./src/file-utils/index.js";
|
|
46
|
-
export { type AudioDynamics, type AudioFileMetadata, type DuplicateGroup, exportFolderMetadata, findDuplicates, type FolderScanItem, type FolderScanOptions, type FolderScanResult, type FolderUpdateItem, type FolderUpdateResult, scanFolder, updateFolderTags, } from "./src/folder-api/index.js";
|
|
46
|
+
export { type AlbumDisc, type AlbumGroup, type AlbumGroupingResult, type AlbumGroupItem, type AlbumGroupKey, type AudioDynamics, type AudioFileMetadata, type DiscConfidence, type DiscFolderInfo, discFolderInfo, type DuplicateGroup, exportFolderMetadata, findDuplicates, type FolderScanItem, type FolderScanOptions, type FolderScanResult, type FolderUpdateItem, type FolderUpdateResult, groupAlbums, type GroupAlbumsOptions, scanFolder, scanForAlbums, type ScanForAlbumsOptions, updateFolderTags, } from "./src/folder-api/index.js";
|
|
47
47
|
export { canvasToPicture, createPictureDownloadURL, createPictureGallery, dataURLToPicture, displayPicture, imageFileToPicture, pictureToDataURL, setCoverArtFromCanvas, } from "./src/web-utils/index.js";
|
|
48
48
|
export type { AudioCodec, AudioFileInput, AudioProperties, BitrateControlMode, BroadcastAudioExtension, Chapter, ContainerFormat, ExtendedTag, FieldMapping, FileType, NamedAudioInput, OpenOptions, Picture, PictureType, PropertyMap, SetChaptersOptions, Tag, TagInput, TagName, } from "./src/types.js";
|
|
49
49
|
export { BITRATE_CONTROL_MODE_NAMES, BITRATE_CONTROL_MODE_VALUES, PICTURE_TYPE_NAMES, PICTURE_TYPE_VALUES, } from "./src/types.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,YAAY,EACV,SAAS,EACT,cAAc,GACf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8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B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrE,YAAY,EACV,iBAAiB,EACjB,SAAS,GACV,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,UAAU,EACV,MAAM,EACN,cAAc,EACd,UAAU,GACX,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG1E,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AAGzC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -71,9 +71,12 @@ import {
|
|
|
71
71
|
savePictureToFile
|
|
72
72
|
} from "./src/file-utils/index.js";
|
|
73
73
|
import {
|
|
74
|
+
discFolderInfo,
|
|
74
75
|
exportFolderMetadata,
|
|
75
76
|
findDuplicates,
|
|
77
|
+
groupAlbums,
|
|
76
78
|
scanFolder,
|
|
79
|
+
scanForAlbums,
|
|
77
80
|
updateFolderTags
|
|
78
81
|
} from "./src/folder-api/index.js";
|
|
79
82
|
import {
|
|
@@ -135,6 +138,7 @@ export {
|
|
|
135
138
|
createPictureGallery,
|
|
136
139
|
createTagLib,
|
|
137
140
|
dataURLToPicture,
|
|
141
|
+
discFolderInfo,
|
|
138
142
|
displayPicture,
|
|
139
143
|
exportAllPictures,
|
|
140
144
|
exportCoverArt,
|
|
@@ -148,6 +152,7 @@ export {
|
|
|
148
152
|
getAllTagNames,
|
|
149
153
|
getPropertiesByFormat,
|
|
150
154
|
getPropertyMetadata,
|
|
155
|
+
groupAlbums,
|
|
151
156
|
imageFileToPicture,
|
|
152
157
|
importCoverArt,
|
|
153
158
|
importPictureWithType,
|
|
@@ -181,6 +186,7 @@ export {
|
|
|
181
186
|
replacePictureByType,
|
|
182
187
|
savePictureToFile,
|
|
183
188
|
scanFolder,
|
|
189
|
+
scanForAlbums,
|
|
184
190
|
setBufferMode,
|
|
185
191
|
setCoverArtFromCanvas,
|
|
186
192
|
updateFolderTags
|
package/dist/simple.browser.js
CHANGED
|
@@ -1296,6 +1296,35 @@ var init_specialized_properties = __esm({
|
|
|
1296
1296
|
mp4: "----:com.apple.iTunes:MusicBrainz Release Group Id"
|
|
1297
1297
|
}
|
|
1298
1298
|
},
|
|
1299
|
+
releaseType: {
|
|
1300
|
+
key: "RELEASETYPE",
|
|
1301
|
+
description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE",
|
|
1302
|
+
type: "string",
|
|
1303
|
+
supportedFormats: [
|
|
1304
|
+
"ID3v2",
|
|
1305
|
+
"MP4",
|
|
1306
|
+
"Vorbis",
|
|
1307
|
+
"APE",
|
|
1308
|
+
"ASF",
|
|
1309
|
+
"Matroska"
|
|
1310
|
+
],
|
|
1311
|
+
mappings: {
|
|
1312
|
+
id3v2: { frame: "TXXX", description: "MusicBrainz Album Type" },
|
|
1313
|
+
vorbis: "RELEASETYPE",
|
|
1314
|
+
mp4: "----:com.apple.iTunes:MusicBrainz Album Type"
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
itunesAdvisory: {
|
|
1318
|
+
key: "ITUNESADVISORY",
|
|
1319
|
+
description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here",
|
|
1320
|
+
type: "string",
|
|
1321
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "APE", "ASF"],
|
|
1322
|
+
mappings: {
|
|
1323
|
+
id3v2: { frame: "TXXX", description: "ITUNESADVISORY" },
|
|
1324
|
+
vorbis: "ITUNESADVISORY",
|
|
1325
|
+
mp4: "----:com.apple.iTunes:ITUNESADVISORY"
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1299
1328
|
// ReplayGain Properties
|
|
1300
1329
|
replayGainTrackGain: {
|
|
1301
1330
|
key: "REPLAYGAIN_TRACK_GAIN",
|
|
@@ -1341,6 +1370,28 @@ var init_specialized_properties = __esm({
|
|
|
1341
1370
|
mp4: "----:com.apple.iTunes:replaygain_album_peak"
|
|
1342
1371
|
}
|
|
1343
1372
|
},
|
|
1373
|
+
r128TrackGain: {
|
|
1374
|
+
key: "R128_TRACK_GAIN",
|
|
1375
|
+
description: "EBU R128 track loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256, e.g. '-573' = -2.23828125 dB). readTags() converts to a decibel number (see ExtendedTag.r128TrackGain)",
|
|
1376
|
+
type: "string",
|
|
1377
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "ASF"],
|
|
1378
|
+
mappings: {
|
|
1379
|
+
id3v2: { frame: "TXXX", description: "R128_TRACK_GAIN" },
|
|
1380
|
+
vorbis: "R128_TRACK_GAIN",
|
|
1381
|
+
mp4: "----:com.apple.iTunes:R128_TRACK_GAIN"
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
r128AlbumGain: {
|
|
1385
|
+
key: "R128_ALBUM_GAIN",
|
|
1386
|
+
description: "EBU R128 album loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256). readTags() converts to a decibel number",
|
|
1387
|
+
type: "string",
|
|
1388
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "ASF"],
|
|
1389
|
+
mappings: {
|
|
1390
|
+
id3v2: { frame: "TXXX", description: "R128_ALBUM_GAIN" },
|
|
1391
|
+
vorbis: "R128_ALBUM_GAIN",
|
|
1392
|
+
mp4: "----:com.apple.iTunes:R128_ALBUM_GAIN"
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1344
1395
|
// AcoustID Properties
|
|
1345
1396
|
acoustidFingerprint: {
|
|
1346
1397
|
key: "ACOUSTID_FINGERPRINT",
|
|
@@ -1421,11 +1472,13 @@ function fromTagLibKey(key) {
|
|
|
1421
1472
|
function remapKeysFromTagLib(obj) {
|
|
1422
1473
|
const result = {};
|
|
1423
1474
|
for (const [key, value] of Object.entries(obj)) {
|
|
1475
|
+
const canonical = READ_ALIASES[key];
|
|
1476
|
+
if (canonical !== void 0 && canonical in obj) continue;
|
|
1424
1477
|
result[fromTagLibKey(key)] = value;
|
|
1425
1478
|
}
|
|
1426
1479
|
return result;
|
|
1427
1480
|
}
|
|
1428
|
-
var PROPERTIES, _toTagLib, _fromTagLib, _mp4FreeformAtoms, _mp4AtomToWireKey;
|
|
1481
|
+
var PROPERTIES, _toTagLib, _fromTagLib, READ_ALIASES, _mp4FreeformAtoms, _mp4AtomToWireKey;
|
|
1429
1482
|
var init_properties = __esm({
|
|
1430
1483
|
"src/constants/properties.ts"() {
|
|
1431
1484
|
"use strict";
|
|
@@ -1449,6 +1502,26 @@ var init_properties = __esm({
|
|
|
1449
1502
|
_toTagLib["year"] = "DATE";
|
|
1450
1503
|
_toTagLib["track"] = "TRACKNUMBER";
|
|
1451
1504
|
_fromTagLib["disc"] = "discNumber";
|
|
1505
|
+
READ_ALIASES = {
|
|
1506
|
+
"ALBUM ARTIST": "ALBUMARTIST",
|
|
1507
|
+
ALBUM_ARTIST: "ALBUMARTIST",
|
|
1508
|
+
ORGANIZATION: "LABEL",
|
|
1509
|
+
PUBLISHER: "LABEL",
|
|
1510
|
+
UPC: "BARCODE",
|
|
1511
|
+
EAN: "BARCODE",
|
|
1512
|
+
GTIN: "BARCODE",
|
|
1513
|
+
TOTALTRACKS: "TRACKTOTAL",
|
|
1514
|
+
TOTALDISCS: "DISCTOTAL",
|
|
1515
|
+
MUSICBRAINZ_ALBUMTYPE: "RELEASETYPE",
|
|
1516
|
+
"MusicBrainz Album Type": "RELEASETYPE",
|
|
1517
|
+
CONTENTADVISORY: "ITUNESADVISORY",
|
|
1518
|
+
EXPLICIT: "ITUNESADVISORY"
|
|
1519
|
+
};
|
|
1520
|
+
for (const [alias, canonical] of Object.entries(READ_ALIASES)) {
|
|
1521
|
+
if (_fromTagLib[alias] === void 0) {
|
|
1522
|
+
_fromTagLib[alias] = _fromTagLib[canonical];
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1452
1525
|
_mp4FreeformAtoms = {};
|
|
1453
1526
|
for (const meta of Object.values(PROPERTIES)) {
|
|
1454
1527
|
const { key, mappings } = meta;
|
|
@@ -1650,7 +1723,9 @@ var init_audio_file_base = __esm({
|
|
|
1650
1723
|
setProperties(properties) {
|
|
1651
1724
|
const translated = {};
|
|
1652
1725
|
for (const [key, values] of Object.entries(properties)) {
|
|
1653
|
-
if (values !== void 0)
|
|
1726
|
+
if (values !== void 0) {
|
|
1727
|
+
translated[toTagLibKey(fromTagLibKey(key))] = values;
|
|
1728
|
+
}
|
|
1654
1729
|
}
|
|
1655
1730
|
if (!(LYRICS_WIRE_KEY in translated)) {
|
|
1656
1731
|
const existing = this.handle.getProperties()[LYRICS_WIRE_KEY];
|
|
@@ -1661,14 +1736,14 @@ var init_audio_file_base = __esm({
|
|
|
1661
1736
|
this.handle.setProperties(translated);
|
|
1662
1737
|
}
|
|
1663
1738
|
getProperty(key) {
|
|
1664
|
-
const value = this.handle.getProperty(toTagLibKey(key));
|
|
1739
|
+
const value = this.handle.getProperty(toTagLibKey(fromTagLibKey(key)));
|
|
1665
1740
|
if (value !== "") return value;
|
|
1666
1741
|
if (!this.isMP4()) return void 0;
|
|
1667
1742
|
const remapped = this.properties()[key]?.[0];
|
|
1668
1743
|
return remapped === "" ? void 0 : remapped;
|
|
1669
1744
|
}
|
|
1670
1745
|
setProperty(key, value) {
|
|
1671
|
-
const wireKey = toTagLibKey(key);
|
|
1746
|
+
const wireKey = toTagLibKey(fromTagLibKey(key));
|
|
1672
1747
|
const atomNames = mp4FreeformAtomNames([wireKey]);
|
|
1673
1748
|
if (atomNames.length > 0 && this.isMP4()) {
|
|
1674
1749
|
this.handle.setProperties({
|
|
@@ -2534,8 +2609,17 @@ function mapPropertiesToExtendedTag(props) {
|
|
|
2534
2609
|
const total = parseLeadingInt(raw.slice(slash + 1));
|
|
2535
2610
|
if (total !== void 0) tag[totalField] = total;
|
|
2536
2611
|
}
|
|
2612
|
+
if (tag.date === void 0) {
|
|
2613
|
+
const yearValues = props["YEAR"];
|
|
2614
|
+
if (yearValues !== void 0 && yearValues.length > 0) {
|
|
2615
|
+
const y = parseLeadingInt(yearValues[0]);
|
|
2616
|
+
if (y !== void 0) tag.year = y;
|
|
2617
|
+
tag.date = yearValues.length === 1 ? yearValues[0] : yearValues;
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2537
2620
|
for (const [key, values] of Object.entries(props)) {
|
|
2538
2621
|
if (BASIC_PROPERTY_KEYS[key]) continue;
|
|
2622
|
+
if (key === "YEAR") continue;
|
|
2539
2623
|
if (!values || values.length === 0) continue;
|
|
2540
2624
|
const camelKey = fromTagLibKey(key);
|
|
2541
2625
|
if (NUMERIC_FIELDS.has(camelKey)) {
|
|
@@ -2543,6 +2627,14 @@ function mapPropertiesToExtendedTag(props) {
|
|
|
2543
2627
|
if (num !== void 0) tag[camelKey] = num;
|
|
2544
2628
|
} else if (camelKey === "compilation") {
|
|
2545
2629
|
tag[camelKey] = values[0] === "1";
|
|
2630
|
+
} else if (camelKey === "itunesAdvisory") {
|
|
2631
|
+
tag[camelKey] = values;
|
|
2632
|
+
if (values[0] === "1") tag.advisory = "explicit";
|
|
2633
|
+
else if (values[0] === "2") tag.advisory = "clean";
|
|
2634
|
+
else if (values[0] === "0") tag.advisory = "unspecified";
|
|
2635
|
+
} else if (camelKey === "r128TrackGain" || camelKey === "r128AlbumGain") {
|
|
2636
|
+
const raw = parseLeadingInt(values[0]);
|
|
2637
|
+
if (raw !== void 0) tag[camelKey] = raw / 256;
|
|
2546
2638
|
} else {
|
|
2547
2639
|
tag[camelKey] = values;
|
|
2548
2640
|
}
|
|
@@ -2553,6 +2645,9 @@ function mergeTagUpdates(file, tags) {
|
|
|
2553
2645
|
const currentProps = file.properties();
|
|
2554
2646
|
const newProps = normalizeTagInput(tags);
|
|
2555
2647
|
reconcilePairFields(currentProps, newProps, tags);
|
|
2648
|
+
if (newProps.date !== void 0 || newProps.year !== void 0) {
|
|
2649
|
+
currentProps.YEAR = [];
|
|
2650
|
+
}
|
|
2556
2651
|
file.setProperties({ ...currentProps, ...newProps });
|
|
2557
2652
|
}
|
|
2558
2653
|
function reconcilePairFields(currentProps, newProps, input) {
|
|
@@ -2604,8 +2699,14 @@ function normalizeTagInput(input) {
|
|
|
2604
2699
|
if (BASIC_FIELDS.has(field) || val === void 0) continue;
|
|
2605
2700
|
if (field === "compilation") {
|
|
2606
2701
|
props[field] = [val ? "1" : "0"];
|
|
2702
|
+
} else if (field === "advisory") {
|
|
2703
|
+
if (val === "explicit") props.itunesAdvisory = ["1"];
|
|
2704
|
+
else if (val === "clean") props.itunesAdvisory = ["2"];
|
|
2705
|
+
else if (val === "unspecified") props.itunesAdvisory = [];
|
|
2607
2706
|
} else if (NUMERIC_FIELDS.has(field)) {
|
|
2608
2707
|
props[field] = [String(val)];
|
|
2708
|
+
} else if (field === "r128TrackGain" || field === "r128AlbumGain") {
|
|
2709
|
+
props[field] = Array.isArray(val) ? val : [String(Math.round(val * 256))];
|
|
2609
2710
|
} else if (typeof val === "string") {
|
|
2610
2711
|
props[field] = [val];
|
|
2611
2712
|
} else if (Array.isArray(val)) {
|
|
@@ -2662,7 +2763,7 @@ var VERSION;
|
|
|
2662
2763
|
var init_version = __esm({
|
|
2663
2764
|
"src/version.ts"() {
|
|
2664
2765
|
"use strict";
|
|
2665
|
-
VERSION = "1.
|
|
2766
|
+
VERSION = "1.8.1";
|
|
2666
2767
|
}
|
|
2667
2768
|
});
|
|
2668
2769
|
|
|
@@ -297,6 +297,34 @@ export declare const PROPERTIES: {
|
|
|
297
297
|
readonly mp4: "----:com.apple.iTunes:MusicBrainz Release Group Id";
|
|
298
298
|
};
|
|
299
299
|
};
|
|
300
|
+
readonly releaseType: {
|
|
301
|
+
readonly key: "RELEASETYPE";
|
|
302
|
+
readonly description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE";
|
|
303
|
+
readonly type: "string";
|
|
304
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF", "Matroska"];
|
|
305
|
+
readonly mappings: {
|
|
306
|
+
readonly id3v2: {
|
|
307
|
+
readonly frame: "TXXX";
|
|
308
|
+
readonly description: "MusicBrainz Album Type";
|
|
309
|
+
};
|
|
310
|
+
readonly vorbis: "RELEASETYPE";
|
|
311
|
+
readonly mp4: "----:com.apple.iTunes:MusicBrainz Album Type";
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
readonly itunesAdvisory: {
|
|
315
|
+
readonly key: "ITUNESADVISORY";
|
|
316
|
+
readonly description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here";
|
|
317
|
+
readonly type: "string";
|
|
318
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF"];
|
|
319
|
+
readonly mappings: {
|
|
320
|
+
readonly id3v2: {
|
|
321
|
+
readonly frame: "TXXX";
|
|
322
|
+
readonly description: "ITUNESADVISORY";
|
|
323
|
+
};
|
|
324
|
+
readonly vorbis: "ITUNESADVISORY";
|
|
325
|
+
readonly mp4: "----:com.apple.iTunes:ITUNESADVISORY";
|
|
326
|
+
};
|
|
327
|
+
};
|
|
300
328
|
readonly replayGainTrackGain: {
|
|
301
329
|
readonly key: "REPLAYGAIN_TRACK_GAIN";
|
|
302
330
|
readonly description: "ReplayGain track gain in dB (e.g., '-6.54 dB')";
|
|
@@ -353,6 +381,34 @@ export declare const PROPERTIES: {
|
|
|
353
381
|
readonly mp4: "----:com.apple.iTunes:replaygain_album_peak";
|
|
354
382
|
};
|
|
355
383
|
};
|
|
384
|
+
readonly r128TrackGain: {
|
|
385
|
+
readonly key: "R128_TRACK_GAIN";
|
|
386
|
+
readonly description: "EBU R128 track loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256, e.g. '-573' = -2.23828125 dB). readTags() converts to a decibel number (see ExtendedTag.r128TrackGain)";
|
|
387
|
+
readonly type: "string";
|
|
388
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "ASF"];
|
|
389
|
+
readonly mappings: {
|
|
390
|
+
readonly id3v2: {
|
|
391
|
+
readonly frame: "TXXX";
|
|
392
|
+
readonly description: "R128_TRACK_GAIN";
|
|
393
|
+
};
|
|
394
|
+
readonly vorbis: "R128_TRACK_GAIN";
|
|
395
|
+
readonly mp4: "----:com.apple.iTunes:R128_TRACK_GAIN";
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
readonly r128AlbumGain: {
|
|
399
|
+
readonly key: "R128_ALBUM_GAIN";
|
|
400
|
+
readonly description: "EBU R128 album loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256). readTags() converts to a decibel number";
|
|
401
|
+
readonly type: "string";
|
|
402
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "ASF"];
|
|
403
|
+
readonly mappings: {
|
|
404
|
+
readonly id3v2: {
|
|
405
|
+
readonly frame: "TXXX";
|
|
406
|
+
readonly description: "R128_ALBUM_GAIN";
|
|
407
|
+
};
|
|
408
|
+
readonly vorbis: "R128_ALBUM_GAIN";
|
|
409
|
+
readonly mp4: "----:com.apple.iTunes:R128_ALBUM_GAIN";
|
|
410
|
+
};
|
|
411
|
+
};
|
|
356
412
|
readonly acoustidFingerprint: {
|
|
357
413
|
readonly key: "ACOUSTID_FINGERPRINT";
|
|
358
414
|
readonly description: "AcoustID fingerprint (Chromaprint)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/constants/properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/constants/properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AG,MAAM,EAAE,CAOzE;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GACrB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CASnB;AAGD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -18,6 +18,26 @@ for (const [camelKey, meta] of Object.entries(PROPERTIES)) {
|
|
|
18
18
|
_toTagLib["year"] = "DATE";
|
|
19
19
|
_toTagLib["track"] = "TRACKNUMBER";
|
|
20
20
|
_fromTagLib["disc"] = "discNumber";
|
|
21
|
+
const READ_ALIASES = {
|
|
22
|
+
"ALBUM ARTIST": "ALBUMARTIST",
|
|
23
|
+
ALBUM_ARTIST: "ALBUMARTIST",
|
|
24
|
+
ORGANIZATION: "LABEL",
|
|
25
|
+
PUBLISHER: "LABEL",
|
|
26
|
+
UPC: "BARCODE",
|
|
27
|
+
EAN: "BARCODE",
|
|
28
|
+
GTIN: "BARCODE",
|
|
29
|
+
TOTALTRACKS: "TRACKTOTAL",
|
|
30
|
+
TOTALDISCS: "DISCTOTAL",
|
|
31
|
+
MUSICBRAINZ_ALBUMTYPE: "RELEASETYPE",
|
|
32
|
+
"MusicBrainz Album Type": "RELEASETYPE",
|
|
33
|
+
CONTENTADVISORY: "ITUNESADVISORY",
|
|
34
|
+
EXPLICIT: "ITUNESADVISORY"
|
|
35
|
+
};
|
|
36
|
+
for (const [alias, canonical] of Object.entries(READ_ALIASES)) {
|
|
37
|
+
if (_fromTagLib[alias] === void 0) {
|
|
38
|
+
_fromTagLib[alias] = _fromTagLib[canonical];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
21
41
|
function toTagLibKey(key) {
|
|
22
42
|
return _toTagLib[key] ?? key;
|
|
23
43
|
}
|
|
@@ -59,6 +79,8 @@ function fromTagLibKey(key) {
|
|
|
59
79
|
function remapKeysFromTagLib(obj) {
|
|
60
80
|
const result = {};
|
|
61
81
|
for (const [key, value] of Object.entries(obj)) {
|
|
82
|
+
const canonical = READ_ALIASES[key];
|
|
83
|
+
if (canonical !== void 0 && canonical in obj) continue;
|
|
62
84
|
result[fromTagLibKey(key)] = value;
|
|
63
85
|
}
|
|
64
86
|
return result;
|
|
@@ -59,6 +59,34 @@ export declare const SPECIALIZED_PROPERTIES: {
|
|
|
59
59
|
readonly mp4: "----:com.apple.iTunes:MusicBrainz Release Group Id";
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
+
readonly releaseType: {
|
|
63
|
+
readonly key: "RELEASETYPE";
|
|
64
|
+
readonly description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE";
|
|
65
|
+
readonly type: "string";
|
|
66
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF", "Matroska"];
|
|
67
|
+
readonly mappings: {
|
|
68
|
+
readonly id3v2: {
|
|
69
|
+
readonly frame: "TXXX";
|
|
70
|
+
readonly description: "MusicBrainz Album Type";
|
|
71
|
+
};
|
|
72
|
+
readonly vorbis: "RELEASETYPE";
|
|
73
|
+
readonly mp4: "----:com.apple.iTunes:MusicBrainz Album Type";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly itunesAdvisory: {
|
|
77
|
+
readonly key: "ITUNESADVISORY";
|
|
78
|
+
readonly description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here";
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF"];
|
|
81
|
+
readonly mappings: {
|
|
82
|
+
readonly id3v2: {
|
|
83
|
+
readonly frame: "TXXX";
|
|
84
|
+
readonly description: "ITUNESADVISORY";
|
|
85
|
+
};
|
|
86
|
+
readonly vorbis: "ITUNESADVISORY";
|
|
87
|
+
readonly mp4: "----:com.apple.iTunes:ITUNESADVISORY";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
62
90
|
readonly replayGainTrackGain: {
|
|
63
91
|
readonly key: "REPLAYGAIN_TRACK_GAIN";
|
|
64
92
|
readonly description: "ReplayGain track gain in dB (e.g., '-6.54 dB')";
|
|
@@ -115,6 +143,34 @@ export declare const SPECIALIZED_PROPERTIES: {
|
|
|
115
143
|
readonly mp4: "----:com.apple.iTunes:replaygain_album_peak";
|
|
116
144
|
};
|
|
117
145
|
};
|
|
146
|
+
readonly r128TrackGain: {
|
|
147
|
+
readonly key: "R128_TRACK_GAIN";
|
|
148
|
+
readonly description: "EBU R128 track loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256, e.g. '-573' = -2.23828125 dB). readTags() converts to a decibel number (see ExtendedTag.r128TrackGain)";
|
|
149
|
+
readonly type: "string";
|
|
150
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "ASF"];
|
|
151
|
+
readonly mappings: {
|
|
152
|
+
readonly id3v2: {
|
|
153
|
+
readonly frame: "TXXX";
|
|
154
|
+
readonly description: "R128_TRACK_GAIN";
|
|
155
|
+
};
|
|
156
|
+
readonly vorbis: "R128_TRACK_GAIN";
|
|
157
|
+
readonly mp4: "----:com.apple.iTunes:R128_TRACK_GAIN";
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
readonly r128AlbumGain: {
|
|
161
|
+
readonly key: "R128_ALBUM_GAIN";
|
|
162
|
+
readonly description: "EBU R128 album loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256). readTags() converts to a decibel number";
|
|
163
|
+
readonly type: "string";
|
|
164
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "ASF"];
|
|
165
|
+
readonly mappings: {
|
|
166
|
+
readonly id3v2: {
|
|
167
|
+
readonly frame: "TXXX";
|
|
168
|
+
readonly description: "R128_ALBUM_GAIN";
|
|
169
|
+
};
|
|
170
|
+
readonly vorbis: "R128_ALBUM_GAIN";
|
|
171
|
+
readonly mp4: "----:com.apple.iTunes:R128_ALBUM_GAIN";
|
|
172
|
+
};
|
|
173
|
+
};
|
|
118
174
|
readonly acoustidFingerprint: {
|
|
119
175
|
readonly key: "ACOUSTID_FINGERPRINT";
|
|
120
176
|
readonly description: "AcoustID fingerprint (Chromaprint)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specialized-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/specialized-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"specialized-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/specialized-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwLjC;;;;;;;;OAQG;;;;;;;;;;;;;;;CAYK,CAAC"}
|
|
@@ -44,6 +44,35 @@ const SPECIALIZED_PROPERTIES = {
|
|
|
44
44
|
mp4: "----:com.apple.iTunes:MusicBrainz Release Group Id"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
releaseType: {
|
|
48
|
+
key: "RELEASETYPE",
|
|
49
|
+
description: "Release type (album, single, EP, compilation, ...). Multi-value (e.g. 'album' + 'EP'). TagLib 2.3.1 translates the RELEASETYPE key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM TYPE' (TagLib's description casing), MP4 freeform atom, APEv2 MUSICBRAINZ_ALBUMTYPE, ASF 'MusicBrainz/Album Type', Vorbis/Matroska raw RELEASETYPE",
|
|
50
|
+
type: "string",
|
|
51
|
+
supportedFormats: [
|
|
52
|
+
"ID3v2",
|
|
53
|
+
"MP4",
|
|
54
|
+
"Vorbis",
|
|
55
|
+
"APE",
|
|
56
|
+
"ASF",
|
|
57
|
+
"Matroska"
|
|
58
|
+
],
|
|
59
|
+
mappings: {
|
|
60
|
+
id3v2: { frame: "TXXX", description: "MusicBrainz Album Type" },
|
|
61
|
+
vorbis: "RELEASETYPE",
|
|
62
|
+
mp4: "----:com.apple.iTunes:MusicBrainz Album Type"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
itunesAdvisory: {
|
|
66
|
+
key: "ITUNESADVISORY",
|
|
67
|
+
description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here",
|
|
68
|
+
type: "string",
|
|
69
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "APE", "ASF"],
|
|
70
|
+
mappings: {
|
|
71
|
+
id3v2: { frame: "TXXX", description: "ITUNESADVISORY" },
|
|
72
|
+
vorbis: "ITUNESADVISORY",
|
|
73
|
+
mp4: "----:com.apple.iTunes:ITUNESADVISORY"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
47
76
|
// ReplayGain Properties
|
|
48
77
|
replayGainTrackGain: {
|
|
49
78
|
key: "REPLAYGAIN_TRACK_GAIN",
|
|
@@ -89,6 +118,28 @@ const SPECIALIZED_PROPERTIES = {
|
|
|
89
118
|
mp4: "----:com.apple.iTunes:replaygain_album_peak"
|
|
90
119
|
}
|
|
91
120
|
},
|
|
121
|
+
r128TrackGain: {
|
|
122
|
+
key: "R128_TRACK_GAIN",
|
|
123
|
+
description: "EBU R128 track loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256, e.g. '-573' = -2.23828125 dB). readTags() converts to a decibel number (see ExtendedTag.r128TrackGain)",
|
|
124
|
+
type: "string",
|
|
125
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "ASF"],
|
|
126
|
+
mappings: {
|
|
127
|
+
id3v2: { frame: "TXXX", description: "R128_TRACK_GAIN" },
|
|
128
|
+
vorbis: "R128_TRACK_GAIN",
|
|
129
|
+
mp4: "----:com.apple.iTunes:R128_TRACK_GAIN"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
r128AlbumGain: {
|
|
133
|
+
key: "R128_ALBUM_GAIN",
|
|
134
|
+
description: "EBU R128 album loudness gain (RFC 7845), raw wire value: signed Q7.8 integer (dB x 256). readTags() converts to a decibel number",
|
|
135
|
+
type: "string",
|
|
136
|
+
supportedFormats: ["ID3v2", "MP4", "Vorbis", "ASF"],
|
|
137
|
+
mappings: {
|
|
138
|
+
id3v2: { frame: "TXXX", description: "R128_ALBUM_GAIN" },
|
|
139
|
+
vorbis: "R128_ALBUM_GAIN",
|
|
140
|
+
mp4: "----:com.apple.iTunes:R128_ALBUM_GAIN"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
92
143
|
// AcoustID Properties
|
|
93
144
|
acoustidFingerprint: {
|
|
94
145
|
key: "ACOUSTID_FINGERPRINT",
|
|
@@ -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,EACV,UAAU,EACV,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACX,MAAM,eAAe,CAA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
|
|
@@ -237,6 +237,7 @@ class WasiFileHandle {
|
|
|
237
237
|
if (value === 0 || value === "") continue;
|
|
238
238
|
const propKey = toTagLibKey(key);
|
|
239
239
|
if (Array.isArray(value)) {
|
|
240
|
+
if (value.length === 0) continue;
|
|
240
241
|
result[propKey] = value.map(String);
|
|
241
242
|
} else if (typeof value === "object") {
|
|
242
243
|
continue;
|
|
@@ -260,7 +261,8 @@ class WasiFileHandle {
|
|
|
260
261
|
if (mirror !== void 0) {
|
|
261
262
|
stageRawWrite(next, mirror, values);
|
|
262
263
|
} else if (values.length === 0) {
|
|
263
|
-
|
|
264
|
+
if (camelKey === "itunesAdvisory") next[camelKey] = [];
|
|
265
|
+
else delete next[camelKey];
|
|
264
266
|
} else {
|
|
265
267
|
next[camelKey] = values;
|
|
266
268
|
}
|
|
@@ -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;
|
|
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;AASrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAgBhE;;;;;GAKG;AACH,8BAAsB,iBAAiB;IAWnC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY;IAVzC,SAAS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G,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAe3C,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAoB5C,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOhC,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,IAAI;IAQf,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
|
|
@@ -2,6 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import {
|
|
5
|
+
fromTagLibKey,
|
|
5
6
|
mp4AtomWireKey,
|
|
6
7
|
mp4FreeformAtomNames,
|
|
7
8
|
remapKeysFromTagLib,
|
|
@@ -76,7 +77,9 @@ class BaseAudioFileImpl {
|
|
|
76
77
|
setProperties(properties) {
|
|
77
78
|
const translated = {};
|
|
78
79
|
for (const [key, values] of Object.entries(properties)) {
|
|
79
|
-
if (values !== void 0)
|
|
80
|
+
if (values !== void 0) {
|
|
81
|
+
translated[toTagLibKey(fromTagLibKey(key))] = values;
|
|
82
|
+
}
|
|
80
83
|
}
|
|
81
84
|
if (!(LYRICS_WIRE_KEY in translated)) {
|
|
82
85
|
const existing = this.handle.getProperties()[LYRICS_WIRE_KEY];
|
|
@@ -87,14 +90,14 @@ class BaseAudioFileImpl {
|
|
|
87
90
|
this.handle.setProperties(translated);
|
|
88
91
|
}
|
|
89
92
|
getProperty(key) {
|
|
90
|
-
const value = this.handle.getProperty(toTagLibKey(key));
|
|
93
|
+
const value = this.handle.getProperty(toTagLibKey(fromTagLibKey(key)));
|
|
91
94
|
if (value !== "") return value;
|
|
92
95
|
if (!this.isMP4()) return void 0;
|
|
93
96
|
const remapped = this.properties()[key]?.[0];
|
|
94
97
|
return remapped === "" ? void 0 : remapped;
|
|
95
98
|
}
|
|
96
99
|
setProperty(key, value) {
|
|
97
|
-
const wireKey = toTagLibKey(key);
|
|
100
|
+
const wireKey = toTagLibKey(fromTagLibKey(key));
|
|
98
101
|
const atomNames = mp4FreeformAtomNames([wireKey]);
|
|
99
102
|
if (atomNames.length > 0 && this.isMP4()) {
|
|
100
103
|
this.handle.setProperties({
|
|
@@ -42,5 +42,5 @@ export interface FieldMapping {
|
|
|
42
42
|
* const vorbisField = METADATA_MAPPINGS.albumArtist.vorbis; // "ALBUMARTIST"
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export declare const METADATA_MAPPINGS: Record<Exclude<keyof ExtendedTag, "pictures" | "ratings" | "lyrics" | "chapters" | "bext" | "bextData" | "ixml" | "id3v2Frames">, FieldMapping>;
|
|
45
|
+
export declare const METADATA_MAPPINGS: Record<Exclude<keyof ExtendedTag, "pictures" | "ratings" | "lyrics" | "chapters" | "bext" | "bextData" | "ixml" | "id3v2Frames" | "advisory">, FieldMapping>;
|
|
46
46
|
//# sourceMappingURL=metadata-mappings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-mappings.d.ts","sourceRoot":"","sources":["../../../src/types/metadata-mappings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,OAAO,CACL,MAAM,WAAW,EACf,UAAU,GACV,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,UAAU,GACV,MAAM,GACN,aAAa,
|
|
1
|
+
{"version":3,"file":"metadata-mappings.d.ts","sourceRoot":"","sources":["../../../src/types/metadata-mappings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,OAAO,CACL,MAAM,WAAW,EACf,UAAU,GACV,SAAS,GACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,UAAU,GACV,MAAM,GACN,aAAa,GAGb,UAAU,CACb,EACD,YAAY,CAkPb,CAAC"}
|
|
@@ -208,6 +208,26 @@ const METADATA_MAPPINGS = {
|
|
|
208
208
|
vorbis: "REPLAYGAIN_ALBUM_PEAK",
|
|
209
209
|
mp4: "----:com.apple.iTunes:replaygain_album_peak"
|
|
210
210
|
},
|
|
211
|
+
r128TrackGain: {
|
|
212
|
+
id3v2: { frame: "TXXX", description: "R128_TRACK_GAIN" },
|
|
213
|
+
vorbis: "R128_TRACK_GAIN",
|
|
214
|
+
mp4: "----:com.apple.iTunes:R128_TRACK_GAIN"
|
|
215
|
+
},
|
|
216
|
+
r128AlbumGain: {
|
|
217
|
+
id3v2: { frame: "TXXX", description: "R128_ALBUM_GAIN" },
|
|
218
|
+
vorbis: "R128_ALBUM_GAIN",
|
|
219
|
+
mp4: "----:com.apple.iTunes:R128_ALBUM_GAIN"
|
|
220
|
+
},
|
|
221
|
+
releaseType: {
|
|
222
|
+
id3v2: { frame: "TXXX", description: "MUSICBRAINZ ALBUM TYPE" },
|
|
223
|
+
vorbis: "RELEASETYPE",
|
|
224
|
+
mp4: "----:com.apple.iTunes:MusicBrainz Album Type"
|
|
225
|
+
},
|
|
226
|
+
itunesAdvisory: {
|
|
227
|
+
id3v2: { frame: "TXXX", description: "ITUNESADVISORY" },
|
|
228
|
+
vorbis: "ITUNESADVISORY",
|
|
229
|
+
mp4: "----:com.apple.iTunes:ITUNESADVISORY"
|
|
230
|
+
},
|
|
211
231
|
// Apple Sound Check mapping
|
|
212
232
|
appleSoundCheck: {
|
|
213
233
|
id3v2: { frame: "TXXX", description: "iTunNORM" },
|
package/dist/src/types/tags.d.ts
CHANGED
|
@@ -109,10 +109,23 @@ export interface TagInput {
|
|
|
109
109
|
readonly musicbrainzReleaseId?: string | string[];
|
|
110
110
|
readonly musicbrainzArtistId?: string | string[];
|
|
111
111
|
readonly musicbrainzReleaseGroupId?: string | string[];
|
|
112
|
+
/** Release type (album, single, EP, compilation, ...); multi-value allowed */
|
|
113
|
+
readonly releaseType?: string | string[];
|
|
114
|
+
/** Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified) */
|
|
115
|
+
readonly itunesAdvisory?: string | string[];
|
|
116
|
+
/**
|
|
117
|
+
* Content advisory tri-state (taglib-an30): "explicit" | "clean" |
|
|
118
|
+
* "unspecified". Stored as MP4's native rtng atom on MP4, ITUNESADVISORY
|
|
119
|
+
* elsewhere. "unspecified" clears the representation; undefined leaves it
|
|
120
|
+
* unchanged.
|
|
121
|
+
*/
|
|
122
|
+
readonly advisory?: "explicit" | "clean" | "unspecified";
|
|
112
123
|
readonly replayGainTrackGain?: string | string[];
|
|
113
124
|
readonly replayGainTrackPeak?: string | string[];
|
|
114
125
|
readonly replayGainAlbumGain?: string | string[];
|
|
115
126
|
readonly replayGainAlbumPeak?: string | string[];
|
|
127
|
+
readonly r128TrackGain?: number | string[];
|
|
128
|
+
readonly r128AlbumGain?: number | string[];
|
|
116
129
|
readonly discNumber?: number;
|
|
117
130
|
readonly totalTracks?: number;
|
|
118
131
|
readonly totalDiscs?: number;
|
|
@@ -161,6 +174,16 @@ export interface ExtendedTag extends Tag {
|
|
|
161
174
|
readonly musicbrainzArtistId?: string[];
|
|
162
175
|
/** MusicBrainz Release Group ID */
|
|
163
176
|
readonly musicbrainzReleaseGroupId?: string[];
|
|
177
|
+
/** Release type (album, single, EP, compilation, ...); multi-value */
|
|
178
|
+
readonly releaseType?: string[];
|
|
179
|
+
/** Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified) */
|
|
180
|
+
readonly itunesAdvisory?: string[];
|
|
181
|
+
/**
|
|
182
|
+
* Content advisory tri-state (taglib-an30): "explicit" | "clean" |
|
|
183
|
+
* "unspecified" ("0" and absence both read as unspecified; unknown raw
|
|
184
|
+
* values leave it unset while itunesAdvisory keeps the raw string).
|
|
185
|
+
*/
|
|
186
|
+
readonly advisory?: "explicit" | "clean" | "unspecified";
|
|
164
187
|
/** Album artist (different from track artist) */
|
|
165
188
|
readonly albumArtist?: string[];
|
|
166
189
|
/** Composer */
|
|
@@ -215,6 +238,8 @@ export interface ExtendedTag extends Tag {
|
|
|
215
238
|
readonly replayGainAlbumGain?: string[];
|
|
216
239
|
/** ReplayGain album peak value (0.0-1.0) */
|
|
217
240
|
readonly replayGainAlbumPeak?: string[];
|
|
241
|
+
readonly r128TrackGain?: number;
|
|
242
|
+
readonly r128AlbumGain?: number;
|
|
218
243
|
/** Apple Sound Check normalization data (iTunNORM) */
|
|
219
244
|
readonly appleSoundCheck?: string[];
|
|
220
245
|
/** Apple gapless playback data: encoder delay and padding (iTunSMPB) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{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,EAAE,SAAS,GAAG,WAAW,CAuBjE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"tag-mapping.d.ts","sourceRoot":"","sources":["../../../src/utils/tag-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAqCtE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,CAuBjE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CA4F1E;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,IAAI,CAaN;AAoDD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GACvB,WAAW,CA4Eb"}
|
|
@@ -75,8 +75,17 @@ function mapPropertiesToExtendedTag(props) {
|
|
|
75
75
|
const total = parseNumeric(raw.slice(slash + 1));
|
|
76
76
|
if (total !== void 0) tag[totalField] = total;
|
|
77
77
|
}
|
|
78
|
+
if (tag.date === void 0) {
|
|
79
|
+
const yearValues = props["YEAR"];
|
|
80
|
+
if (yearValues !== void 0 && yearValues.length > 0) {
|
|
81
|
+
const y = parseNumeric(yearValues[0]);
|
|
82
|
+
if (y !== void 0) tag.year = y;
|
|
83
|
+
tag.date = yearValues.length === 1 ? yearValues[0] : yearValues;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
78
86
|
for (const [key, values] of Object.entries(props)) {
|
|
79
87
|
if (BASIC_PROPERTY_KEYS[key]) continue;
|
|
88
|
+
if (key === "YEAR") continue;
|
|
80
89
|
if (!values || values.length === 0) continue;
|
|
81
90
|
const camelKey = fromTagLibKey(key);
|
|
82
91
|
if (NUMERIC_FIELDS.has(camelKey)) {
|
|
@@ -84,6 +93,14 @@ function mapPropertiesToExtendedTag(props) {
|
|
|
84
93
|
if (num !== void 0) tag[camelKey] = num;
|
|
85
94
|
} else if (camelKey === "compilation") {
|
|
86
95
|
tag[camelKey] = values[0] === "1";
|
|
96
|
+
} else if (camelKey === "itunesAdvisory") {
|
|
97
|
+
tag[camelKey] = values;
|
|
98
|
+
if (values[0] === "1") tag.advisory = "explicit";
|
|
99
|
+
else if (values[0] === "2") tag.advisory = "clean";
|
|
100
|
+
else if (values[0] === "0") tag.advisory = "unspecified";
|
|
101
|
+
} else if (camelKey === "r128TrackGain" || camelKey === "r128AlbumGain") {
|
|
102
|
+
const raw = parseNumeric(values[0]);
|
|
103
|
+
if (raw !== void 0) tag[camelKey] = raw / 256;
|
|
87
104
|
} else {
|
|
88
105
|
tag[camelKey] = values;
|
|
89
106
|
}
|
|
@@ -94,6 +111,9 @@ function mergeTagUpdates(file, tags) {
|
|
|
94
111
|
const currentProps = file.properties();
|
|
95
112
|
const newProps = normalizeTagInput(tags);
|
|
96
113
|
reconcilePairFields(currentProps, newProps, tags);
|
|
114
|
+
if (newProps.date !== void 0 || newProps.year !== void 0) {
|
|
115
|
+
currentProps.YEAR = [];
|
|
116
|
+
}
|
|
97
117
|
file.setProperties({ ...currentProps, ...newProps });
|
|
98
118
|
}
|
|
99
119
|
function reconcilePairFields(currentProps, newProps, input) {
|
|
@@ -145,8 +165,14 @@ function normalizeTagInput(input) {
|
|
|
145
165
|
if (BASIC_FIELDS.has(field) || val === void 0) continue;
|
|
146
166
|
if (field === "compilation") {
|
|
147
167
|
props[field] = [val ? "1" : "0"];
|
|
168
|
+
} else if (field === "advisory") {
|
|
169
|
+
if (val === "explicit") props.itunesAdvisory = ["1"];
|
|
170
|
+
else if (val === "clean") props.itunesAdvisory = ["2"];
|
|
171
|
+
else if (val === "unspecified") props.itunesAdvisory = [];
|
|
148
172
|
} else if (NUMERIC_FIELDS.has(field)) {
|
|
149
173
|
props[field] = [String(val)];
|
|
174
|
+
} else if (field === "r128TrackGain" || field === "r128AlbumGain") {
|
|
175
|
+
props[field] = Array.isArray(val) ? val : [String(Math.round(val * 256))];
|
|
150
176
|
} else if (typeof val === "string") {
|
|
151
177
|
props[field] = [val];
|
|
152
178
|
} else if (Array.isArray(val)) {
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.8.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/src/version.js
CHANGED
package/dist/taglib-wasi.wasm
CHANGED
|
Binary file
|
package/dist/taglib-web.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taglib-wasm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|