| 56 | } |
| 57 | |
| 58 | private async getData() { |
| 59 | let de; |
| 60 | if (Number.isNaN(this.malId)) { |
| 61 | de = { simkl: this.simklId }; |
| 62 | } else { |
| 63 | de = { mal: this.malId }; |
| 64 | } |
| 65 | |
| 66 | if (Number.isNaN(this.simklId)) { |
| 67 | const el = await this.call('https://api.simkl.com/search/id', de, true); |
| 68 | if (!el?.length) throw new NotFoundError(`simklId: ${this.simklId}`); |
| 69 | this.simklId = el[0].ids.simkl; |
| 70 | } |
| 71 | |
| 72 | return this.call(`https://api.simkl.com/anime/${this.simklId}`, { extended: 'full' }, true); |
| 73 | } |
| 74 | |
| 75 | private title(data) { |
| 76 | const { title } = data; |