mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
refactor: Simplify link generation in getMeta and getStream functions
This commit is contained in:
@@ -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}-`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user