diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index ac6b0aec..8d4ad2e2 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -12,6 +12,7 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 22d54822..f286018e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -71,7 +71,7 @@ android {
dependencies {
- implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation fileTree(dir: 'libs', include:['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
@@ -82,12 +82,14 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
+ implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7"
implementation "androidx.room:room-runtime:2.2.5"
+ implementation project(path: ':mobile-ffmpeg')
kapt "androidx.room:room-compiler:2.2.5"
implementation "androidx.room:room-ktx:2.2.5"
implementation ("com.github.bumptech.glide:recyclerview-integration:4.11.0") {
@@ -97,7 +99,6 @@ dependencies {
transitive = true
}
- implementation 'androidx.recyclerview:recyclerview:1.1.0'
// Authentication Way Changed!
// implementation ('com.google.apis:google-api-services-youtube:v3-rev180-1.22.0'){
// exclude module: 'httpclient'
@@ -115,8 +116,6 @@ dependencies {
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
implementation 'com.mpatric:mp3agic:0.9.1'
- implementation 'com.arthenica:mobile-ffmpeg-audio:4.4.LTS'
-
implementation 'com.shreyaspatil:EasyUpiPayment:2.2'
implementation 'com.github.sealedtx:java-youtube-downloader:2.2.3'
implementation "androidx.tonyodev.fetch2:xfetch2:3.1.4"
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0d4c26b1..81bbfd1c 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -28,7 +28,6 @@
-
diff --git a/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt b/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt
index 31bb2034..5a213608 100644
--- a/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt
+++ b/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt
@@ -230,14 +230,13 @@ class ForegroundService : Service(){
/**
* Deleting All Residual Files except Mp3 Files
- * */
+ **/
private fun deleteFile(dir:File) {
Log.i(tag,"Starting Deletions in ${dir.path} ")
val fList = dir.listFiles()
fList?.let {
for (file in fList) {
if (file.isDirectory) {
- Log.i(tag,"Cleaning ${file.path} Directory")
deleteFile(file)
} else if(file.isFile) {
if(file.path.toString().substringAfterLast(".") != "mp3"){
@@ -294,12 +293,6 @@ class ForegroundService : Service(){
}
Log.i(tag,"${track?.name} Download Started")
updateNotification()
-
- val link = "https://m.youtube.com/watch?v=shCX5YgU9yc"
- var result = ""
- result = link.removePrefix("https://")
- result = link.removePrefix("http://")
-
}
override fun onWaitingNetwork(download: Download) {
@@ -325,10 +318,10 @@ class ForegroundService : Service(){
Log.i(tag,"${track?.name} Download Failed! Error:Fetch!!!!")
Log.i(tag,"${track?.name} Requesting Download thru Android DM")
downloadUsingDM(download.request.url,download.request.file, track!!)
+ downloaded++
+ requestMap.remove(download.request)
}
}
- downloaded++
- requestMap.remove(download.request)
if(requestMap.keys.toList().isEmpty()) speed = 0
updateNotification()
}
@@ -346,12 +339,14 @@ class ForegroundService : Service(){
}
override fun onError(download: Download, error: Error, throwable: Throwable?) {
- val track = requestMap[download.request]
- Log.i(tag,download.error.throwable.toString())
- Log.i(tag,"${track?.name} Requesting Download thru Android DM")
- downloadUsingDM(download.request.url,download.request.file, track!!)
- downloaded++
- requestMap.remove(download.request)
+ serviceScope.launch {
+ val track = requestMap[download.request]
+ downloaded++
+ Log.i(tag,download.error.throwable.toString())
+ Log.i(tag,"${track?.name} Requesting Download thru Android DM")
+ downloadUsingDM(download.request.url,download.request.file, track!!)
+ requestMap.remove(download.request)
+ }
updateNotification()
}
diff --git a/settings.gradle b/settings.gradle
index 67bd13f5..1601f6e2 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -14,6 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+include ':mobile-ffmpeg'
include ':app'
rootProject.name = "spotiflyer"