Add anime, shows and movies to about page
This commit is contained in:
1 parent
d7476cff98
commit
7845cb5e6f
12 files changed
+754
-22
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { about } from '#lib/content';
|
||||
import { getAnimeProfile } from '#lib/server/anilist';
|
||||
import { getMediaDetails } from '#lib/server/omdb';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = async () => {
|
||||
const mediaUrls = [...about.shows, ...about.movies].map((item) => item.url);
|
||||
|
||||
const [anime, mediaDetails] = await Promise.all([
|
||||
about.anilistUsername ? getAnimeProfile(about.anilistUsername) : null,
|
||||
getMediaDetails(mediaUrls)
|
||||
]);
|
||||
|
||||
return { anime, mediaDetails };
|
||||
};
|
||||
Reference in new issue
Block a user