mirror of
https://github.com/NoCrypt/migu.git
synced 2026-03-23 10:58:36 +00:00
fix: fetching wrong anime season
idk why an array is returned for some seasons resulting in '3,03' so instead of it failing and returning the default season we can now return the first entry in the array.
This commit is contained in:
parent
7b3ed60b86
commit
ced891ef29
1 changed files with 2 additions and 0 deletions
|
|
@ -175,6 +175,8 @@ export async function anitomyscript (...args) {
|
|||
obj.anime_season = seasonMatch[1]
|
||||
obj.episode_number = seasonMatch[2]
|
||||
obj.anime_title = obj.anime_title.replace(/S(\d{2})E(\d{2})/, '')
|
||||
} else if (Array.isArray(obj.anime_season)) {
|
||||
obj.anime_season = obj.anime_season[0]
|
||||
}
|
||||
const yearMatch = obj.anime_title.match(/ (19[5-9]\d|20\d{2})/)
|
||||
if (yearMatch && Number(yearMatch[1]) <= (new Date().getUTCFullYear() + 1)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue