mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 05:33:25 +00:00
add no cache option and cleanup
This commit is contained in:
@@ -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",
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user