Code Cleanup

This commit is contained in:
shabinder 2021-05-14 03:48:56 +05:30
parent 6d6a73c713
commit 0c67474be5
7 changed files with 2 additions and 44 deletions

View File

@ -1,8 +0,0 @@
package com.shabinder.common.models
import com.github.k1rakishou.fsaf.file.AbstractFile
// Use Storage Access Framework `SAF`
actual data class File(
val documentFile: AbstractFile?
)

View File

@ -1,18 +0,0 @@
package com.shabinder.common.models
import android.net.Uri
import com.github.k1rakishou.fsaf.manager.base_directory.BaseDirectory
import java.io.File
class SpotiFlyerBaseDir(
private val getDirType: ()-> ActiveBaseDirType,
private val getJavaFile: ()-> File?,
private val getSAFUri: ()-> Uri?
): BaseDirectory() {
override fun currentActiveBaseDirType(): ActiveBaseDirType = getDirType()
override fun getDirFile(): File? = getJavaFile()
override fun getDirUri(): Uri? = getSAFUri()
}

View File

@ -1,3 +0,0 @@
package com.shabinder.common.models
expect class File

View File

@ -1,3 +0,0 @@
package com.shabinder.common.models
actual typealias File = java.io.File

View File

@ -1,5 +0,0 @@
package com.shabinder.common.models
actual data class File(
val path: String
)

View File

@ -1,5 +0,0 @@
package com.shabinder.common.models
actual data class File(
val path: String
)

View File

@ -288,8 +288,8 @@ class ForegroundService : Service(), CoroutineScope {
messageList = mutableListOf("Cleaning And Exiting", "", "", "", "") messageList = mutableListOf("Cleaning And Exiting", "", "", "", "")
downloadService.close() downloadService.close()
updateNotification() updateNotification()
dir.defaultDir().documentFile?.let { cleanFiles(it,dir.fileManager,logger) } cleanFiles(File(dir.defaultDir()),logger)
cleanFiles(File(dir.imageCachePath + "Tracks/"),logger) // TODO cleanFiles(File(dir.imageCacheDir()))
messageList = mutableListOf("", "", "", "", "") messageList = mutableListOf("", "", "", "", "")
releaseWakeLock() releaseWakeLock()
serviceJob.cancel() serviceJob.cancel()