@openclaw/matrix 2026.9.34 → 2026.9.36
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/.setup/{channel-C0oyQ_i7.mjs → channel-BrgqoNpg.mjs} +3 -3
- package/dist/.setup/{channel.runtime-rboo2n9O.mjs → channel.runtime-DY4jJxW5.mjs} +1 -1
- package/dist/.setup/{monitor-BqBMKRwe.mjs → monitor-Ck8bkvK8.mjs} +11 -9
- package/dist/.setup/{outbound-BfgLFAJj.mjs → outbound-DfkxX7Z8.mjs} +1 -1
- package/dist/.setup/{reaction-events-CbRb1mUg.mjs → reaction-events-DmXtH5hh.mjs} +2 -2
- package/dist/.setup/{tool-actions-CdltFa1G.mjs → tool-actions-BsbYNn27.mjs} +1 -1
- package/dist/.source-module-urls/1cd4d4ff8d44e1c8b830932b44d7cf8a7f3350e09e169910e1d7a85e131b7bea.json +1 -0
- package/dist/api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/node_modules/music-metadata/README.md +35 -32
- package/node_modules/music-metadata/lib/ParserFactory.d.ts +1 -1
- package/node_modules/music-metadata/lib/ParserFactory.js +17 -13
- package/node_modules/music-metadata/lib/aiff/AiffParser.js +19 -12
- package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +1 -1
- package/node_modules/music-metadata/lib/aiff/AiffToken.js +2 -1
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +4 -3
- package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +59 -16
- package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +1 -0
- package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +1 -1
- package/node_modules/music-metadata/lib/apev2/APEv2Token.js +1 -1
- package/node_modules/music-metadata/lib/asf/AsfGuid.js +56 -50
- package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +1 -1
- package/node_modules/music-metadata/lib/asf/AsfObject.js +3 -2
- package/node_modules/music-metadata/lib/asf/AsfParser.js +15 -7
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +3 -2
- package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +21 -4
- package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +2 -2
- package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +6 -6
- package/node_modules/music-metadata/lib/common/FourCC.js +3 -2
- package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/GenericTagTypes.js +1 -1
- package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +3 -1
- package/node_modules/music-metadata/lib/common/MetadataCollector.js +28 -9
- package/node_modules/music-metadata/lib/common/Util.js +25 -17
- package/node_modules/music-metadata/lib/core.d.ts +4 -4
- package/node_modules/music-metadata/lib/core.js +18 -11
- package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +29 -16
- package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +1 -1
- package/node_modules/music-metadata/lib/dsf/DsfParser.js +3 -5
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +1 -1
- package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +35 -6
- package/node_modules/music-metadata/lib/ebml/types.d.ts +1 -1
- package/node_modules/music-metadata/lib/ebml/types.js +1 -1
- package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +1 -1
- package/node_modules/music-metadata/lib/flac/FlacParser.js +6 -5
- package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +1 -1
- package/node_modules/music-metadata/lib/flac/FlacToken.js +1 -1
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +212 -42
- package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +5 -5
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +8 -5
- package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +2 -1
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +53 -22
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +1 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +3 -3
- package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +1 -1
- package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +32 -16
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +2 -3
- package/node_modules/music-metadata/lib/index.js +6 -3
- package/node_modules/music-metadata/lib/lrc/LyricsParser.js +3 -5
- package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +7 -3
- package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +22 -11
- package/node_modules/music-metadata/lib/matroska/types.d.ts +2 -2
- package/node_modules/music-metadata/lib/mp4/Atom.d.ts +4 -3
- package/node_modules/music-metadata/lib/mp4/Atom.js +44 -11
- package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +30 -8
- package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +2 -0
- package/node_modules/music-metadata/lib/mp4/MP4Parser.js +79 -54
- package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +2 -2
- package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +1 -1
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +41 -19
- package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +2 -2
- package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +1 -1
- package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +1 -1
- package/node_modules/music-metadata/lib/musepack/MusepackParser.js +2 -2
- package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +1 -1
- package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +4 -3
- package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +3 -3
- package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +7 -5
- package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +2 -2
- package/node_modules/music-metadata/lib/ogg/OggParser.js +16 -12
- package/node_modules/music-metadata/lib/ogg/OggToken.js +1 -1
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +2 -2
- package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/opus/OpusStream.js +8 -4
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +2 -1
- package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +2 -2
- package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +1 -1
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +1 -1
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +3 -3
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +14 -9
- package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +4 -0
- package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +3 -1
- package/node_modules/music-metadata/lib/riff/RiffChunk.js +3 -2
- package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +1 -1
- package/node_modules/music-metadata/lib/type.d.ts +3 -3
- package/node_modules/music-metadata/lib/type.js +1 -1
- package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +1 -1
- package/node_modules/music-metadata/lib/wav/WaveChunk.js +3 -2
- package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +6 -2
- package/node_modules/music-metadata/lib/wav/WaveParser.js +75 -22
- package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +22 -13
- package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +3 -2
- package/node_modules/music-metadata/package.json +3 -2
- package/package.json +5 -5
|
@@ -18,8 +18,9 @@ export class Common {
|
|
|
18
18
|
constructor(header, isAifc) {
|
|
19
19
|
this.isAifc = isAifc;
|
|
20
20
|
const minimumChunkSize = isAifc ? 22 : 18;
|
|
21
|
-
if (header.chunkSize < minimumChunkSize)
|
|
21
|
+
if (header.chunkSize < minimumChunkSize) {
|
|
22
22
|
throw new AiffContentError(`COMMON CHUNK size should always be at least ${minimumChunkSize}`);
|
|
23
|
+
}
|
|
23
24
|
this.len = header.chunkSize;
|
|
24
25
|
}
|
|
25
26
|
get(buf, off) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { IRandomAccessTokenizer } from 'strtok3';
|
|
1
2
|
import * as strtok3 from 'strtok3';
|
|
2
|
-
import type { IOptions, IApeHeader } from '../type.js';
|
|
3
|
-
import type { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
4
3
|
import { BasicParser } from '../common/BasicParser.js';
|
|
4
|
+
import type { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
5
|
+
import type { IApeHeader, IOptions } from '../type.js';
|
|
5
6
|
import { type IFooter, type IHeader } from './APEv2Token.js';
|
|
6
|
-
import type { IRandomAccessTokenizer } from 'strtok3';
|
|
7
7
|
declare const ApeContentError_base: {
|
|
8
8
|
new (message: string): {
|
|
9
9
|
readonly fileType: string;
|
|
@@ -40,6 +40,7 @@ export declare class APEv2Parser extends BasicParser {
|
|
|
40
40
|
tryParseApeHeader(): Promise<void>;
|
|
41
41
|
parse(): Promise<void>;
|
|
42
42
|
parseTags(footer: IFooter): Promise<void>;
|
|
43
|
+
private readTagValue;
|
|
43
44
|
private parseDescriptorExpansion;
|
|
44
45
|
private parseHeader;
|
|
45
46
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { textDecode } from '@borewit/text-codec';
|
|
1
2
|
import initDebug from 'debug';
|
|
2
3
|
import * as strtok3 from 'strtok3';
|
|
3
4
|
import { StringType } from 'token-types';
|
|
4
|
-
import * as util from '../common/Util.js';
|
|
5
5
|
import { BasicParser } from '../common/BasicParser.js';
|
|
6
|
-
import
|
|
6
|
+
import * as util from '../common/Util.js';
|
|
7
7
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
8
|
-
import {
|
|
8
|
+
import { DataType, DescriptorParser, Header, TagFooter, TagItemHeader } from './APEv2Token.js';
|
|
9
9
|
const debug = initDebug('music-metadata:parser:APEv2');
|
|
10
10
|
const tagFormat = 'APEv2';
|
|
11
11
|
const preamble = 'APETAGEX';
|
|
@@ -61,8 +61,9 @@ export class APEv2Parser extends BasicParser {
|
|
|
61
61
|
}
|
|
62
62
|
static parseTagFooter(metadata, buffer, options) {
|
|
63
63
|
const footer = TagFooter.get(buffer, buffer.length - TagFooter.len);
|
|
64
|
-
if (footer.ID !== preamble)
|
|
64
|
+
if (footer.ID !== preamble) {
|
|
65
65
|
throw new ApeContentError('Unexpected APEv2 Footer ID preamble value');
|
|
66
|
+
}
|
|
66
67
|
strtok3.fromBuffer(buffer);
|
|
67
68
|
const apeParser = new APEv2Parser(metadata, strtok3.fromBuffer(buffer), options);
|
|
68
69
|
return apeParser.parseTags(footer);
|
|
@@ -72,7 +73,7 @@ export class APEv2Parser extends BasicParser {
|
|
|
72
73
|
*/
|
|
73
74
|
async tryParseApeHeader() {
|
|
74
75
|
if (this.tokenizer.fileInfo.size && this.tokenizer.fileInfo.size - this.tokenizer.position < TagFooter.len) {
|
|
75
|
-
debug(
|
|
76
|
+
debug('No APEv2 header found, end-of-file reached');
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
79
|
const footer = await this.tokenizer.peekToken(TagFooter);
|
|
@@ -91,8 +92,9 @@ export class APEv2Parser extends BasicParser {
|
|
|
91
92
|
}
|
|
92
93
|
async parse() {
|
|
93
94
|
const descriptor = await this.tokenizer.readToken(DescriptorParser);
|
|
94
|
-
if (descriptor.ID !== 'MAC ')
|
|
95
|
+
if (descriptor.ID !== 'MAC ') {
|
|
95
96
|
throw new ApeContentError('Unexpected descriptor ID');
|
|
97
|
+
}
|
|
96
98
|
this.ape.descriptor = descriptor;
|
|
97
99
|
const lenExp = descriptor.descriptorBytes - DescriptorParser.len;
|
|
98
100
|
const header = await (lenExp > 0 ? this.parseDescriptorExpansion(lenExp) : this.parseHeader());
|
|
@@ -111,15 +113,31 @@ export class APEv2Parser extends BasicParser {
|
|
|
111
113
|
}
|
|
112
114
|
// Only APEv2 tag has tag item headers
|
|
113
115
|
const tagItemHeader = await this.tokenizer.readToken(TagItemHeader);
|
|
114
|
-
bytesRemaining -= TagItemHeader.len
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
bytesRemaining -= TagItemHeader.len;
|
|
117
|
+
// Reserve the value bytes before looking for the key terminator.
|
|
118
|
+
if (tagItemHeader.size >= bytesRemaining) {
|
|
119
|
+
throw new ApeContentError(`Invalid tag item size: ${tagItemHeader.size}`);
|
|
120
|
+
}
|
|
121
|
+
const keyBytes = await this.tokenizer.peekBuffer(keyBuffer, {
|
|
122
|
+
length: Math.min(keyBuffer.length, bytesRemaining - tagItemHeader.size),
|
|
123
|
+
mayBeLess: true
|
|
124
|
+
});
|
|
125
|
+
let zero = keyBuffer.subarray(0, keyBytes).indexOf(0);
|
|
126
|
+
if (zero === -1) {
|
|
127
|
+
throw new ApeContentError('Unterminated tag item key');
|
|
128
|
+
}
|
|
117
129
|
const key = await this.tokenizer.readToken(new StringType(zero, 'ascii'));
|
|
118
130
|
await this.tokenizer.ignore(1);
|
|
119
131
|
bytesRemaining -= key.length + 1;
|
|
132
|
+
if (this.tokenizer.fileInfo.size !== undefined &&
|
|
133
|
+
tagItemHeader.size > this.tokenizer.fileInfo.size - this.tokenizer.position) {
|
|
134
|
+
throw new ApeContentError(`Invalid tag item size: ${tagItemHeader.size}`);
|
|
135
|
+
}
|
|
136
|
+
bytesRemaining -= tagItemHeader.size;
|
|
120
137
|
switch (tagItemHeader.flags.dataType) {
|
|
121
|
-
case DataType.text_utf8: {
|
|
122
|
-
|
|
138
|
+
case DataType.text_utf8: {
|
|
139
|
+
// utf-8 text-string
|
|
140
|
+
const value = textDecode(await this.readTagValue(tagItemHeader.size), 'utf-8');
|
|
123
141
|
const values = value.split(/\x00/g);
|
|
124
142
|
await Promise.all(values.map(val => this.metadata.addTag(tagFormat, key, val)));
|
|
125
143
|
break;
|
|
@@ -129,8 +147,7 @@ export class APEv2Parser extends BasicParser {
|
|
|
129
147
|
await this.tokenizer.ignore(tagItemHeader.size);
|
|
130
148
|
}
|
|
131
149
|
else {
|
|
132
|
-
const picData =
|
|
133
|
-
await this.tokenizer.readBuffer(picData);
|
|
150
|
+
const picData = await this.readTagValue(tagItemHeader.size);
|
|
134
151
|
zero = util.findZero(picData);
|
|
135
152
|
const description = textDecode(picData.subarray(0, zero), 'utf-8');
|
|
136
153
|
const data = picData.subarray(zero + 1);
|
|
@@ -152,6 +169,30 @@ export class APEv2Parser extends BasicParser {
|
|
|
152
169
|
}
|
|
153
170
|
}
|
|
154
171
|
}
|
|
172
|
+
async readTagValue(size) {
|
|
173
|
+
const chunkSize = 64 * 1024;
|
|
174
|
+
if ((!this.tokenizer.supportsRandomAccess() || this.tokenizer.fileInfo.size === undefined) && size > chunkSize) {
|
|
175
|
+
// Stream sizes may be unknown or untrustworthy. Only allocate the full
|
|
176
|
+
// value after all of its bytes have actually been read.
|
|
177
|
+
const chunks = [];
|
|
178
|
+
for (let remaining = size; remaining > 0;) {
|
|
179
|
+
const chunk = new Uint8Array(Math.min(remaining, chunkSize));
|
|
180
|
+
await this.tokenizer.readBuffer(chunk);
|
|
181
|
+
chunks.push(chunk);
|
|
182
|
+
remaining -= chunk.length;
|
|
183
|
+
}
|
|
184
|
+
const value = new Uint8Array(size);
|
|
185
|
+
let offset = 0;
|
|
186
|
+
for (const chunk of chunks) {
|
|
187
|
+
value.set(chunk, offset);
|
|
188
|
+
offset += chunk.length;
|
|
189
|
+
}
|
|
190
|
+
return value;
|
|
191
|
+
}
|
|
192
|
+
const value = new Uint8Array(size);
|
|
193
|
+
await this.tokenizer.readBuffer(value);
|
|
194
|
+
return value;
|
|
195
|
+
}
|
|
155
196
|
async parseDescriptorExpansion(lenExp) {
|
|
156
197
|
await this.tokenizer.ignore(lenExp);
|
|
157
198
|
return this.parseHeader();
|
|
@@ -160,7 +201,7 @@ export class APEv2Parser extends BasicParser {
|
|
|
160
201
|
const header = await this.tokenizer.readToken(Header);
|
|
161
202
|
// ToDo before
|
|
162
203
|
this.metadata.setFormat('lossless', true);
|
|
163
|
-
this.metadata.setFormat('container',
|
|
204
|
+
this.metadata.setFormat('container', "Monkey's Audio");
|
|
164
205
|
this.metadata.setFormat('bitsPerSample', header.bitsPerSample);
|
|
165
206
|
this.metadata.setFormat('sampleRate', header.sampleRate);
|
|
166
207
|
this.metadata.setFormat('numberOfChannels', header.channel);
|
|
@@ -169,8 +210,10 @@ export class APEv2Parser extends BasicParser {
|
|
|
169
210
|
throw new ApeContentError('Missing APE descriptor');
|
|
170
211
|
}
|
|
171
212
|
return {
|
|
172
|
-
forwardBytes: this.ape.descriptor.seekTableBytes +
|
|
173
|
-
this.ape.descriptor.
|
|
213
|
+
forwardBytes: this.ape.descriptor.seekTableBytes +
|
|
214
|
+
this.ape.descriptor.headerDataBytes +
|
|
215
|
+
this.ape.descriptor.apeFrameDataBytes +
|
|
216
|
+
this.ape.descriptor.terminatingDataBytes
|
|
174
217
|
};
|
|
175
218
|
}
|
|
176
219
|
}
|
|
@@ -58,7 +58,7 @@ export declare const DataType: {
|
|
|
58
58
|
external_info: number;
|
|
59
59
|
reserved: number;
|
|
60
60
|
};
|
|
61
|
-
export type DataType = typeof DataType[keyof typeof DataType];
|
|
61
|
+
export type DataType = (typeof DataType)[keyof typeof DataType];
|
|
62
62
|
/**
|
|
63
63
|
* APE_DESCRIPTOR: defines the sizes (and offsets) of all the pieces, as well as the MD5 checksum
|
|
64
64
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Guid, parseWindowsGuid } from 'win-guid';
|
|
2
2
|
/**
|
|
3
3
|
* Ref:
|
|
4
4
|
* - https://tools.ietf.org/html/draft-fleischman-asf-01, Appendix A: ASF GUIDs
|
|
@@ -33,12 +33,18 @@ class AsfGuid {
|
|
|
33
33
|
*/
|
|
34
34
|
static decodeMediaType(mediaType) {
|
|
35
35
|
switch (mediaType.str) {
|
|
36
|
-
case AsfGuid.AudioMedia.str:
|
|
37
|
-
|
|
38
|
-
case AsfGuid.
|
|
39
|
-
|
|
40
|
-
case AsfGuid.
|
|
41
|
-
|
|
36
|
+
case AsfGuid.AudioMedia.str:
|
|
37
|
+
return 'audio';
|
|
38
|
+
case AsfGuid.VideoMedia.str:
|
|
39
|
+
return 'video';
|
|
40
|
+
case AsfGuid.CommandMedia.str:
|
|
41
|
+
return 'command';
|
|
42
|
+
case AsfGuid.Degradable_JPEG_Media.str:
|
|
43
|
+
return 'degradable-jpeg';
|
|
44
|
+
case AsfGuid.FileTransferMedia.str:
|
|
45
|
+
return 'file-transfer';
|
|
46
|
+
case AsfGuid.BinaryMedia.str:
|
|
47
|
+
return 'binary';
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
@@ -60,50 +66,50 @@ class AsfGuid {
|
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
// 10.1 Top-level ASF object GUIDs
|
|
63
|
-
AsfGuid.HeaderObject = new AsfGuid(
|
|
64
|
-
AsfGuid.DataObject = new AsfGuid(
|
|
65
|
-
AsfGuid.SimpleIndexObject = new AsfGuid(
|
|
66
|
-
AsfGuid.IndexObject = new AsfGuid(
|
|
67
|
-
AsfGuid.MediaObjectIndexObject = new AsfGuid(
|
|
68
|
-
AsfGuid.TimecodeIndexObject = new AsfGuid(
|
|
69
|
+
AsfGuid.HeaderObject = new AsfGuid('75B22630-668E-11CF-A6D9-00AA0062CE6C');
|
|
70
|
+
AsfGuid.DataObject = new AsfGuid('75B22636-668E-11CF-A6D9-00AA0062CE6C');
|
|
71
|
+
AsfGuid.SimpleIndexObject = new AsfGuid('33000890-E5B1-11CF-89F4-00A0C90349CB');
|
|
72
|
+
AsfGuid.IndexObject = new AsfGuid('D6E229D3-35DA-11D1-9034-00A0C90349BE');
|
|
73
|
+
AsfGuid.MediaObjectIndexObject = new AsfGuid('FEB103F8-12AD-4C64-840F-2A1D2F7AD48C');
|
|
74
|
+
AsfGuid.TimecodeIndexObject = new AsfGuid('3CB73FD0-0C4A-4803-953D-EDF7B6228F0C');
|
|
69
75
|
// 10.2 Header Object GUIDs
|
|
70
|
-
AsfGuid.FilePropertiesObject = new AsfGuid(
|
|
71
|
-
AsfGuid.StreamPropertiesObject = new AsfGuid(
|
|
72
|
-
AsfGuid.HeaderExtensionObject = new AsfGuid(
|
|
73
|
-
AsfGuid.CodecListObject = new AsfGuid(
|
|
74
|
-
AsfGuid.ScriptCommandObject = new AsfGuid(
|
|
75
|
-
AsfGuid.MarkerObject = new AsfGuid(
|
|
76
|
-
AsfGuid.BitrateMutualExclusionObject = new AsfGuid(
|
|
77
|
-
AsfGuid.ErrorCorrectionObject = new AsfGuid(
|
|
78
|
-
AsfGuid.ContentDescriptionObject = new AsfGuid(
|
|
79
|
-
AsfGuid.ExtendedContentDescriptionObject = new AsfGuid(
|
|
80
|
-
AsfGuid.ContentBrandingObject = new AsfGuid(
|
|
81
|
-
AsfGuid.StreamBitratePropertiesObject = new AsfGuid(
|
|
82
|
-
AsfGuid.ContentEncryptionObject = new AsfGuid(
|
|
83
|
-
AsfGuid.ExtendedContentEncryptionObject = new AsfGuid(
|
|
84
|
-
AsfGuid.DigitalSignatureObject = new AsfGuid(
|
|
85
|
-
AsfGuid.PaddingObject = new AsfGuid(
|
|
76
|
+
AsfGuid.FilePropertiesObject = new AsfGuid('8CABDCA1-A947-11CF-8EE4-00C00C205365');
|
|
77
|
+
AsfGuid.StreamPropertiesObject = new AsfGuid('B7DC0791-A9B7-11CF-8EE6-00C00C205365');
|
|
78
|
+
AsfGuid.HeaderExtensionObject = new AsfGuid('5FBF03B5-A92E-11CF-8EE3-00C00C205365');
|
|
79
|
+
AsfGuid.CodecListObject = new AsfGuid('86D15240-311D-11D0-A3A4-00A0C90348F6');
|
|
80
|
+
AsfGuid.ScriptCommandObject = new AsfGuid('1EFB1A30-0B62-11D0-A39B-00A0C90348F6');
|
|
81
|
+
AsfGuid.MarkerObject = new AsfGuid('F487CD01-A951-11CF-8EE6-00C00C205365');
|
|
82
|
+
AsfGuid.BitrateMutualExclusionObject = new AsfGuid('D6E229DC-35DA-11D1-9034-00A0C90349BE');
|
|
83
|
+
AsfGuid.ErrorCorrectionObject = new AsfGuid('75B22635-668E-11CF-A6D9-00AA0062CE6C');
|
|
84
|
+
AsfGuid.ContentDescriptionObject = new AsfGuid('75B22633-668E-11CF-A6D9-00AA0062CE6C');
|
|
85
|
+
AsfGuid.ExtendedContentDescriptionObject = new AsfGuid('D2D0A440-E307-11D2-97F0-00A0C95EA850');
|
|
86
|
+
AsfGuid.ContentBrandingObject = new AsfGuid('2211B3FA-BD23-11D2-B4B7-00A0C955FC6E');
|
|
87
|
+
AsfGuid.StreamBitratePropertiesObject = new AsfGuid('7BF875CE-468D-11D1-8D82-006097C9A2B2');
|
|
88
|
+
AsfGuid.ContentEncryptionObject = new AsfGuid('2211B3FB-BD23-11D2-B4B7-00A0C955FC6E');
|
|
89
|
+
AsfGuid.ExtendedContentEncryptionObject = new AsfGuid('298AE614-2622-4C17-B935-DAE07EE9289C');
|
|
90
|
+
AsfGuid.DigitalSignatureObject = new AsfGuid('2211B3FC-BD23-11D2-B4B7-00A0C955FC6E');
|
|
91
|
+
AsfGuid.PaddingObject = new AsfGuid('1806D474-CADF-4509-A4BA-9AABCB96AAE8');
|
|
86
92
|
// 10.3 Header Extension Object GUIDs
|
|
87
|
-
AsfGuid.ExtendedStreamPropertiesObject = new AsfGuid(
|
|
88
|
-
AsfGuid.AdvancedMutualExclusionObject = new AsfGuid(
|
|
89
|
-
AsfGuid.GroupMutualExclusionObject = new AsfGuid(
|
|
90
|
-
AsfGuid.StreamPrioritizationObject = new AsfGuid(
|
|
91
|
-
AsfGuid.BandwidthSharingObject = new AsfGuid(
|
|
92
|
-
AsfGuid.LanguageListObject = new AsfGuid(
|
|
93
|
-
AsfGuid.MetadataObject = new AsfGuid(
|
|
94
|
-
AsfGuid.MetadataLibraryObject = new AsfGuid(
|
|
95
|
-
AsfGuid.IndexParametersObject = new AsfGuid(
|
|
96
|
-
AsfGuid.MediaObjectIndexParametersObject = new AsfGuid(
|
|
97
|
-
AsfGuid.TimecodeIndexParametersObject = new AsfGuid(
|
|
98
|
-
AsfGuid.CompatibilityObject = new AsfGuid(
|
|
99
|
-
AsfGuid.AdvancedContentEncryptionObject = new AsfGuid(
|
|
93
|
+
AsfGuid.ExtendedStreamPropertiesObject = new AsfGuid('14E6A5CB-C672-4332-8399-A96952065B5A');
|
|
94
|
+
AsfGuid.AdvancedMutualExclusionObject = new AsfGuid('A08649CF-4775-4670-8A16-6E35357566CD');
|
|
95
|
+
AsfGuid.GroupMutualExclusionObject = new AsfGuid('D1465A40-5A79-4338-B71B-E36B8FD6C249');
|
|
96
|
+
AsfGuid.StreamPrioritizationObject = new AsfGuid('D4FED15B-88D3-454F-81F0-ED5C45999E24');
|
|
97
|
+
AsfGuid.BandwidthSharingObject = new AsfGuid('A69609E6-517B-11D2-B6AF-00C04FD908E9');
|
|
98
|
+
AsfGuid.LanguageListObject = new AsfGuid('7C4346A9-EFE0-4BFC-B229-393EDE415C85');
|
|
99
|
+
AsfGuid.MetadataObject = new AsfGuid('C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA');
|
|
100
|
+
AsfGuid.MetadataLibraryObject = new AsfGuid('44231C94-9498-49D1-A141-1D134E457054');
|
|
101
|
+
AsfGuid.IndexParametersObject = new AsfGuid('D6E229DF-35DA-11D1-9034-00A0C90349BE');
|
|
102
|
+
AsfGuid.MediaObjectIndexParametersObject = new AsfGuid('6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7');
|
|
103
|
+
AsfGuid.TimecodeIndexParametersObject = new AsfGuid('F55E496D-9797-4B5D-8C8B-604DFE9BFB24');
|
|
104
|
+
AsfGuid.CompatibilityObject = new AsfGuid('26F18B5D-4584-47EC-9F5F-0E651F0452C9');
|
|
105
|
+
AsfGuid.AdvancedContentEncryptionObject = new AsfGuid('43058533-6981-49E6-9B74-AD12CB86D58C');
|
|
100
106
|
// 10.4 Stream Properties Object Stream Type GUIDs
|
|
101
|
-
AsfGuid.AudioMedia = new AsfGuid(
|
|
102
|
-
AsfGuid.VideoMedia = new AsfGuid(
|
|
103
|
-
AsfGuid.CommandMedia = new AsfGuid(
|
|
104
|
-
AsfGuid.JFIF_Media = new AsfGuid(
|
|
105
|
-
AsfGuid.Degradable_JPEG_Media = new AsfGuid(
|
|
106
|
-
AsfGuid.FileTransferMedia = new AsfGuid(
|
|
107
|
-
AsfGuid.BinaryMedia = new AsfGuid(
|
|
108
|
-
AsfGuid.ASF_Index_Placeholder_Object = new AsfGuid(
|
|
107
|
+
AsfGuid.AudioMedia = new AsfGuid('F8699E40-5B4D-11CF-A8FD-00805F5C442B');
|
|
108
|
+
AsfGuid.VideoMedia = new AsfGuid('BC19EFC0-5B4D-11CF-A8FD-00805F5C442B');
|
|
109
|
+
AsfGuid.CommandMedia = new AsfGuid('59DACFC0-59E6-11D0-A3AC-00A0C90348F6');
|
|
110
|
+
AsfGuid.JFIF_Media = new AsfGuid('B61BE100-5B4E-11CF-A8FD-00805F5C442B');
|
|
111
|
+
AsfGuid.Degradable_JPEG_Media = new AsfGuid('35907DE0-E415-11CF-A917-00805F5C442B');
|
|
112
|
+
AsfGuid.FileTransferMedia = new AsfGuid('91BD222C-F21C-497A-8B6D-5AA86BFC0185');
|
|
113
|
+
AsfGuid.BinaryMedia = new AsfGuid('3AFB65E2-47EF-40F2-AC2C-70A90D71D343');
|
|
114
|
+
AsfGuid.ASF_Index_Placeholder_Object = new AsfGuid('D9AADE20-7C17-4F9C-BC28-8555DD98E2A2');
|
|
109
115
|
export default AsfGuid;
|
|
@@ -44,7 +44,7 @@ export declare const DataType: {
|
|
|
44
44
|
*/
|
|
45
45
|
Word: number;
|
|
46
46
|
};
|
|
47
|
-
export type DataType = typeof DataType[keyof typeof DataType];
|
|
47
|
+
export type DataType = (typeof DataType)[keyof typeof DataType];
|
|
48
48
|
/**
|
|
49
49
|
* Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575
|
|
50
50
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// ASF Objects
|
|
2
2
|
import * as Token from 'token-types';
|
|
3
3
|
import * as util from '../common/Util.js';
|
|
4
|
-
import AsfGuid from './AsfGuid.js';
|
|
5
|
-
import { getParserForAttr, parseUnicodeAttr } from './AsfUtil.js';
|
|
6
4
|
import { AttachedPictureType } from '../id3v2/ID3v2Token.js';
|
|
7
5
|
import { makeUnexpectedFileContentError } from '../ParseError.js';
|
|
6
|
+
import AsfGuid from './AsfGuid.js';
|
|
7
|
+
import { getParserForAttr, parseUnicodeAttr } from './AsfUtil.js';
|
|
8
8
|
export class AsfContentParseError extends makeUnexpectedFileContentError('ASF') {
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
@@ -300,6 +300,7 @@ export class ExtendedStreamPropertiesObjectState extends State {
|
|
|
300
300
|
alternateInitialBufferFullness: view.getInt32(32, true),
|
|
301
301
|
maximumObjectSize: view.getInt32(36, true),
|
|
302
302
|
flags: {
|
|
303
|
+
// ToDo, check flag positions
|
|
303
304
|
reliableFlag: util.getBit(buf, off + 40, 0),
|
|
304
305
|
seekableFlag: util.getBit(buf, off + 40, 1),
|
|
305
306
|
resendLiveCleanpointsFlag: util.getBit(buf, off + 40, 2)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import initDebug from 'debug';
|
|
2
2
|
import { EndOfStreamError } from 'strtok3';
|
|
3
|
+
import { BasicParser } from '../common/BasicParser.js';
|
|
3
4
|
import { TrackType } from '../type.js';
|
|
4
5
|
import AsfGuid from './AsfGuid.js';
|
|
5
6
|
import * as AsfObject from './AsfObject.js';
|
|
6
|
-
import { BasicParser } from '../common/BasicParser.js';
|
|
7
7
|
import { AsfContentParseError } from './AsfObject.js';
|
|
8
8
|
const debug = initDebug('music-metadata:parser:ASF');
|
|
9
9
|
const headerType = 'asf';
|
|
@@ -36,20 +36,23 @@ export class AsfParser extends BasicParser {
|
|
|
36
36
|
// Parse data part of the ASF Object
|
|
37
37
|
debug('header GUID=%s', header.objectId.str);
|
|
38
38
|
switch (header.objectId.str) {
|
|
39
|
-
case AsfObject.FilePropertiesObject.guid.str: {
|
|
39
|
+
case AsfObject.FilePropertiesObject.guid.str: {
|
|
40
|
+
// 3.2
|
|
40
41
|
this.validateAllocationSize(payloadSize, 'File Properties Object');
|
|
41
42
|
const fpo = await this.tokenizer.readToken(new AsfObject.FilePropertiesObject(header));
|
|
42
43
|
this.metadata.setFormat('duration', Number(fpo.playDuration / BigInt(1000)) / 10000 - Number(fpo.preroll) / 1000);
|
|
43
44
|
this.metadata.setFormat('bitrate', fpo.maximumBitrate);
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
46
|
-
case AsfObject.StreamPropertiesObject.guid.str: {
|
|
47
|
+
case AsfObject.StreamPropertiesObject.guid.str: {
|
|
48
|
+
// 3.3
|
|
47
49
|
this.validateAllocationSize(payloadSize, 'Stream Properties Object');
|
|
48
50
|
const spo = await this.tokenizer.readToken(new AsfObject.StreamPropertiesObject(header));
|
|
49
51
|
this.metadata.setFormat('container', `ASF/${spo.streamType}`);
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
|
-
case AsfObject.HeaderExtensionObject.guid.str: {
|
|
54
|
+
case AsfObject.HeaderExtensionObject.guid.str: {
|
|
55
|
+
// 3.4
|
|
53
56
|
const extensionHeaderToken = new AsfObject.HeaderExtensionObject();
|
|
54
57
|
if (payloadSize < extensionHeaderToken.len) {
|
|
55
58
|
throw new AsfContentParseError(`ASF Header Extension Object payload is too small: ${payloadSize} bytes`);
|
|
@@ -88,7 +91,10 @@ export class AsfParser extends BasicParser {
|
|
|
88
91
|
codecName: codec.codecName
|
|
89
92
|
});
|
|
90
93
|
});
|
|
91
|
-
const audioCodecs = codecs
|
|
94
|
+
const audioCodecs = codecs
|
|
95
|
+
.filter(codec => codec.type.audioCodec)
|
|
96
|
+
.map(codec => codec.codecName)
|
|
97
|
+
.join('/');
|
|
92
98
|
this.metadata.setFormat('codec', audioCodecs);
|
|
93
99
|
break;
|
|
94
100
|
}
|
|
@@ -169,13 +175,15 @@ export class AsfParser extends BasicParser {
|
|
|
169
175
|
this.validateAllocationSize(payloadSize, 'Extended Stream Properties Object');
|
|
170
176
|
await this.tokenizer.readToken(new AsfObject.ExtendedStreamPropertiesObjectState(header));
|
|
171
177
|
break;
|
|
172
|
-
case AsfObject.MetadataObjectState.guid.str: {
|
|
178
|
+
case AsfObject.MetadataObjectState.guid.str: {
|
|
179
|
+
// 4.7
|
|
173
180
|
this.validateAllocationSize(payloadSize, 'Metadata Object');
|
|
174
181
|
const moTags = await this.tokenizer.readToken(new AsfObject.MetadataObjectState(header));
|
|
175
182
|
await this.addTags(moTags);
|
|
176
183
|
break;
|
|
177
184
|
}
|
|
178
|
-
case AsfObject.MetadataLibraryObjectState.guid.str: {
|
|
185
|
+
case AsfObject.MetadataLibraryObjectState.guid.str: {
|
|
186
|
+
// 4.8
|
|
179
187
|
this.validateAllocationSize(payloadSize, 'Metadata Library Object');
|
|
180
188
|
const mlTags = await this.tokenizer.readToken(new AsfObject.MetadataLibraryObjectState(header));
|
|
181
189
|
await this.addTags(mlTags);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CommonTagMapper } from '../common/GenericTagMapper.js';
|
|
2
|
+
import type { IWarningCollector } from '../common/MetadataCollector.js';
|
|
2
3
|
import type { IRating, ITag } from '../type.js';
|
|
3
4
|
export declare class AsfTagMapper extends CommonTagMapper {
|
|
4
|
-
static toRating(rating: string): IRating;
|
|
5
|
+
static toRating(rating: string | number): IRating;
|
|
5
6
|
constructor();
|
|
6
|
-
protected postMap(tag: ITag): void;
|
|
7
|
+
protected postMap(tag: ITag, warnings: IWarningCollector): void;
|
|
7
8
|
}
|
|
@@ -36,6 +36,7 @@ const asfTagMap = {
|
|
|
36
36
|
// 'WM/PartOfSet': 'totaldiscs',
|
|
37
37
|
'WM/IsCompilation': 'compilation',
|
|
38
38
|
'WM/SharedUserRating': 'rating',
|
|
39
|
+
POPULARIMETER: 'rating',
|
|
39
40
|
'WM/BeatsPerMinute': 'bpm',
|
|
40
41
|
'WM/Mood': 'mood',
|
|
41
42
|
'WM/Media': 'media',
|
|
@@ -72,15 +73,31 @@ const asfTagMap = {
|
|
|
72
73
|
};
|
|
73
74
|
export class AsfTagMapper extends CommonTagMapper {
|
|
74
75
|
static toRating(rating) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
const value = typeof rating === 'number' ? rating : Number.parseFloat(rating);
|
|
77
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
78
|
+
return { rating: undefined };
|
|
79
|
+
}
|
|
80
|
+
return { rating: value / 99 };
|
|
78
81
|
}
|
|
79
82
|
constructor() {
|
|
80
83
|
super(['asf'], asfTagMap);
|
|
81
84
|
}
|
|
82
|
-
postMap(tag) {
|
|
85
|
+
postMap(tag, warnings) {
|
|
83
86
|
switch (tag.id) {
|
|
87
|
+
case 'POPULARIMETER': {
|
|
88
|
+
// popm-style attribute, written by e.g. foobar2000; value is "email|rating|counter"
|
|
89
|
+
const [email, rating] = tag.value.split('|');
|
|
90
|
+
const value = Number(rating);
|
|
91
|
+
const valid = /^\d+$/.test(rating) && Number.isInteger(value) && value >= 0 && value <= 255;
|
|
92
|
+
if (!valid) {
|
|
93
|
+
warnings.addWarning(`Invalid ASF POPULARIMETER rating: ${rating}`);
|
|
94
|
+
}
|
|
95
|
+
tag.value = {
|
|
96
|
+
source: email,
|
|
97
|
+
rating: valid && value > 0 ? ((value - 1) / 254) * CommonTagMapper.maxRatingScore : undefined
|
|
98
|
+
};
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
84
101
|
case 'WM/SharedUserRating': {
|
|
85
102
|
const keys = tag.id.split(':');
|
|
86
103
|
tag.value = AsfTagMapper.toRating(tag.value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { INativeTagMap, TagType } from './GenericTagTypes.js';
|
|
2
1
|
import { CommonTagMapper } from './GenericTagMapper.js';
|
|
2
|
+
import type { INativeTagMap, TagType } from './GenericTagTypes.js';
|
|
3
3
|
export declare class CaseInsensitiveTagMap extends CommonTagMapper {
|
|
4
4
|
constructor(tagTypes: TagType[], tagMap: INativeTagMap);
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IGenericTag, TagType } from './GenericTagTypes.js';
|
|
2
|
-
import type { IGenericTagMapper } from './GenericTagMapper.js';
|
|
3
1
|
import type { ITag } from '../type.js';
|
|
2
|
+
import type { IGenericTagMapper } from './GenericTagMapper.js';
|
|
3
|
+
import type { IGenericTag, TagType } from './GenericTagTypes.js';
|
|
4
4
|
import type { INativeMetadataCollector } from './MetadataCollector.js';
|
|
5
5
|
export declare class CombinedTagMapper {
|
|
6
6
|
tagMappers: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AiffTagMapper } from '../aiff/AiffTagMap.js';
|
|
2
|
+
import { APEv2TagMapper } from '../apev2/APEv2TagMapper.js';
|
|
3
3
|
import { AsfTagMapper } from '../asf/AsfTagMapper.js';
|
|
4
|
+
import { ID3v1TagMapper } from '../id3v1/ID3v1TagMap.js';
|
|
4
5
|
import { ID3v22TagMapper } from '../id3v2/ID3v22TagMapper.js';
|
|
5
|
-
import {
|
|
6
|
+
import { ID3v24TagMapper } from '../id3v2/ID3v24TagMapper.js';
|
|
7
|
+
import { MatroskaTagMapper } from '../matroska/MatroskaTagMapper.js';
|
|
6
8
|
import { MP4TagMapper } from '../mp4/MP4TagMapper.js';
|
|
7
9
|
import { VorbisTagMapper } from '../ogg/vorbis/VorbisTagMapper.js';
|
|
8
|
-
import { RiffInfoTagMapper } from '../riff/RiffInfoTagMap.js';
|
|
9
|
-
import { MatroskaTagMapper } from '../matroska/MatroskaTagMapper.js';
|
|
10
|
-
import { AiffTagMapper } from '../aiff/AiffTagMap.js';
|
|
11
10
|
import { InternalParserError } from '../ParseError.js';
|
|
11
|
+
import { RiffInfoTagMapper } from '../riff/RiffInfoTagMap.js';
|
|
12
12
|
export class CombinedTagMapper {
|
|
13
13
|
constructor() {
|
|
14
14
|
this.tagMappers = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { textDecode, textEncode } from '@borewit/text-codec';
|
|
2
|
+
import { FieldDecodingError, InternalParserError } from '../ParseError.js';
|
|
2
3
|
import * as util from './Util.js';
|
|
3
|
-
import { InternalParserError, FieldDecodingError } from '../ParseError.js';
|
|
4
4
|
const validFourCC = /^[\x21-\x7e©][\x20-\x7e\x00()]{3}/;
|
|
5
5
|
/**
|
|
6
6
|
* Token for read FourCC
|
|
@@ -17,8 +17,9 @@ export const FourCcToken = {
|
|
|
17
17
|
},
|
|
18
18
|
put: (buffer, offset, id) => {
|
|
19
19
|
const str = textEncode(id, 'latin1');
|
|
20
|
-
if (str.length !== 4)
|
|
20
|
+
if (str.length !== 4) {
|
|
21
21
|
throw new InternalParserError('Invalid length');
|
|
22
|
+
}
|
|
22
23
|
buffer.set(str, offset);
|
|
23
24
|
return offset + 4;
|
|
24
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type * as generic from './GenericTagTypes.js';
|
|
2
1
|
import type { ITag } from '../type.js';
|
|
2
|
+
import type * as generic from './GenericTagTypes.js';
|
|
3
3
|
import type { INativeMetadataCollector, IWarningCollector } from './MetadataCollector.js';
|
|
4
4
|
export interface IGenericTagMapper {
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FormatId, type IAudioMetadata, type ICommonTagsResult, type IFormat, type INativeTags, type IOptions, type IQualityInformation, type ITrackInfo
|
|
1
|
+
import { type AnyTagValue, type FormatId, type IAudioMetadata, type ICommonTagsResult, type IFormat, type INativeTags, type IOptions, type IQualityInformation, type ITrackInfo } from '../type.js';
|
|
2
2
|
import { type IGenericTag, type TagType } from './GenericTagTypes.js';
|
|
3
3
|
/**
|
|
4
4
|
* Combines all generic-tag-mappers for each tag type
|
|
@@ -22,6 +22,7 @@ export interface INativeMetadataCollector extends IWarningCollector {
|
|
|
22
22
|
*/
|
|
23
23
|
hasAny(): boolean;
|
|
24
24
|
setFormat(key: FormatId, value: AnyTagValue): void;
|
|
25
|
+
registerTagType(tagType: TagType): void;
|
|
25
26
|
addTag(tagType: TagType, tagId: string, value: AnyTagValue): Promise<void>;
|
|
26
27
|
addStreamInfo(streamInfo: ITrackInfo): void;
|
|
27
28
|
setAudioOnly(): void;
|
|
@@ -53,6 +54,7 @@ export declare class MetadataCollector implements INativeMetadataCollector {
|
|
|
53
54
|
addStreamInfo(streamInfo: ITrackInfo): void;
|
|
54
55
|
setFormat(key: FormatId, value: AnyTagValue): void;
|
|
55
56
|
setAudioOnly(): void;
|
|
57
|
+
registerTagType(tagType: TagType): void;
|
|
56
58
|
addTag(tagType: TagType, tagId: string, value: AnyTagValue): Promise<void>;
|
|
57
59
|
addWarning(warning: string): void;
|
|
58
60
|
postMap(tagType: TagType | 'artificial', tag: IGenericTag): Promise<void>;
|