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
|
* @param {Entry} entry Entry to get the episodes of
|
||||||
*
|
*
|
||||||
* @returns {[FormattedEpisodes]}
|
* @returns {[FormattedEpisode]}
|
||||||
*/
|
*/
|
||||||
export async function getEpisodes (entry) {
|
export async function getEpisodes (entry) {
|
||||||
try {
|
try {
|
||||||
/** @type {[RawEpisode]} */
|
/** @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
|
return rawEps
|
||||||
.map(({ id, source, number }) => ({
|
.map(({ id, source, number }) => ({
|
||||||
id,
|
id,
|
||||||
source,
|
source,
|
||||||
number,
|
number,
|
||||||
|
title: `${entry.title} - ${number}`,
|
||||||
url: [BASE_URL, decrypt(source)].join('')
|
url: [BASE_URL, decrypt(source)].join('')
|
||||||
}))
|
}))
|
||||||
.filter(({ url }) => url)
|
.filter(({ url }) => url)
|
||||||
|
|
|
@ -48,3 +48,15 @@
|
||||||
* @property {String} FormattedEpisode.source
|
* @property {String} FormattedEpisode.source
|
||||||
* @property {Number} FormattedEpisode.number
|
* @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