mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 10:23:24 +00:00
add no cache option and cleanup
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "git clean -xdf .expo .turbo node_modules",
|
"clean": "git clean -xdf .expo .turbo node_modules",
|
||||||
"dev": "expo start",
|
"dev": "expo start",
|
||||||
"dev:android": "expo start --android",
|
"dev:android": "expo start -c --android",
|
||||||
"dev:ios": "expo start --ios",
|
"dev:ios": "expo start -c --ios",
|
||||||
"android": "expo run:android",
|
"android": "expo run:android",
|
||||||
"ios": "expo run:ios",
|
"ios": "expo run:ios",
|
||||||
"apk": "expo prebuild --platform=android && cd android && ./gradlew assembleRelease",
|
"apk": "expo prebuild --platform=android && cd android && ./gradlew assembleRelease",
|
||||||
|
@@ -9,20 +9,15 @@ export async function fetchMediaDetails(
|
|||||||
{ type: "movie" | "tv"; result: TvShowDetails | MovieDetails } | undefined
|
{ type: "movie" | "tv"; result: TvShowDetails | MovieDetails } | undefined
|
||||||
> {
|
> {
|
||||||
try {
|
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) {
|
return {
|
||||||
case "tv":
|
type,
|
||||||
result = await tmdb.tvShows.details(parseInt(id, 10));
|
result,
|
||||||
break;
|
};
|
||||||
case "movie":
|
|
||||||
result = await tmdb.movies.details(parseInt(id, 10));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return { type, result };
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user