mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
removed prints
This commit is contained in:
parent
b7c4ab06a7
commit
d6ab75759e
1 changed files with 1 additions and 7 deletions
|
@ -471,7 +471,6 @@ object VideoDownloadManager {
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.Q)
|
@RequiresApi(Build.VERSION_CODES.Q)
|
||||||
private fun ContentResolver.getExistingDownloadUriOrNullQ(relativePath: String, displayName: String): Uri? {
|
private fun ContentResolver.getExistingDownloadUriOrNullQ(relativePath: String, displayName: String): Uri? {
|
||||||
println("GETTING INFO $relativePath :::::::::. $displayName")
|
|
||||||
try {
|
try {
|
||||||
val projection = arrayOf(
|
val projection = arrayOf(
|
||||||
MediaStore.MediaColumns._ID,
|
MediaStore.MediaColumns._ID,
|
||||||
|
@ -874,7 +873,7 @@ object VideoDownloadManager {
|
||||||
|
|
||||||
// Not present in latest testing.
|
// Not present in latest testing.
|
||||||
|
|
||||||
println("Going to dir $directoryName from ${this.uri} ---- ${this.filePath}")
|
// println("Going to dir $directoryName from ${this.uri} ---- ${this.filePath}")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val allDirectories = directoryName?.split("/")
|
val allDirectories = directoryName?.split("/")
|
||||||
|
@ -939,7 +938,6 @@ object VideoDownloadManager {
|
||||||
* Should only be used to get a download path.
|
* Should only be used to get a download path.
|
||||||
* */
|
* */
|
||||||
private fun basePathToFile(context: Context, path: String?): UniFile? {
|
private fun basePathToFile(context: Context, path: String?): UniFile? {
|
||||||
println("BASE TO FILE $path")
|
|
||||||
return when {
|
return when {
|
||||||
path.isNullOrBlank() -> getDownloadDir()
|
path.isNullOrBlank() -> getDownloadDir()
|
||||||
path.startsWith("content://") -> UniFile.fromUri(context, path.toUri())
|
path.startsWith("content://") -> UniFile.fromUri(context, path.toUri())
|
||||||
|
@ -955,13 +953,10 @@ object VideoDownloadManager {
|
||||||
fun Context.getBasePath(): Pair<UniFile?, String?> {
|
fun Context.getBasePath(): Pair<UniFile?, String?> {
|
||||||
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
|
val settingsManager = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
val basePathSetting = settingsManager.getString(getString(R.string.download_path_key), null)
|
val basePathSetting = settingsManager.getString(getString(R.string.download_path_key), null)
|
||||||
println("GET CURRENT path $basePathSetting")
|
|
||||||
|
|
||||||
return basePathToFile(this, basePathSetting) to basePathSetting
|
return basePathToFile(this, basePathSetting) to basePathSetting
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun UniFile?.isDownloadDir(): Boolean {
|
private fun UniFile?.isDownloadDir(): Boolean {
|
||||||
println("DOWNLOAD DIR $this ${this?.filePath} ${this?.uri}")
|
|
||||||
return this != null && this.filePath == getDownloadDir()?.filePath
|
return this != null && this.filePath == getDownloadDir()?.filePath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -985,7 +980,6 @@ object VideoDownloadManager {
|
||||||
} else {
|
} else {
|
||||||
val dir = basePath?.gotoDir(folder)
|
val dir = basePath?.gotoDir(folder)
|
||||||
val file = dir?.findFile(displayName)
|
val file = dir?.findFile(displayName)
|
||||||
println("FOUND FILE ${file?.filePath} ${file?.uri} ${file?.exists()}")
|
|
||||||
val success = file?.delete()
|
val success = file?.delete()
|
||||||
if (success != true) return ERROR_DELETING_FILE else {
|
if (success != true) return ERROR_DELETING_FILE else {
|
||||||
// Cleans up empty directory
|
// Cleans up empty directory
|
||||||
|
|
Loading…
Reference in a new issue