Version Bumped to 2.3.0

This commit is contained in:
shabinder 2021-05-07 00:39:33 +05:30
parent 60b2f04780
commit 5118aa10c4
2 changed files with 67 additions and 69 deletions

View File

@ -18,7 +18,7 @@
object Versions { object Versions {
// App's Version (To be bumped at each update) // App's Version (To be bumped at each update)
const val versionName = "2.2.5" const val versionName = "2.3.0"
// Kotlin // Kotlin
const val kotlinVersion = "1.4.32" const val kotlinVersion = "1.4.32"
@ -45,7 +45,7 @@ object Versions {
const val slf4j = "1.7.30" const val slf4j = "1.7.30"
// Android // Android
const val versionCode = 16 const val versionCode = 17
const val minSdkVersion = 21 const val minSdkVersion = 21
const val compileSdkVersion = 29 const val compileSdkVersion = 29
const val targetSdkVersion = 29 const val targetSdkVersion = 29

View File

@ -163,6 +163,7 @@ class ForegroundService : Service(), CoroutineScope {
private fun downloadAllTracks(trackList: List<TrackDetails>) { private fun downloadAllTracks(trackList: List<TrackDetails>) {
trackList.forEach { trackList.forEach {
launch(Dispatchers.IO) { launch(Dispatchers.IO) {
downloadService.execute {
if (!it.videoID.isNullOrBlank()) { // Video ID already known! if (!it.videoID.isNullOrBlank()) { // Video ID already known!
downloadTrack(it.videoID!!, it) downloadTrack(it.videoID!!, it)
} else { } else {
@ -181,6 +182,7 @@ class ForegroundService : Service(), CoroutineScope {
} }
} }
} }
}
private suspend fun downloadTrack(videoID: String, track: TrackDetails) { private suspend fun downloadTrack(videoID: String, track: TrackDetails) {
try { try {
@ -197,7 +199,7 @@ class ForegroundService : Service(), CoroutineScope {
} }
} }
private fun enqueueDownload(url: String, track: TrackDetails) { private suspend fun enqueueDownload(url: String, track: TrackDetails) {
// Initiating Download // Initiating Download
addToNotification("Downloading ${track.title}") addToNotification("Downloading ${track.title}")
logger.d(tag) { "${track.title} Download Started" } logger.d(tag) { "${track.title} Download Started" }
@ -205,8 +207,6 @@ class ForegroundService : Service(), CoroutineScope {
sendTrackBroadcast(Status.DOWNLOADING.name, track) sendTrackBroadcast(Status.DOWNLOADING.name, track)
// Enqueueing Download // Enqueueing Download
launch {
downloadService.execute {
downloadFile(url).collect { downloadFile(url).collect {
when (it) { when (it) {
is DownloadResult.Error -> { is DownloadResult.Error -> {
@ -261,8 +261,6 @@ class ForegroundService : Service(), CoroutineScope {
} }
} }
} }
}
}
/** /**
* If fetch Fails , Android Download Manager To RESCUE!! * If fetch Fails , Android Download Manager To RESCUE!!