fix: download path on android

This commit is contained in:
Fredrik Burmester
2024-09-30 22:11:53 +02:00
parent 5f91712126
commit 329a75a047
3 changed files with 7 additions and 5 deletions

BIN
bun.lockb

Binary file not shown.

View File

@@ -30,7 +30,7 @@
"@types/lodash": "^4.17.9",
"@types/uuid": "^10.0.0",
"axios": "^1.7.7",
"expo": "~51.0.34",
"expo": "~51.0.35",
"expo-background-fetch": "~12.0.1",
"expo-blur": "~13.0.2",
"expo-build-properties": "~0.12.5",
@@ -77,7 +77,7 @@
"react-native-svg": "15.2.0",
"react-native-url-polyfill": "^2.0.0",
"react-native-uuid": "^2.0.2",
"react-native-video": "^6.6.2",
"react-native-video": "^6.6.3",
"react-native-web": "~0.19.10",
"sonner-native": "^0.14.2",
"tailwindcss": "3.3.2",

View File

@@ -77,6 +77,8 @@ function useDownloadProvider() {
const router = useRouter();
const [api] = useAtom(apiAtom);
const [processes, setProcesses] = useState<JobStatus[]>([]);
const authHeader = useMemo(() => {
return api?.accessToken;
}, [api]);
@@ -87,8 +89,6 @@ function useDownloadProvider() {
staleTime: 0,
});
const [processes, setProcesses] = useState<JobStatus[]>([]);
useQuery({
queryKey: ["jobs"],
queryFn: async () => {
@@ -216,10 +216,12 @@ function useDownloadProvider() {
},
});
const baseDirectory = FileSystem.documentDirectory;
download({
id: process.id,
url: settings?.optimizedVersionsServerUrl + "download/" + process.id,
destination: `${directories.documents}/${process.item.Id}.mp4`,
destination: `${baseDirectory}/${process.item.Id}.mp4`,
})
.begin(() => {
toast.info(`Download started for ${process.item.Name}`);