Add SQLite library with API, library desktop apps and MobyGames scraper
This commit is contained in:
1 parent
6674428346
commit
a16444451a
69 files changed
+2988
-1026
No files matched your search
@@ -1,12 +1,14 @@
|
||||
import { about, books } from '#lib/content';
|
||||
import { about } from '#lib/content';
|
||||
import type { HobbyStats } from '#lib/btop/types';
|
||||
import { aniListStats, bookStats, listeningStats, screenStats } from '#lib/btop/hobbies';
|
||||
import { getAniListProfile } from './anilist';
|
||||
import { getListeningProfile } from './lastfm/profile';
|
||||
import { getLibrary } from './library';
|
||||
|
||||
export async function getHobbyStats(): Promise<HobbyStats> {
|
||||
const anilistUsername = about.anilistUsername;
|
||||
const [listening, anime, manga] = await Promise.all([
|
||||
const [library, listening, anime, manga] = await Promise.all([
|
||||
getLibrary(),
|
||||
about.lastfmUsername ? getListeningProfile(about.lastfmUsername).catch(() => null) : null,
|
||||
anilistUsername ? getAniListProfile(anilistUsername, 'ANIME').catch(() => null) : null,
|
||||
anilistUsername ? getAniListProfile(anilistUsername, 'MANGA').catch(() => null) : null
|
||||
@@ -15,9 +17,9 @@ export async function getHobbyStats(): Promise<HobbyStats> {
|
||||
|
||||
return {
|
||||
listening: listening ? listeningStats(listening) : null,
|
||||
books: bookStats(books),
|
||||
shows: screenStats(about.shows),
|
||||
movies: screenStats(about.movies),
|
||||
books: bookStats(library.books),
|
||||
shows: screenStats(library.shows),
|
||||
movies: screenStats(library.movies),
|
||||
anime: anime ? aniListStats(anime) : null,
|
||||
manga: manga && hasManga ? aniListStats(manga) : null
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user