UNPKG

leref.ts

Version:

Something upcoming for aoi.js and npm packages uses

1 lines 1.56 kB
"use strict";var LerefTracking_1,UnresolvedTrack_1,__decorate=this&&this.__decorate||function(e,r,t,s){var i,c=arguments.length,o=c<3?r:null===s?s=Object.getOwnPropertyDescriptor(r,t):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,r,t,s);else for(var n=e.length-1;0<=n;n--)(i=e[n])&&(o=(c<3?i(o):3<c?i(r,t,o):i(r,t))||o);return 3<c&&o&&Object.defineProperty(r,t,o),o};Object.defineProperty(exports,"__esModule",{value:!0}),exports.UnresolvedTrack=exports.LerefTracking=void 0;const constructs_1=require("../utils/decorators/constructs");let LerefTracking=LerefTracking_1=class{constructor(e,r){this.base64=e.track,this.requester=r,this.build(e.info)}static isTrack(e){return!("object"!=typeof e||!e)&&e instanceof LerefTracking_1}displayThumbnail(e="default"){if("youtube"===this.source)return`https://img.youtube.com/vi/${this.identifier}/${e}.jpg`}build(e){this.title=e.title,this.identifier=e.identifier,this.author=e.author,this.duration=e.length,this.isSeekable=e.isSeekable,this.isStream=e.isStream,this.url=e.uri,this.source=e.sourceName}};LerefTracking=LerefTracking_1=__decorate([constructs_1.constructTrack()],LerefTracking),exports.LerefTracking=LerefTracking;let UnresolvedTrack=UnresolvedTrack_1=class{constructor(e,r,t,s){this.title=e,this.author=r,this.duration=t,this.requester=s}static isUnresolved(e){return!("object"!=typeof e||!e)&&e instanceof UnresolvedTrack_1}};UnresolvedTrack=UnresolvedTrack_1=__decorate([constructs_1.constructUnresolved()],UnresolvedTrack),exports.UnresolvedTrack=UnresolvedTrack;