music-metadata 7.11.7 → 7.11.8

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.
Files changed (152) hide show
  1. package/README.md +433 -432
  2. package/lib/ParserFactory.d.ts +48 -49
  3. package/lib/ParserFactory.js +251 -251
  4. package/lib/aiff/AiffParser.d.ts +14 -15
  5. package/lib/aiff/AiffParser.js +84 -85
  6. package/lib/aiff/AiffToken.d.ts +22 -22
  7. package/lib/aiff/AiffToken.js +43 -43
  8. package/lib/apev2/APEv2Parser.d.ts +30 -30
  9. package/lib/apev2/APEv2Parser.js +161 -162
  10. package/lib/apev2/APEv2TagMapper.d.ts +4 -4
  11. package/lib/apev2/APEv2TagMapper.js +86 -86
  12. package/lib/apev2/APEv2Token.d.ts +100 -100
  13. package/lib/apev2/APEv2Token.js +126 -126
  14. package/lib/asf/AsfObject.d.ts +319 -319
  15. package/lib/asf/AsfObject.js +384 -384
  16. package/lib/asf/AsfParser.d.ts +17 -17
  17. package/lib/asf/AsfParser.js +135 -135
  18. package/lib/asf/AsfTagMapper.d.ts +7 -7
  19. package/lib/asf/AsfTagMapper.js +95 -95
  20. package/lib/asf/AsfUtil.d.ts +13 -13
  21. package/lib/asf/AsfUtil.js +40 -40
  22. package/lib/asf/GUID.d.ts +84 -86
  23. package/lib/asf/GUID.js +121 -123
  24. package/lib/common/BasicParser.d.ts +17 -17
  25. package/lib/common/BasicParser.js +18 -18
  26. package/lib/common/CaseInsensitiveTagMap.d.ts +10 -10
  27. package/lib/common/CaseInsensitiveTagMap.js +21 -21
  28. package/lib/common/CombinedTagMapper.d.ts +19 -19
  29. package/lib/common/CombinedTagMapper.js +51 -51
  30. package/lib/common/FourCC.d.ts +6 -6
  31. package/lib/common/FourCC.js +28 -28
  32. package/lib/common/GenericTagMapper.d.ts +51 -51
  33. package/lib/common/GenericTagMapper.js +55 -55
  34. package/lib/common/GenericTagTypes.d.ts +33 -33
  35. package/lib/common/GenericTagTypes.js +131 -131
  36. package/lib/common/MetadataCollector.d.ts +76 -76
  37. package/lib/common/MetadataCollector.js +275 -275
  38. package/lib/common/RandomFileReader.d.ts +20 -20
  39. package/lib/common/RandomFileReader.js +37 -37
  40. package/lib/common/RandomUint8ArrayReader.d.ts +18 -18
  41. package/lib/common/RandomUint8ArrayReader.js +25 -25
  42. package/lib/common/Util.d.ts +58 -58
  43. package/lib/common/Util.js +157 -162
  44. package/lib/core.d.ts +48 -48
  45. package/lib/core.js +90 -90
  46. package/lib/dsdiff/DsdiffParser.d.ts +14 -14
  47. package/lib/dsdiff/DsdiffParser.js +143 -143
  48. package/lib/dsdiff/DsdiffToken.d.ts +9 -9
  49. package/lib/dsdiff/DsdiffToken.js +21 -21
  50. package/lib/dsf/DsfChunk.d.ts +86 -86
  51. package/lib/dsf/DsfChunk.js +54 -54
  52. package/lib/dsf/DsfParser.d.ts +9 -9
  53. package/lib/dsf/DsfParser.js +56 -56
  54. package/lib/flac/FlacParser.d.ts +28 -28
  55. package/lib/flac/FlacParser.js +175 -175
  56. package/lib/id3v1/ID3v1Parser.d.ts +13 -13
  57. package/lib/id3v1/ID3v1Parser.js +134 -134
  58. package/lib/id3v1/ID3v1TagMap.d.ts +4 -4
  59. package/lib/id3v1/ID3v1TagMap.js +22 -22
  60. package/lib/id3v2/AbstractID3Parser.d.ts +17 -17
  61. package/lib/id3v2/AbstractID3Parser.js +60 -60
  62. package/lib/id3v2/FrameParser.d.ts +32 -32
  63. package/lib/id3v2/FrameParser.js +329 -329
  64. package/lib/id3v2/ID3v22TagMapper.d.ts +9 -9
  65. package/lib/id3v2/ID3v22TagMapper.js +55 -55
  66. package/lib/id3v2/ID3v24TagMapper.d.ts +14 -14
  67. package/lib/id3v2/ID3v24TagMapper.js +193 -193
  68. package/lib/id3v2/ID3v2Parser.d.ts +29 -29
  69. package/lib/id3v2/ID3v2Parser.js +184 -194
  70. package/lib/id3v2/ID3v2Token.d.ts +73 -73
  71. package/lib/id3v2/ID3v2Token.js +106 -106
  72. package/lib/iff/index.d.ts +33 -33
  73. package/lib/iff/index.js +19 -19
  74. package/lib/index.d.ts +45 -45
  75. package/lib/index.js +74 -74
  76. package/lib/lyrics3/Lyrics3.d.ts +3 -3
  77. package/lib/lyrics3/Lyrics3.js +17 -17
  78. package/lib/matroska/MatroskaDtd.d.ts +8 -8
  79. package/lib/matroska/MatroskaDtd.js +279 -279
  80. package/lib/matroska/MatroskaParser.d.ts +37 -37
  81. package/lib/matroska/MatroskaParser.js +235 -235
  82. package/lib/matroska/MatroskaTagMapper.d.ts +4 -4
  83. package/lib/matroska/MatroskaTagMapper.js +35 -35
  84. package/lib/matroska/types.d.ts +175 -175
  85. package/lib/matroska/types.js +33 -32
  86. package/lib/mp4/Atom.d.ts +16 -16
  87. package/lib/mp4/Atom.js +70 -70
  88. package/lib/mp4/AtomToken.d.ts +395 -395
  89. package/lib/mp4/AtomToken.js +406 -406
  90. package/lib/mp4/MP4Parser.d.ts +30 -30
  91. package/lib/mp4/MP4Parser.js +511 -511
  92. package/lib/mp4/MP4TagMapper.d.ts +5 -5
  93. package/lib/mp4/MP4TagMapper.js +115 -115
  94. package/lib/mpeg/ExtendedLameHeader.d.ts +27 -27
  95. package/lib/mpeg/ExtendedLameHeader.js +31 -31
  96. package/lib/mpeg/MpegParser.d.ts +49 -49
  97. package/lib/mpeg/MpegParser.js +524 -529
  98. package/lib/mpeg/ReplayGainDataFormat.d.ts +55 -55
  99. package/lib/mpeg/ReplayGainDataFormat.js +69 -69
  100. package/lib/mpeg/XingTag.d.ts +45 -45
  101. package/lib/mpeg/XingTag.js +69 -69
  102. package/lib/musepack/index.d.ts +5 -5
  103. package/lib/musepack/index.js +32 -32
  104. package/lib/musepack/sv7/BitReader.d.ts +13 -13
  105. package/lib/musepack/sv7/BitReader.js +54 -54
  106. package/lib/musepack/sv7/MpcSv7Parser.d.ts +8 -8
  107. package/lib/musepack/sv7/MpcSv7Parser.js +46 -46
  108. package/lib/musepack/sv7/StreamVersion7.d.ts +28 -28
  109. package/lib/musepack/sv7/StreamVersion7.js +41 -41
  110. package/lib/musepack/sv8/MpcSv8Parser.d.ts +6 -6
  111. package/lib/musepack/sv8/MpcSv8Parser.js +55 -55
  112. package/lib/musepack/sv8/StreamVersion8.d.ts +40 -40
  113. package/lib/musepack/sv8/StreamVersion8.js +80 -80
  114. package/lib/ogg/Ogg.d.ts +72 -72
  115. package/lib/ogg/Ogg.js +2 -2
  116. package/lib/ogg/OggParser.d.ts +23 -23
  117. package/lib/ogg/OggParser.js +126 -126
  118. package/lib/ogg/opus/Opus.d.ts +48 -48
  119. package/lib/ogg/opus/Opus.js +28 -28
  120. package/lib/ogg/opus/OpusParser.d.ts +25 -25
  121. package/lib/ogg/opus/OpusParser.js +56 -56
  122. package/lib/ogg/speex/Speex.d.ts +36 -36
  123. package/lib/ogg/speex/Speex.js +31 -31
  124. package/lib/ogg/speex/SpeexParser.d.ts +22 -22
  125. package/lib/ogg/speex/SpeexParser.js +35 -35
  126. package/lib/ogg/theora/Theora.d.ts +20 -20
  127. package/lib/ogg/theora/Theora.js +23 -23
  128. package/lib/ogg/theora/TheoraParser.d.ts +28 -28
  129. package/lib/ogg/theora/TheoraParser.js +44 -44
  130. package/lib/ogg/vorbis/Vorbis.d.ts +69 -79
  131. package/lib/ogg/vorbis/Vorbis.js +78 -78
  132. package/lib/ogg/vorbis/VorbisDecoder.d.ts +12 -12
  133. package/lib/ogg/vorbis/VorbisDecoder.js +32 -32
  134. package/lib/ogg/vorbis/VorbisParser.d.ts +36 -36
  135. package/lib/ogg/vorbis/VorbisParser.js +128 -128
  136. package/lib/ogg/vorbis/VorbisTagMapper.d.ts +7 -7
  137. package/lib/ogg/vorbis/VorbisTagMapper.js +132 -132
  138. package/lib/riff/RiffChunk.d.ts +16 -16
  139. package/lib/riff/RiffChunk.js +32 -32
  140. package/lib/riff/RiffInfoTagMap.d.ts +10 -10
  141. package/lib/riff/RiffInfoTagMap.js +37 -37
  142. package/lib/type.d.ts +592 -599
  143. package/lib/type.js +5 -13
  144. package/lib/wav/WaveChunk.d.ts +64 -64
  145. package/lib/wav/WaveChunk.js +65 -65
  146. package/lib/wav/WaveParser.d.ts +24 -24
  147. package/lib/wav/WaveParser.js +144 -144
  148. package/lib/wavpack/WavPackParser.d.ts +14 -14
  149. package/lib/wavpack/WavPackParser.js +99 -105
  150. package/lib/wavpack/WavPackToken.d.ts +64 -64
  151. package/lib/wavpack/WavPackToken.js +76 -76
  152. package/package.json +150 -142
@@ -1,132 +1,132 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isUnique = exports.isSingleton = exports.commonTags = void 0;
4
- exports.commonTags = {
5
- year: { multiple: false },
6
- track: { multiple: false },
7
- disk: { multiple: false },
8
- title: { multiple: false },
9
- artist: { multiple: false },
10
- artists: { multiple: true, unique: true },
11
- albumartist: { multiple: false },
12
- album: { multiple: false },
13
- date: { multiple: false },
14
- originaldate: { multiple: false },
15
- originalyear: { multiple: false },
16
- comment: { multiple: true, unique: false },
17
- genre: { multiple: true, unique: true },
18
- picture: { multiple: true, unique: true },
19
- composer: { multiple: true, unique: true },
20
- lyrics: { multiple: true, unique: false },
21
- albumsort: { multiple: false, unique: true },
22
- titlesort: { multiple: false, unique: true },
23
- work: { multiple: false, unique: true },
24
- artistsort: { multiple: false, unique: true },
25
- albumartistsort: { multiple: false, unique: true },
26
- composersort: { multiple: false, unique: true },
27
- lyricist: { multiple: true, unique: true },
28
- writer: { multiple: true, unique: true },
29
- conductor: { multiple: true, unique: true },
30
- remixer: { multiple: true, unique: true },
31
- arranger: { multiple: true, unique: true },
32
- engineer: { multiple: true, unique: true },
33
- producer: { multiple: true, unique: true },
34
- technician: { multiple: true, unique: true },
35
- djmixer: { multiple: true, unique: true },
36
- mixer: { multiple: true, unique: true },
37
- label: { multiple: true, unique: true },
38
- grouping: { multiple: false },
39
- subtitle: { multiple: true },
40
- discsubtitle: { multiple: false },
41
- totaltracks: { multiple: false },
42
- totaldiscs: { multiple: false },
43
- compilation: { multiple: false },
44
- rating: { multiple: true },
45
- bpm: { multiple: false },
46
- mood: { multiple: false },
47
- media: { multiple: false },
48
- catalognumber: { multiple: true, unique: true },
49
- tvShow: { multiple: false },
50
- tvShowSort: { multiple: false },
51
- tvSeason: { multiple: false },
52
- tvEpisode: { multiple: false },
53
- tvEpisodeId: { multiple: false },
54
- tvNetwork: { multiple: false },
55
- podcast: { multiple: false },
56
- podcasturl: { multiple: false },
57
- releasestatus: { multiple: false },
58
- releasetype: { multiple: true },
59
- releasecountry: { multiple: false },
60
- script: { multiple: false },
61
- language: { multiple: false },
62
- copyright: { multiple: false },
63
- license: { multiple: false },
64
- encodedby: { multiple: false },
65
- encodersettings: { multiple: false },
66
- gapless: { multiple: false },
67
- barcode: { multiple: false },
68
- isrc: { multiple: true },
69
- asin: { multiple: false },
70
- musicbrainz_recordingid: { multiple: false },
71
- musicbrainz_trackid: { multiple: false },
72
- musicbrainz_albumid: { multiple: false },
73
- musicbrainz_artistid: { multiple: true },
74
- musicbrainz_albumartistid: { multiple: true },
75
- musicbrainz_releasegroupid: { multiple: false },
76
- musicbrainz_workid: { multiple: false },
77
- musicbrainz_trmid: { multiple: false },
78
- musicbrainz_discid: { multiple: false },
79
- acoustid_id: { multiple: false },
80
- acoustid_fingerprint: { multiple: false },
81
- musicip_puid: { multiple: false },
82
- musicip_fingerprint: { multiple: false },
83
- website: { multiple: false },
84
- 'performer:instrument': { multiple: true, unique: true },
85
- averageLevel: { multiple: false },
86
- peakLevel: { multiple: false },
87
- notes: { multiple: true, unique: false },
88
- key: { multiple: false },
89
- originalalbum: { multiple: false },
90
- originalartist: { multiple: false },
91
- discogs_artist_id: { multiple: true, unique: true },
92
- discogs_release_id: { multiple: false },
93
- discogs_label_id: { multiple: false },
94
- discogs_master_release_id: { multiple: false },
95
- discogs_votes: { multiple: false },
96
- discogs_rating: { multiple: false },
97
- replaygain_track_peak: { multiple: false },
98
- replaygain_track_gain: { multiple: false },
99
- replaygain_album_peak: { multiple: false },
100
- replaygain_album_gain: { multiple: false },
101
- replaygain_track_minmax: { multiple: false },
102
- replaygain_album_minmax: { multiple: false },
103
- replaygain_undo: { multiple: false },
104
- description: { multiple: true },
105
- longDescription: { multiple: false },
106
- category: { multiple: true },
107
- hdVideo: { multiple: false },
108
- keywords: { multiple: true },
109
- movement: { multiple: false },
110
- movementIndex: { multiple: false },
111
- movementTotal: { multiple: false },
112
- podcastId: { multiple: false },
113
- showMovement: { multiple: false },
114
- stik: { multiple: false }
115
- };
116
- /**
117
- * @param alias Name of common tag
118
- * @returns {boolean|*} true if given alias is mapped as a singleton', otherwise false
119
- */
120
- function isSingleton(alias) {
121
- return exports.commonTags.hasOwnProperty(alias) && !exports.commonTags[alias].multiple;
122
- }
123
- exports.isSingleton = isSingleton;
124
- /**
125
- * @param alias Common (generic) tag
126
- * @returns {boolean|*} true if given alias is a singleton or explicitly marked as unique
127
- */
128
- function isUnique(alias) {
129
- return !exports.commonTags[alias].multiple || exports.commonTags[alias].unique;
130
- }
131
- exports.isUnique = isUnique;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isUnique = exports.isSingleton = exports.commonTags = void 0;
4
+ exports.commonTags = {
5
+ year: { multiple: false },
6
+ track: { multiple: false },
7
+ disk: { multiple: false },
8
+ title: { multiple: false },
9
+ artist: { multiple: false },
10
+ artists: { multiple: true, unique: true },
11
+ albumartist: { multiple: false },
12
+ album: { multiple: false },
13
+ date: { multiple: false },
14
+ originaldate: { multiple: false },
15
+ originalyear: { multiple: false },
16
+ comment: { multiple: true, unique: false },
17
+ genre: { multiple: true, unique: true },
18
+ picture: { multiple: true, unique: true },
19
+ composer: { multiple: true, unique: true },
20
+ lyrics: { multiple: true, unique: false },
21
+ albumsort: { multiple: false, unique: true },
22
+ titlesort: { multiple: false, unique: true },
23
+ work: { multiple: false, unique: true },
24
+ artistsort: { multiple: false, unique: true },
25
+ albumartistsort: { multiple: false, unique: true },
26
+ composersort: { multiple: false, unique: true },
27
+ lyricist: { multiple: true, unique: true },
28
+ writer: { multiple: true, unique: true },
29
+ conductor: { multiple: true, unique: true },
30
+ remixer: { multiple: true, unique: true },
31
+ arranger: { multiple: true, unique: true },
32
+ engineer: { multiple: true, unique: true },
33
+ producer: { multiple: true, unique: true },
34
+ technician: { multiple: true, unique: true },
35
+ djmixer: { multiple: true, unique: true },
36
+ mixer: { multiple: true, unique: true },
37
+ label: { multiple: true, unique: true },
38
+ grouping: { multiple: false },
39
+ subtitle: { multiple: true },
40
+ discsubtitle: { multiple: false },
41
+ totaltracks: { multiple: false },
42
+ totaldiscs: { multiple: false },
43
+ compilation: { multiple: false },
44
+ rating: { multiple: true },
45
+ bpm: { multiple: false },
46
+ mood: { multiple: false },
47
+ media: { multiple: false },
48
+ catalognumber: { multiple: true, unique: true },
49
+ tvShow: { multiple: false },
50
+ tvShowSort: { multiple: false },
51
+ tvSeason: { multiple: false },
52
+ tvEpisode: { multiple: false },
53
+ tvEpisodeId: { multiple: false },
54
+ tvNetwork: { multiple: false },
55
+ podcast: { multiple: false },
56
+ podcasturl: { multiple: false },
57
+ releasestatus: { multiple: false },
58
+ releasetype: { multiple: true },
59
+ releasecountry: { multiple: false },
60
+ script: { multiple: false },
61
+ language: { multiple: false },
62
+ copyright: { multiple: false },
63
+ license: { multiple: false },
64
+ encodedby: { multiple: false },
65
+ encodersettings: { multiple: false },
66
+ gapless: { multiple: false },
67
+ barcode: { multiple: false },
68
+ isrc: { multiple: true },
69
+ asin: { multiple: false },
70
+ musicbrainz_recordingid: { multiple: false },
71
+ musicbrainz_trackid: { multiple: false },
72
+ musicbrainz_albumid: { multiple: false },
73
+ musicbrainz_artistid: { multiple: true },
74
+ musicbrainz_albumartistid: { multiple: true },
75
+ musicbrainz_releasegroupid: { multiple: false },
76
+ musicbrainz_workid: { multiple: false },
77
+ musicbrainz_trmid: { multiple: false },
78
+ musicbrainz_discid: { multiple: false },
79
+ acoustid_id: { multiple: false },
80
+ acoustid_fingerprint: { multiple: false },
81
+ musicip_puid: { multiple: false },
82
+ musicip_fingerprint: { multiple: false },
83
+ website: { multiple: false },
84
+ 'performer:instrument': { multiple: true, unique: true },
85
+ averageLevel: { multiple: false },
86
+ peakLevel: { multiple: false },
87
+ notes: { multiple: true, unique: false },
88
+ key: { multiple: false },
89
+ originalalbum: { multiple: false },
90
+ originalartist: { multiple: false },
91
+ discogs_artist_id: { multiple: true, unique: true },
92
+ discogs_release_id: { multiple: false },
93
+ discogs_label_id: { multiple: false },
94
+ discogs_master_release_id: { multiple: false },
95
+ discogs_votes: { multiple: false },
96
+ discogs_rating: { multiple: false },
97
+ replaygain_track_peak: { multiple: false },
98
+ replaygain_track_gain: { multiple: false },
99
+ replaygain_album_peak: { multiple: false },
100
+ replaygain_album_gain: { multiple: false },
101
+ replaygain_track_minmax: { multiple: false },
102
+ replaygain_album_minmax: { multiple: false },
103
+ replaygain_undo: { multiple: false },
104
+ description: { multiple: true },
105
+ longDescription: { multiple: false },
106
+ category: { multiple: true },
107
+ hdVideo: { multiple: false },
108
+ keywords: { multiple: true },
109
+ movement: { multiple: false },
110
+ movementIndex: { multiple: false },
111
+ movementTotal: { multiple: false },
112
+ podcastId: { multiple: false },
113
+ showMovement: { multiple: false },
114
+ stik: { multiple: false }
115
+ };
116
+ /**
117
+ * @param alias Name of common tag
118
+ * @returns {boolean|*} true if given alias is mapped as a singleton', otherwise false
119
+ */
120
+ function isSingleton(alias) {
121
+ return exports.commonTags.hasOwnProperty(alias) && !exports.commonTags[alias].multiple;
122
+ }
123
+ exports.isSingleton = isSingleton;
124
+ /**
125
+ * @param alias Common (generic) tag
126
+ * @returns {boolean|*} true if given alias is a singleton or explicitly marked as unique
127
+ */
128
+ function isUnique(alias) {
129
+ return !exports.commonTags[alias].multiple || exports.commonTags[alias].unique;
130
+ }
131
+ exports.isUnique = isUnique;
132
132
  //# sourceMappingURL=GenericTagTypes.js.map
@@ -1,76 +1,76 @@
1
- import { FormatId, IAudioMetadata, ICommonTagsResult, IFormat, INativeTags, IOptions, IQualityInformation, ITrackInfo } from '../type';
2
- import { IGenericTag, TagType } from './GenericTagTypes';
3
- /**
4
- * Combines all generic-tag-mappers for each tag type
5
- */
6
- export interface IWarningCollector {
7
- /**
8
- * Register parser warning
9
- * @param warning
10
- */
11
- addWarning(warning: string): any;
12
- }
13
- export interface INativeMetadataCollector extends IWarningCollector {
14
- /**
15
- * Only use this for reading
16
- */
17
- readonly format: IFormat;
18
- readonly native: INativeTags;
19
- readonly quality: IQualityInformation;
20
- /**
21
- * @returns {boolean} true if one or more tags have been found
22
- */
23
- hasAny(): boolean;
24
- setFormat(key: FormatId, value: any): void;
25
- addTag(tagType: TagType, tagId: string, value: any): void;
26
- addStreamInfo(streamInfo: ITrackInfo): void;
27
- }
28
- /**
29
- * Provided to the parser to uodate the metadata result.
30
- * Responsible for triggering async updates
31
- */
32
- export declare class MetadataCollector implements INativeMetadataCollector {
33
- private opts;
34
- readonly format: IFormat;
35
- readonly native: INativeTags;
36
- readonly common: ICommonTagsResult;
37
- readonly quality: IQualityInformation;
38
- /**
39
- * Keeps track of origin priority for each mapped id
40
- */
41
- private readonly commonOrigin;
42
- /**
43
- * Maps a tag type to a priority
44
- */
45
- private readonly originPriority;
46
- private tagMapper;
47
- constructor(opts: IOptions);
48
- /**
49
- * @returns {boolean} true if one or more tags have been found
50
- */
51
- hasAny(): boolean;
52
- addStreamInfo(streamInfo: ITrackInfo): void;
53
- setFormat(key: FormatId, value: any): void;
54
- addTag(tagType: TagType, tagId: string, value: any): void;
55
- addWarning(warning: string): void;
56
- postMap(tagType: TagType | 'artificial', tag: IGenericTag): any;
57
- /**
58
- * Convert native tags to common tags
59
- * @returns {IAudioMetadata} Native + common tags
60
- */
61
- toCommonMetadata(): IAudioMetadata;
62
- /**
63
- * Fix some common issues with picture object
64
- * @param picture Picture
65
- */
66
- private postFixPicture;
67
- /**
68
- * Convert native tag to common tags
69
- */
70
- private toCommon;
71
- /**
72
- * Set generic tag
73
- */
74
- private setGenericTag;
75
- }
76
- export declare function joinArtists(artists: string[]): string;
1
+ import { FormatId, IAudioMetadata, ICommonTagsResult, IFormat, INativeTags, IOptions, IQualityInformation, ITrackInfo } from '../type';
2
+ import { IGenericTag, TagType } from './GenericTagTypes';
3
+ /**
4
+ * Combines all generic-tag-mappers for each tag type
5
+ */
6
+ export interface IWarningCollector {
7
+ /**
8
+ * Register parser warning
9
+ * @param warning
10
+ */
11
+ addWarning(warning: string): any;
12
+ }
13
+ export interface INativeMetadataCollector extends IWarningCollector {
14
+ /**
15
+ * Only use this for reading
16
+ */
17
+ readonly format: IFormat;
18
+ readonly native: INativeTags;
19
+ readonly quality: IQualityInformation;
20
+ /**
21
+ * @returns {boolean} true if one or more tags have been found
22
+ */
23
+ hasAny(): boolean;
24
+ setFormat(key: FormatId, value: any): void;
25
+ addTag(tagType: TagType, tagId: string, value: any): void;
26
+ addStreamInfo(streamInfo: ITrackInfo): void;
27
+ }
28
+ /**
29
+ * Provided to the parser to uodate the metadata result.
30
+ * Responsible for triggering async updates
31
+ */
32
+ export declare class MetadataCollector implements INativeMetadataCollector {
33
+ private opts;
34
+ readonly format: IFormat;
35
+ readonly native: INativeTags;
36
+ readonly common: ICommonTagsResult;
37
+ readonly quality: IQualityInformation;
38
+ /**
39
+ * Keeps track of origin priority for each mapped id
40
+ */
41
+ private readonly commonOrigin;
42
+ /**
43
+ * Maps a tag type to a priority
44
+ */
45
+ private readonly originPriority;
46
+ private tagMapper;
47
+ constructor(opts: IOptions);
48
+ /**
49
+ * @returns {boolean} true if one or more tags have been found
50
+ */
51
+ hasAny(): boolean;
52
+ addStreamInfo(streamInfo: ITrackInfo): void;
53
+ setFormat(key: FormatId, value: any): void;
54
+ addTag(tagType: TagType, tagId: string, value: any): void;
55
+ addWarning(warning: string): void;
56
+ postMap(tagType: TagType | 'artificial', tag: IGenericTag): any;
57
+ /**
58
+ * Convert native tags to common tags
59
+ * @returns {IAudioMetadata} Native + common tags
60
+ */
61
+ toCommonMetadata(): IAudioMetadata;
62
+ /**
63
+ * Fix some common issues with picture object
64
+ * @param picture Picture
65
+ */
66
+ private postFixPicture;
67
+ /**
68
+ * Convert native tag to common tags
69
+ */
70
+ private toCommon;
71
+ /**
72
+ * Set generic tag
73
+ */
74
+ private setGenericTag;
75
+ }
76
+ export declare function joinArtists(artists: string[]): string;