File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
discord-player/src/fabric Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,13 @@ export class Track<T = unknown> {
3030 public requestedBy : User | null = null ;
3131 public playlist ?: Playlist ;
3232 public queryType : SearchQueryType | null | undefined = null ;
33- public raw : RawTrackData = {
34- source : 'arbitrary'
35- } as RawTrackData ;
33+ public raw : any ;
3634 public extractor : BaseExtractor | null = null ;
3735 public readonly id = SnowflakeUtil . generate ( ) . toString ( ) ;
3836 private __metadata : T | null = null ;
3937 private __reqMetadataFn : ( ) => Promise < T | null > ;
4038 public cleanTitle : string ;
39+ public live : boolean = false
4140
4241 /**
4342 * Track constructor
@@ -59,6 +58,7 @@ export class Track<T = unknown> {
5958 this . __metadata = data . metadata ?? null ;
6059 this . __reqMetadataFn = data . requestMetadata || ( ( ) => Promise . resolve < T | null > ( null ) ) ;
6160 this . cleanTitle = data . cleanTitle ?? Util . cleanTitle ( this . title , this . source ) ;
61+ this . live = data . live ?? false
6262 }
6363
6464 /**
Original file line number Diff line number Diff line change @@ -105,7 +105,6 @@ export class AttachmentExtractor extends BaseExtractor {
105105
106106 track . extractor = this ;
107107
108- // @ts -expect-error
109108 track . raw . isFile = false ;
110109
111110 return { playlist : null , tracks : [ track ] } ;
@@ -180,7 +179,6 @@ export class AttachmentExtractor extends BaseExtractor {
180179
181180 track . extractor = this ;
182181
183- // @ts -expect-error
184182 track . raw . isFile = true ;
185183
186184 return { playlist : null , tracks : [ track ] } ;
@@ -196,7 +194,7 @@ export class AttachmentExtractor extends BaseExtractor {
196194
197195 public async stream ( info : Track ) {
198196 const engine = info . raw . engine as string ;
199- // @ts -expect-error
197+
200198 const isFile = info . raw . isFile as boolean ;
201199
202200 if ( ! engine ) throw new Error ( 'Could not find stream source' ) ;
Original file line number Diff line number Diff line change @@ -119,7 +119,8 @@ export class YoutubeExtractor extends BaseExtractor<YoutubeExtractorInit> {
119119 metadata : video ,
120120 async requestMetadata ( ) {
121121 return video ;
122- }
122+ } ,
123+ live : video . live
123124 } ) ;
124125
125126 track . extractor = this ;
@@ -153,7 +154,8 @@ export class YoutubeExtractor extends BaseExtractor<YoutubeExtractorInit> {
153154 metadata : video ,
154155 async requestMetadata ( ) {
155156 return video ;
156- }
157+ } ,
158+ live : video . live
157159 } ) ;
158160
159161 track . extractor = this ;
@@ -193,7 +195,8 @@ export class YoutubeExtractor extends BaseExtractor<YoutubeExtractorInit> {
193195 metadata : video ,
194196 async requestMetadata ( ) {
195197 return video ;
196- }
198+ } ,
199+ live : video . live
197200 } ) ;
198201
199202 track . extractor = this ;
@@ -237,7 +240,8 @@ export class YoutubeExtractor extends BaseExtractor<YoutubeExtractorInit> {
237240 metadata : video ,
238241 async requestMetadata ( ) {
239242 return video ;
240- }
243+ } ,
244+ live : video . live
241245 } ) ;
242246
243247 t . extractor = this ;
You can’t perform that action at this time.
0 commit comments