Add Last.fm music stats to about page
This commit is contained in:
1 parent
3122bc4bf9
commit
2d84d68c46
27 files changed
+1618
-4
No files matched your search
@@ -1,15 +1,17 @@
|
||||
import { about } from '#lib/content';
|
||||
import { getAnimeProfile } from '#lib/server/anilist';
|
||||
import { getMediaDetails } from '#lib/server/omdb';
|
||||
import { getListeningProfile } from '#lib/server/lastfm/profile';
|
||||
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([
|
||||
const [anime, mediaDetails, listening] = await Promise.all([
|
||||
about.anilistUsername ? getAnimeProfile(about.anilistUsername) : null,
|
||||
getMediaDetails(mediaUrls)
|
||||
getMediaDetails(mediaUrls),
|
||||
about.lastfmUsername ? getListeningProfile(about.lastfmUsername) : null
|
||||
]);
|
||||
|
||||
return { anime, mediaDetails };
|
||||
return { anime, mediaDetails, listening };
|
||||
};
|
||||
Reference in new issue
Block a user