From 0c67474be51df3a79c19c699cd62ff06b8c1fb61 Mon Sep 17 00:00:00 2001 From: shabinder Date: Fri, 14 May 2021 03:48:56 +0530 Subject: [PATCH] Code Cleanup --- .../AndroidMediaFile.kt | 8 -------- .../SpotiFlyerBaseDir.kt | 18 ------------------ .../kotlin/com/shabinder/common/models/File.kt | 3 --- .../common/models/DesktopMediaFile.kt | 3 --- .../IOSMediaFile.kt | 5 ----- .../WebMediaFile.kt | 5 ----- .../common/di/worker/ForegroundService.kt | 4 ++-- 7 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 common/data-models/src/androidMain/kotlin/com.shabinder.common.models/AndroidMediaFile.kt delete mode 100644 common/data-models/src/androidMain/kotlin/com.shabinder.common.models/SpotiFlyerBaseDir.kt delete mode 100644 common/data-models/src/commonMain/kotlin/com/shabinder/common/models/File.kt delete mode 100644 common/data-models/src/desktopMain/kotlin/com/shabinder/common/models/DesktopMediaFile.kt delete mode 100644 common/data-models/src/iosMain/kotlin/com.shabinder.common.models/IOSMediaFile.kt delete mode 100644 common/data-models/src/jsMain/kotlin/com.shabinder.common.models/WebMediaFile.kt diff --git a/common/data-models/src/androidMain/kotlin/com.shabinder.common.models/AndroidMediaFile.kt b/common/data-models/src/androidMain/kotlin/com.shabinder.common.models/AndroidMediaFile.kt deleted file mode 100644 index e0752650..00000000 --- a/common/data-models/src/androidMain/kotlin/com.shabinder.common.models/AndroidMediaFile.kt +++ /dev/null @@ -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? -) \ No newline at end of file diff --git a/common/data-models/src/androidMain/kotlin/com.shabinder.common.models/SpotiFlyerBaseDir.kt b/common/data-models/src/androidMain/kotlin/com.shabinder.common.models/SpotiFlyerBaseDir.kt deleted file mode 100644 index 6603b994..00000000 --- a/common/data-models/src/androidMain/kotlin/com.shabinder.common.models/SpotiFlyerBaseDir.kt +++ /dev/null @@ -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() -} \ No newline at end of file diff --git a/common/data-models/src/commonMain/kotlin/com/shabinder/common/models/File.kt b/common/data-models/src/commonMain/kotlin/com/shabinder/common/models/File.kt deleted file mode 100644 index 995a30ed..00000000 --- a/common/data-models/src/commonMain/kotlin/com/shabinder/common/models/File.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.shabinder.common.models - -expect class File \ No newline at end of file diff --git a/common/data-models/src/desktopMain/kotlin/com/shabinder/common/models/DesktopMediaFile.kt b/common/data-models/src/desktopMain/kotlin/com/shabinder/common/models/DesktopMediaFile.kt deleted file mode 100644 index 9fc04540..00000000 --- a/common/data-models/src/desktopMain/kotlin/com/shabinder/common/models/DesktopMediaFile.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.shabinder.common.models - -actual typealias File = java.io.File \ No newline at end of file diff --git a/common/data-models/src/iosMain/kotlin/com.shabinder.common.models/IOSMediaFile.kt b/common/data-models/src/iosMain/kotlin/com.shabinder.common.models/IOSMediaFile.kt deleted file mode 100644 index 3b6f93f3..00000000 --- a/common/data-models/src/iosMain/kotlin/com.shabinder.common.models/IOSMediaFile.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.shabinder.common.models - -actual data class File( - val path: String -) \ No newline at end of file diff --git a/common/data-models/src/jsMain/kotlin/com.shabinder.common.models/WebMediaFile.kt b/common/data-models/src/jsMain/kotlin/com.shabinder.common.models/WebMediaFile.kt deleted file mode 100644 index 3b6f93f3..00000000 --- a/common/data-models/src/jsMain/kotlin/com.shabinder.common.models/WebMediaFile.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.shabinder.common.models - -actual data class File( - val path: String -) \ No newline at end of file diff --git a/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/worker/ForegroundService.kt b/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/worker/ForegroundService.kt index 78ff1919..90b5f560 100644 --- a/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/worker/ForegroundService.kt +++ b/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/worker/ForegroundService.kt @@ -288,8 +288,8 @@ class ForegroundService : Service(), CoroutineScope { messageList = mutableListOf("Cleaning And Exiting", "", "", "", "") downloadService.close() updateNotification() - dir.defaultDir().documentFile?.let { cleanFiles(it,dir.fileManager,logger) } - cleanFiles(File(dir.imageCachePath + "Tracks/"),logger) + cleanFiles(File(dir.defaultDir()),logger) + // TODO cleanFiles(File(dir.imageCacheDir())) messageList = mutableListOf("", "", "", "", "") releaseWakeLock() serviceJob.cancel()