Skip to content

Commit

Permalink
[Update] Torrent stream library
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhPatange committed Dec 10, 2022
1 parent 4e46902 commit dd9aa97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions app/src/main/java/com/kpstv/yts/services/DownloadService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class DownloadService : IntentService("blank") {
updateNotification(model, torrent, false, status)
DS_LOG(
"=> Progress: ${status?.progress}, Download queue: ${torrent?.torrentHandle?.downloadQueue?.size}, " +
"Piece availability: ${torrent?.torrentHandle?.pieceAvailability?.size}, " +
"Piece availability: ${torrent?.torrentHandle?.pieceAvailability()?.size}, " +
"Piece size: ${torrent?.torrentHandle?.torrentFile()
?.numPieces()}, " +
"Pieces to prepare: ${torrent?.piecesToPrepare}"
Expand Down Expand Up @@ -341,7 +341,7 @@ class DownloadService : IntentService("blank") {
model.banner_url,
status.progress.toInt(),
status.seeds,
status.downloadSpeed,
status.downloadSpeed.toFloat(),
0,
torrent?.torrentHandle?.torrentFile()?.totalSize(),
true,
Expand All @@ -360,15 +360,14 @@ class DownloadService : IntentService("blank") {

/** Update the notification channel */

var speed = status?.downloadSpeed
speed ?: kotlin.run { speed = 0f }
val speed = status?.downloadSpeed ?: 0

var progress = status?.progress
progress ?: kotlin.run { progress = 0f }

setContentIntent(model, torrentJob)

val speedString = formatDownloadSpeed(speed as Float)
val speedString = formatDownloadSpeed(speed.toFloat())

val notificationBuilder =
NotificationCompat.Builder(context, getString(R.string.CHANNEL_ID_1))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/LibraryDependency.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private object LibraryVersion {
const val BLURRY = "3.0.0"
const val JSOUP = "1.13.1"
const val YOUTUBE_PLAYER = "10.0.5"
const val TORRENT = "2.5.0"
const val TORRENT = "3.0.0"
const val CAFEBAR = "1.3.1"
const val LOCALBROADCAST = "1.0.0"
const val PHOTOVIEW = "2.0.0"
Expand Down

0 comments on commit dd9aa97

Please sign in to comment.