feat: implement default quality setting

This commit is contained in:
Adrian Castro
2024-04-11 20:53:53 +02:00
parent 45d12bbf41
commit 4a3d363bf2
10 changed files with 660 additions and 103 deletions

View File

@@ -184,11 +184,11 @@ export const useDownloadManager = () => {
lastTimestamp = currentTime;
};
const fileUri =
FileSystem.cacheDirectory + "movie-web"
? FileSystem.cacheDirectory + "movie-web" + url.split("/").pop()
: null;
if (!fileUri) {
const fileUri = `${FileSystem.cacheDirectory}movie-web${url.split("/").pop()}`;
if (
!(await FileSystem.getInfoAsync(`${FileSystem.cacheDirectory}movie-web`))
.exists
) {
console.error("Cache directory is unavailable");
return;
}
@@ -238,7 +238,7 @@ export const useDownloadManager = () => {
const totalSegments = segments.length;
let segmentsDownloaded = 0;
const segmentDir = FileSystem.cacheDirectory + "movie-web/segments/";
const segmentDir = `${FileSystem.cacheDirectory}movie-web/segments/`;
await ensureDirExists(segmentDir);
const updateProgress = () => {