From f9d24ccf11faa564a26ac10be6e269cf75de85d3 Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Sat, 18 Sep 2021 12:30:20 +0200 Subject: [PATCH 1/2] delete downloaded audio files when removing tracks --- .../io/github/shadow578/yodel/ui/tracks/TracksFragment.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/kotlin/io/github/shadow578/yodel/ui/tracks/TracksFragment.kt b/app/src/main/kotlin/io/github/shadow578/yodel/ui/tracks/TracksFragment.kt index 632b6ca..562e275 100644 --- a/app/src/main/kotlin/io/github/shadow578/yodel/ui/tracks/TracksFragment.kt +++ b/app/src/main/kotlin/io/github/shadow578/yodel/ui/tracks/TracksFragment.kt @@ -14,6 +14,7 @@ import io.github.shadow578.yodel.db.TracksDB import io.github.shadow578.yodel.db.model.* import io.github.shadow578.yodel.ui.base.BaseFragment import io.github.shadow578.yodel.util.* +import io.github.shadow578.yodel.util.storage.decodeToFile import io.github.shadow578.yodel.util.storage.decodeToUri /** @@ -80,6 +81,13 @@ class TracksFragment : BaseFragment() { ) { track: TrackInfo -> launchIO { + // remove the file + track.audioFileKey.decodeToFile(this@TracksFragment.requireContext())?.delete() + + // remove the cover + track.coverKey.decodeToFile(this@TracksFragment.requireContext())?.delete() + + // remove from DB TracksDB.get(this@TracksFragment.requireContext()).tracks() .remove(track) } From b8bcfd4b91f43c0f06968d0dd5dcfbcf4ad57312 Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Wed, 6 Oct 2021 18:37:09 +0200 Subject: [PATCH 2/2] bump version to 1.2 --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 890bc88..e833d3b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -25,7 +25,7 @@ android { targetSdk = 30 compileSdk = 30 versionCode = 2 - versionName = "1.1" + versionName = "1.2" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" kapt {