diff --git a/src/main/externals/twist.moe/search.js b/src/main/externals/twist.moe/search.js index 352b96c..0f7099e 100644 --- a/src/main/externals/twist.moe/search.js +++ b/src/main/externals/twist.moe/search.js @@ -35,18 +35,19 @@ export async function getAll () { * * @param {Entry} entry Entry to get the episodes of * - * @returns {[FormattedEpisodes]} + * @returns {[FormattedEpisode]} */ export async function getEpisodes (entry) { try { /** @type {[RawEpisode]} */ - const rawEps = await https.get(`${API_URL}/anime/${entry.slug.slug}/sources`, [], DEFAULT_HEADERS) + const rawEps = await https.get(`${API_URL}/anime/${entry.slug.slug}/sources`, [], { ...DEFAULT_HEADERS, json: true }) return rawEps .map(({ id, source, number }) => ({ id, source, number, + title: `${entry.title} - ${number}`, url: [BASE_URL, decrypt(source)].join('') })) .filter(({ url }) => url) diff --git a/src/main/externals/twist.moe/types.js b/src/main/externals/twist.moe/types.js index 788e5d3..1a04a69 100644 --- a/src/main/externals/twist.moe/types.js +++ b/src/main/externals/twist.moe/types.js @@ -48,3 +48,15 @@ * @property {String} FormattedEpisode.source * @property {Number} FormattedEpisode.number */ + +/** @type {Entry} */ +export const Entry = null + +/** @type {FormattedEntry} */ +export const FormattedEntry = null + +/** @type {RawEpisode} */ +export const RawEpisode = null + +/** @type {FormattedEpisode} */ +export const FormattedEpisode = null