1- import * as DateFormat from "dateformat" ;
2- import itiriri from "itiriri" ;
3-
41import AttachmentFrame from "./frames/attachmentFrame" ;
52import CommentsFrame from "./frames/commentsFrame" ;
63import FrameFactory from "./frames/frameFactory" ;
@@ -21,7 +18,7 @@ import {IPicture} from "../picture";
2118import { Tag , TagTypes } from "../tag" ;
2219import { TextInformationFrame , UserTextInformationFrame } from "./frames/textInformationFrame" ;
2320import { UrlLinkFrame } from "./frames/urlLinkFrame" ;
24- import { Guards } from "../utils" ;
21+ import { DateUtils , Guards } from "../utils" ;
2522
2623/**
2724 * Extends {@link Tag} to provide support for reading and writing tags stored in the ID3v2 format.
@@ -373,9 +370,17 @@ export default class Id3v2Tag extends Tag {
373370 }
374371
375372 // Collapse the instrument lists and return that
376- this . _performersRole = itiriri ( map . values ( ) )
377- . map ( ( e : string [ ] ) => e . length > 0 ? e . join ( "; " ) : undefined )
378- . toArray ( ) ;
373+ // this._performersRole = Array.from(map.values())
374+ // .map((e: string[]) => e.length > 0 ? e.join("; ") : undefined);
375+ const performersRole = [ ]
376+ for ( const roles of map . values ( ) ) {
377+ if ( roles . length > 0 ) {
378+ performersRole . push ( roles . join ( '; ' ) )
379+ } else {
380+ performersRole . push ( undefined )
381+ }
382+ }
383+ this . _performersRole = performersRole
379384 return this . _performersRole ;
380385 }
381386 /**
@@ -716,12 +721,7 @@ export default class Id3v2Tag extends Tag {
716721 * @remarks Stored in the `TDTG` frame
717722 */
718723 set dateTagged ( value : Date | undefined ) {
719- let strValue : string ;
720- if ( value ) {
721- strValue = DateFormat ( value , "yyyy-mm-dd HH:MM:ss" ) ;
722- strValue = strValue . replace ( " " , "T" ) ;
723- }
724- this . setTextFrame ( FrameIdentifiers . TDTG , strValue ) ;
724+ this . setTextFrame ( FrameIdentifiers . TDTG , DateUtils . format ( value ) ) ;
725725 }
726726
727727 /**
0 commit comments