diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt index 117110d1..94a425bc 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/search/SearchFragment.kt @@ -105,7 +105,7 @@ class SearchFragment : Fragment() { } } builder.setTitle("Search Providers") - builder.setNegativeButton("Cancel") { _, _ -> } + builder.setNegativeButton("Ok") { _, _ -> } builder.show() } } diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt index 988aab21..10a07e66 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt @@ -448,7 +448,11 @@ object VideoDownloadManager { } } - val newFileUri = if (resume && currentExistingFile != null) currentExistingFile else { + var appendFile = false + val newFileUri = if (resume && currentExistingFile != null) { + appendFile = true + currentExistingFile + } else { val contentUri = MediaStore.Downloads.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY) // USE INSTEAD OF MediaStore.Downloads.EXTERNAL_CONTENT_URI @@ -456,10 +460,7 @@ object VideoDownloadManager { put(MediaStore.MediaColumns.DISPLAY_NAME, displayName) put(MediaStore.MediaColumns.TITLE, name) put(MediaStore.MediaColumns.MIME_TYPE, "video/mp4") - put( - MediaStore.MediaColumns.RELATIVE_PATH, - relativePath - ) + put(MediaStore.MediaColumns.RELATIVE_PATH, relativePath) } cr.insert( @@ -468,7 +469,7 @@ object VideoDownloadManager { ) ?: return ERROR_MEDIA_STORE_URI_CANT_BE_CREATED } - fileStream = cr.openOutputStream(newFileUri, "w") + fileStream = cr.openOutputStream(newFileUri, "w" + (if (appendFile) "a" else "")) ?: return ERROR_CONTENT_RESOLVER_CANT_OPEN_STREAM } else { // NORMAL NON SCOPED STORAGE FILE CREATION