mirror of
https://github.com/Shineii86/MiruroAPI.git
synced 2026-10-22 02:05:10 +00:00
fix: extractSubtitles returns empty array when subtitles undefined (dub)
This commit is contained in:
@@ -339,6 +339,8 @@ const getWatchSources = async (provider, anilistId, category, slug) => {
|
||||
const extractSubtitles = (sources) => {
|
||||
const raw = sources.subtitles || sources.captions || [];
|
||||
|
||||
if (!Array.isArray(raw)) return [];
|
||||
|
||||
return raw.map((sub) => ({
|
||||
url: sub.file || sub.url || null,
|
||||
label: sub.label || sub.name || sub.language || "Unknown",
|
||||
|
||||
Reference in New Issue
Block a user