diff --git a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt index fedb4d13..d764162f 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/DownloadHelper.kt @@ -130,6 +130,7 @@ object DownloadHelper { } } override fun onFailure(call: Call, t: Throwable) { + if(t.message.toString().contains("Failed to connect")) showMessage("Failed, Check Your Internet Connection!") Log.i("YT API Req. Fail",t.message.toString()) } } diff --git a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/YoutubeProvider.kt b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/YoutubeProvider.kt index 743f2dd0..2ffe02ea 100644 --- a/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/YoutubeProvider.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/downloadHelper/YoutubeProvider.kt @@ -128,12 +128,12 @@ fun getYTTracks(response: String):List{ ) } } - //Log.i("Text Api",availableDetails.toString()) + Log.i("Text Api",availableDetails.toString()) /* ! Filter Out non-Song/Video results and incomplete results here itself ! From what we know about detail order, note that [1] - indicate result type */ - if ( availableDetails.size > 1 && availableDetails[1] in listOf("Song","Video") ){ + if ( availableDetails.size == 5 && availableDetails[1] in listOf("Song","Video") ){ // skip if result is in hours instead of minutes (no song is that long) if(availableDetails[4].split(':').size != 2) continue //Has Been Giving Issues 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 430de1c9..edb8b844 100755 --- a/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt +++ b/app/src/main/java/com/shabinder/spotiflyer/worker/ForegroundService.kt @@ -630,9 +630,9 @@ class ForegroundService : Service(){ ) } "gaana" -> { - File( - Environment.getExternalStorageDirectory(), - Provider.defaultDir +".Images/" + (url.substringBeforeLast('/').substringAfterLast('/')) + ".jpeg") + File( + Environment.getExternalStorageDirectory(), + Provider.defaultDir +".Images/" + (url.substringBeforeLast('/').substringAfterLast('/')) + ".jpeg") } else -> File( Environment.getExternalStorageDirectory(),