···
12
12
13
13
/** @type {import('./$types').PageServerLoad} */
14
14
export async function load(event) {
15
15
-
const id = "10193";
16
16
-
const kind = "movie";
15
15
+
const id = parseInt(event.params.id.split('-')[0]);
16
16
+
const id2 = parseInt(event.params.id2.split('-')[0]);
17
17
+
const kind = event.params.kind;
18
18
+
const kind2=event.params.kind2;
17
19
const couter=0;
18
20
19
21
if (kind !== 'movie' && kind !== 'tv') {
···
24
26
return error(404, 'Not found');
25
27
}
26
28
const resultPromise = getDetails(id, kind);
29
29
+
const resultPromise2 = getDetails(id2, kind2);
27
30
28
31
const trailerPromise = getTrailer(id, kind);
29
32
···
38
41
39
42
const castPromise = getCast(id, kind);
40
43
41
41
-
const [result, trailer, recommendations, watchProviders, ratings, cast] = await Promise.all([
44
44
+
const [result,result2, trailer, recommendations, watchProviders, ratings, cast] = await Promise.all([
42
45
resultPromise,
46
46
+
resultPromise2,
43
47
trailerPromise,
44
48
recommendationsPromise,
45
49
watchProvidersPromise,
···
57
61
movieId: kind === 'movie' ? id : undefined,
58
62
showId: kind === 'tv' ? id : undefined
59
63
},
64
64
+
result2: {
65
65
+
...result2,
66
66
+
movieId: kind === 'movie' ? id : undefined,
67
67
+
showId: kind === 'tv' ? id : undefined
68
68
+
},
60
69
trailer,
61
70
// @ts-expect-error - TODO: fix this
62
71
recommendations: recommendations.map((item) => {
···
67
76
}
68
77
}),
69
78
kind,
79
79
+
kind2,
70
80
watchProviders,
71
81
ratings,
72
82
cast,
···
108
108
style:--name={`poster-${data.result.id}`}
109
109
/>
110
110
<img
111
111
-
src="https://image.tmdb.org/t/p/w500{data.result.poster_path}"
111
111
+
src="https://image.tmdb.org/t/p/w500{data.result2.poster_path}"
112
112
alt=""
113
113
class="poster h-36 w-24 shrink-0 rounded-lg border border-white/10 sm:h-64 sm:w-44"
114
114
-
style:--name={`poster-${data.result.id}`}
114
114
+
style:--name={`poster-${data.result2.id}`}
115
115
/>
116
116
<div class="flex flex-col gap-4">
117
117
<div