add no cache option and cleanup

This commit is contained in:
Jorrin
2024-02-04 19:53:45 +01:00
parent 4e60002bac
commit 450ef4dc90
2 changed files with 10 additions and 15 deletions

View File

@@ -6,8 +6,8 @@
"scripts": {
"clean": "git clean -xdf .expo .turbo node_modules",
"dev": "expo start",
"dev:android": "expo start --android",
"dev:ios": "expo start --ios",
"dev:android": "expo start -c --android",
"dev:ios": "expo start -c --ios",
"android": "expo run:android",
"ios": "expo run:ios",
"apk": "expo prebuild --platform=android && cd android && ./gradlew assembleRelease",

View File

@@ -9,20 +9,15 @@ export async function fetchMediaDetails(
{ type: "movie" | "tv"; result: TvShowDetails | MovieDetails } | undefined
> {
try {
let result: TvShowDetails | MovieDetails;
const result =
type === "movie"
? await tmdb.movies.details(parseInt(id, 10))
: await tmdb.tvShows.details(parseInt(id, 10));
switch (type) {
case "tv":
result = await tmdb.tvShows.details(parseInt(id, 10));
break;
case "movie":
result = await tmdb.movies.details(parseInt(id, 10));
break;
default:
return undefined;
}
return { type, result };
return {
type,
result,
};
} catch (ex) {
return undefined;
}