Skip to content

Commit

Permalink
Get rid of ID3Stream class. (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Aug 9, 2020
1 parent 8db5720 commit f34c8d9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 25 deletions.
4 changes: 1 addition & 3 deletions lib/aiff/AiffParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { BasicParser } from '../common/BasicParser';

import * as AiffToken from './AiffToken';
import * as iff from '../iff';
import { ID3Stream } from "../id3v2/ID3Stream";

const debug = initDebug('music-metadata:parser:aiff');

Expand Down Expand Up @@ -81,8 +80,7 @@ export class AIFFParser extends BasicParser {

case 'ID3 ': // ID3-meta-data
const id3_data = await this.tokenizer.readToken<Buffer>(new Token.BufferType(header.chunkSize));
const id3stream = new ID3Stream(id3_data);
const rst = strtok3.fromStream(id3stream);
const rst = strtok3.fromBuffer(id3_data);
await new ID3v2Parser().parse(this.metadata, rst, this.options);
return header.chunkSize;

Expand Down
4 changes: 1 addition & 3 deletions lib/dsdiff/DsdiffParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as Token from 'token-types';
import * as initDebug from 'debug';
import { FourCcToken } from '../common/FourCC';
import { BasicParser } from '../common/BasicParser';
import { ID3Stream } from '../id3v2/ID3Stream';

import {ChunkHeader, IChunkHeader} from "./DsdiffToken";
import * as strtok3 from "strtok3/lib/core";
Expand Down Expand Up @@ -67,8 +66,7 @@ export class DsdiffParser extends BasicParser {

case 'ID3': // Unofficial ID3 tag support
const id3_data = await this.tokenizer.readToken<Buffer>(new Token.BufferType(header.chunkSize));
const id3stream = new ID3Stream(id3_data);
const rst = strtok3.fromStream(id3stream);
const rst = strtok3.fromBuffer(id3_data);
await new ID3v2Parser().parse(this.metadata, rst, this.options);
break;

Expand Down
16 changes: 0 additions & 16 deletions lib/id3v2/ID3Stream.ts

This file was deleted.

4 changes: 1 addition & 3 deletions lib/riff/WaveParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ID3v2Parser } from '../id3v2/ID3v2Parser';
import Common from '../common/Util';
import { FourCcToken } from '../common/FourCC';
import { BasicParser } from '../common/BasicParser';
import { ID3Stream } from "../id3v2/ID3Stream";

const debug = initDebug('music-metadata:parser:RIFF');

Expand Down Expand Up @@ -93,8 +92,7 @@ export class WaveParser extends BasicParser {
case 'id3 ': // The way Picard, FooBar currently stores, ID3 meta-data
case 'ID3 ': // The way Mp3Tags stores ID3 meta-data
const id3_data = await this.tokenizer.readToken<Buffer>(new Token.BufferType(header.chunkSize));
const id3stream = new ID3Stream(id3_data);
const rst = strtok3.fromStream(id3stream);
const rst = strtok3.fromBuffer(id3_data);
await new ID3v2Parser().parse(this.metadata, rst, this.options);
break;

Expand Down

0 comments on commit f34c8d9

Please sign in to comment.