mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix: Handle double-encoded JSON in getStream function
This commit is contained in:
@@ -92,7 +92,14 @@ export const getStream = async function ({
|
||||
}
|
||||
console.log(id);
|
||||
const streams: Stream[] = [];
|
||||
const { imdbId, season, episode } = JSON.parse(id);
|
||||
// Handle double-encoded JSON
|
||||
let parsedId = typeof id === "string" ? JSON.parse(id) : id;
|
||||
if (typeof parsedId === "string") {
|
||||
parsedId = JSON.parse(parsedId);
|
||||
}
|
||||
const { imdbId, season, episode } = parsedId;
|
||||
console.log("Parsed ID:", parsedId);
|
||||
console.log("imdbId:", imdbId);
|
||||
|
||||
///// mostraguarda
|
||||
const mostraguardaStream = await GetMostraguardaStream({
|
||||
|
||||
Reference in New Issue
Block a user