refactor: Simplify link generation in getMeta and getStream functions

This commit is contained in:
himanshu8443
2025-10-11 12:49:20 +05:30
parent b4c828a870
commit ed85dcb4f3
4 changed files with 9 additions and 26 deletions

View File

@@ -32,15 +32,9 @@ export const getMeta = async function ({
season.get(video?.season).push({
title: "Episode " + video?.episode,
type: "series",
link: JSON.stringify({
title: data?.meta?.name as string,
imdbId: data?.meta?.imdb_id,
season: video?.id?.split(":")[1],
episode: video?.id?.split(":")[2],
type: data?.meta?.type,
tmdbId: data?.meta?.moviedb_id?.toString() || "",
year: data?.meta?.year,
}),
link: `${data?.meta?.imdb_id}-${video?.id?.split(":")[1]}-${
video?.id?.split(":")[2]
}`,
});
});
const keys = Array.from(season.keys());
@@ -59,15 +53,7 @@ export const getMeta = async function ({
{
title: "Movie",
type: "movie",
link: JSON.stringify({
title: data?.meta?.name as string,
imdbId: data?.meta?.imdb_id,
season: "",
episode: "",
type: data?.meta?.type,
tmdbId: data?.meta?.moviedb_id?.toString() || "",
year: data?.meta?.year,
}),
link: `${data?.meta?.imdb_id}-`,
},
],
});