From f746b3c8225456b386c621ee75193dd59049f3ef Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:19:02 +0100 Subject: [PATCH 1/2] fix expected path for converted audio not matching youtube-dl --- .../io/github/shadow578/yodel/downloader/TempFiles.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/io/github/shadow578/yodel/downloader/TempFiles.kt b/app/src/main/kotlin/io/github/shadow578/yodel/downloader/TempFiles.kt index 5d68bfc..d457898 100644 --- a/app/src/main/kotlin/io/github/shadow578/yodel/downloader/TempFiles.kt +++ b/app/src/main/kotlin/io/github/shadow578/yodel/downloader/TempFiles.kt @@ -23,14 +23,14 @@ class TempFiles(tempFile: File, format: String) { /** * the main audio file downloaded by youtube-dl. - * this file will be the same as [.convertedAudio], but with a .tmp extension */ private val downloadedAudio: File = File(tempFile.absolutePath + ".tmp") /** - * the converted audio file, created by ffmpeg with the --extract-audio option + * the converted audio file, created by ffmpeg with the --extract-audio option. + * this file will be the same as [.downloadedAudio], but with the format extension added to it (*.tmp.) */ - private val convertedAudio: File = File(tempFile.absolutePath + "." + format) + private val convertedAudio: File = File(downloadedAudio.absolutePath + "." + format) /** * delete all files From 9d6f45935e91b0f7a2831beabde44ad7af1b832c Mon Sep 17 00:00:00 2001 From: shadow578 <52449218+shadow578@users.noreply.github.com> Date: Fri, 10 Mar 2023 12:19:40 +0100 Subject: [PATCH 2/2] bump gradle and dependencies --- app/build.gradle.kts | 29 ++++++++++--------- .../io/github/shadow578/yodel/TestUtil.kt | 4 +-- build.gradle.kts | 4 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a37ba50..2a97848 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,3 +1,4 @@ +@file:Suppress("UnstableApiUsage") import java.io.FileInputStream import java.util.* @@ -96,23 +97,24 @@ dependencies { // androidX implementation("androidx.core:core-ktx:1.9.0") implementation("androidx.constraintlayout:constraintlayout:2.1.4") - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1") - implementation("androidx.lifecycle:lifecycle-service:2.5.1") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0") + implementation("androidx.lifecycle:lifecycle-service:2.6.0") implementation("androidx.legacy:legacy-support-v4:1.0.0") implementation("androidx.preference:preference-ktx:1.2.0") // material design - implementation("com.google.android.material:material:1.6.1") + implementation("com.google.android.material:material:1.8.0") // Room - implementation("androidx.room:room-runtime:2.4.3") - kapt("androidx.room:room-compiler:2.4.3") + implementation("androidx.room:room-runtime:2.5.0") + kapt("androidx.room:room-compiler:2.5.0") // youtube-dl - implementation("com.github.yausername.youtubedl-android:library:0.14.0") - implementation("com.github.yausername.youtubedl-android:ffmpeg:0.14.0") - implementation("com.github.yausername.youtubedl-android:aria2c:0.14.0") + //TODO: currently uses the latest version available. This makes the build unstable! + implementation("com.github.yausername.youtubedl-android:library:master-SNAPSHOT") + implementation("com.github.yausername.youtubedl-android:ffmpeg:master-SNAPSHOT") + implementation("com.github.yausername.youtubedl-android:aria2c:master-SNAPSHOT") // id3v2 tagging implementation("com.mpatric:mp3agic:0.9.1") @@ -132,15 +134,14 @@ dependencies { implementation("com.mikepenz:aboutlibraries:8.9.4") // desugaring - //TODO 2.0.0 is only available with AGP > 7.4.0 - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.0") + coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.2") // unit testing - testImplementation("androidx.test.ext:junit:1.1.3") + testImplementation("androidx.test.ext:junit:1.1.5") testImplementation("org.robolectric:robolectric:4.8.2") testImplementation("io.kotest:kotest-assertions-core:5.4.2") - androidTestImplementation("androidx.test:runner:1.4.0") - androidTestImplementation("androidx.test:rules:1.4.0") + androidTestImplementation("androidx.test:runner:1.5.2") + androidTestImplementation("androidx.test:rules:1.5.0") androidTestImplementation("io.kotest:kotest-assertions-core:5.4.2") // leakcanary (only on debug builds) diff --git a/app/src/test/kotlin/io/github/shadow578/yodel/TestUtil.kt b/app/src/test/kotlin/io/github/shadow578/yodel/TestUtil.kt index 602fb86..3727805 100644 --- a/app/src/test/kotlin/io/github/shadow578/yodel/TestUtil.kt +++ b/app/src/test/kotlin/io/github/shadow578/yodel/TestUtil.kt @@ -21,8 +21,8 @@ fun LiveData.getOrAwaitValue( var data: T? = null val latch = CountDownLatch(1) val observer = object : Observer { - override fun onChanged(o: T?) { - data = o + override fun onChanged(value: T) { + data = value latch.countDown() this@getOrAwaitValue.removeObserver(this) } diff --git a/build.gradle.kts b/build.gradle.kts index ec8a3a5..12a5cef 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,8 +6,8 @@ buildscript { maven { setUrl("https://plugins.gradle.org/m2/") } } dependencies { - classpath("com.android.tools.build:gradle:7.3.0") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10") + classpath("com.android.tools.build:gradle:7.4.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10") classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:8.9.4") // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 150e51a..25475a3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Jul 18 10:54:22 CEST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME