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

View File

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