mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2025-02-16 19:17:55 +01:00
v2.0.1 HotFix
This commit is contained in:
parent
de5156d29e
commit
d3df8e7dde
@ -40,8 +40,8 @@ android {
|
|||||||
//Some Os's Don't give Access to Music Dir , In API 29 if we Target 30
|
//Some Os's Don't give Access to Music Dir , In API 29 if we Target 30
|
||||||
//noinspection OldTargetApi
|
//noinspection OldTargetApi
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 12
|
versionCode 13
|
||||||
versionName "2.0"
|
versionName "2.0.1"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
@ -38,13 +38,6 @@ abstract class BaseProvider {
|
|||||||
* */
|
* */
|
||||||
abstract suspend fun query(fullLink:String):PlatformQueryResult?
|
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
|
protected val defaultDir
|
||||||
get() = directories.defaultDir()
|
get() = directories.defaultDir()
|
||||||
protected val imageDir
|
protected val imageDir
|
||||||
|
@ -210,7 +210,6 @@ class GaanaProvider @Inject constructor(
|
|||||||
else -> {//TODO Handle Error}
|
else -> {//TODO Handle Error}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryActiveTracks(ctx)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,6 @@ class SpotifyProvider @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
queryActiveTracks(ctx)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +140,6 @@ class YoutubeProvider @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
queryActiveTracks(ctx)
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
showDialog("An Error Occurred While Processing!")
|
showDialog("An Error Occurred While Processing!")
|
||||||
@ -213,7 +212,6 @@ class YoutubeProvider @Inject constructor(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
queryActiveTracks(ctx)
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
showDialog("An Error Occurred While Processing!")
|
showDialog("An Error Occurred While Processing!")
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
package com.shabinder.spotiflyer.ui.tracklist
|
package com.shabinder.spotiflyer.ui.tracklist
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
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.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import com.shabinder.spotiflyer.R
|
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.downloadTracks
|
||||||
import com.shabinder.spotiflyer.utils.sharedViewModel
|
import com.shabinder.spotiflyer.utils.sharedViewModel
|
||||||
import com.shabinder.spotiflyer.utils.showDialog
|
import com.shabinder.spotiflyer.utils.showDialog
|
||||||
|
import com.shabinder.spotiflyer.worker.ForegroundService
|
||||||
import dev.chrisbanes.accompanist.coil.CoilImage
|
import dev.chrisbanes.accompanist.coil.CoilImage
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
||||||
@ -64,6 +67,7 @@ fun TrackList(
|
|||||||
youtubeProvider: YoutubeProvider,
|
youtubeProvider: YoutubeProvider,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
){
|
){
|
||||||
|
val context = AmbientContext.current
|
||||||
val coroutineScope = rememberCoroutineScope()
|
val coroutineScope = rememberCoroutineScope()
|
||||||
|
|
||||||
var result by remember(fullLink) { mutableStateOf<PlatformQueryResult?>(null) }
|
var result by remember(fullLink) { mutableStateOf<PlatformQueryResult?>(null) }
|
||||||
@ -101,6 +105,7 @@ fun TrackList(
|
|||||||
}
|
}
|
||||||
|
|
||||||
sharedViewModel.updateTrackList(result?.trackList ?: listOf())
|
sharedViewModel.updateTrackList(result?.trackList ?: listOf())
|
||||||
|
queryActiveTracks(context)
|
||||||
|
|
||||||
result?.let{
|
result?.let{
|
||||||
val ctx = AmbientContext.current
|
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){
|
suspend fun updateGradient(imageURL:String,ctx:Context){
|
||||||
calculateDominantColor(imageURL,ctx)?.color
|
calculateDominantColor(imageURL,ctx)?.color
|
||||||
?.let { sharedViewModel.updateGradientColor(it) }
|
?.let { sharedViewModel.updateGradientColor(it) }
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
<AppUpdater>
|
<AppUpdater>
|
||||||
<update>
|
<update>
|
||||||
<latestVersion>2.0</latestVersion>
|
<latestVersion>2.0.1</latestVersion>
|
||||||
<latestVersionCode>12</latestVersionCode>
|
<latestVersionCode>13</latestVersionCode>
|
||||||
<url>https://github.com/Shabinder/SpotiFlyer/releases/</url>
|
<url>https://github.com/Shabinder/SpotiFlyer/releases/</url>
|
||||||
</update>
|
</update>
|
||||||
</AppUpdater>
|
</AppUpdater>
|
Loading…
Reference in New Issue
Block a user