mirror of https://github.com/Kylart/KawAnime.git
Fix jsdoc and added episode title
This commit is contained in:
parent
63bd136dae
commit
654621dc41
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue