v2.0.1 HotFix

This commit is contained in:
shabinder 2021-01-04 01:31:45 +05:30
parent de5156d29e
commit d3df8e7dde
7 changed files with 15 additions and 16 deletions

View File

@ -40,8 +40,8 @@ android {
//Some Os's Don't give Access to Music Dir , In API 29 if we Target 30
//noinspection OldTargetApi
targetSdkVersion 29
versionCode 12
versionName "2.0"
versionCode 13
versionName "2.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -38,13 +38,6 @@ abstract class BaseProvider {
* */
abstract suspend fun query(fullLink:String):PlatformQueryResult?
protected fun queryActiveTracks(context:Context?) {
val serviceIntent = Intent(context, ForegroundService::class.java).apply {
action = "query"
}
context?.let { ContextCompat.startForegroundService(it, serviceIntent) }
}
protected val defaultDir
get() = directories.defaultDir()
protected val imageDir

View File

@ -210,7 +210,6 @@ class GaanaProvider @Inject constructor(
else -> {//TODO Handle Error}
}
}
queryActiveTracks(ctx)
return result
}
}

View File

@ -228,7 +228,6 @@ class SpotifyProvider @Inject constructor(
}
}
}
queryActiveTracks(ctx)
return result
}

View File

@ -140,7 +140,6 @@ class YoutubeProvider @Inject constructor(
)
)
}
queryActiveTracks(ctx)
} catch (e: Exception) {
e.printStackTrace()
showDialog("An Error Occurred While Processing!")
@ -213,7 +212,6 @@ class YoutubeProvider @Inject constructor(
)
)
}
queryActiveTracks(ctx)
} catch (e: Exception) {
e.printStackTrace()
showDialog("An Error Occurred While Processing!")

View File

@ -17,6 +17,7 @@
package com.shabinder.spotiflyer.ui.tracklist
import android.content.Context
import android.content.Intent
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
@ -34,6 +35,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.content.ContextCompat
import androidx.core.net.toUri
import androidx.navigation.NavController
import com.shabinder.spotiflyer.R
@ -49,6 +51,7 @@ import com.shabinder.spotiflyer.ui.utils.calculateDominantColor
import com.shabinder.spotiflyer.utils.downloadTracks
import com.shabinder.spotiflyer.utils.sharedViewModel
import com.shabinder.spotiflyer.utils.showDialog
import com.shabinder.spotiflyer.worker.ForegroundService
import dev.chrisbanes.accompanist.coil.CoilImage
import kotlinx.coroutines.*
@ -64,6 +67,7 @@ fun TrackList(
youtubeProvider: YoutubeProvider,
modifier: Modifier = Modifier
){
val context = AmbientContext.current
val coroutineScope = rememberCoroutineScope()
var result by remember(fullLink) { mutableStateOf<PlatformQueryResult?>(null) }
@ -101,6 +105,7 @@ fun TrackList(
}
sharedViewModel.updateTrackList(result?.trackList ?: listOf())
queryActiveTracks(context)
result?.let{
val ctx = AmbientContext.current
@ -240,7 +245,12 @@ fun TrackCard(
}
}
}
private fun queryActiveTracks(context:Context?) {
val serviceIntent = Intent(context, ForegroundService::class.java).apply {
action = "query"
}
context?.let { ContextCompat.startForegroundService(it, serviceIntent) }
}
suspend fun updateGradient(imageURL:String,ctx:Context){
calculateDominantColor(imageURL,ctx)?.color
?.let { sharedViewModel.updateGradientColor(it) }

View File

@ -17,8 +17,8 @@
<AppUpdater>
<update>
<latestVersion>2.0</latestVersion>
<latestVersionCode>12</latestVersionCode>
<latestVersion>2.0.1</latestVersion>
<latestVersionCode>13</latestVersionCode>
<url>https://github.com/Shabinder/SpotiFlyer/releases/</url>
</update>
</AppUpdater>