Skip to content

Commit

Permalink
fix: subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
stitchrs committed May 11, 2023
1 parent ec489ab commit 07e7f0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ class ProfileManager(private val context: Context) : IProfileManager,
for (flag in flags) {
val info = flag.split("=")
when {
info[0].contains("upload") -> upload =
info[0].contains("upload") && info[1].isNotEmpty() -> upload =
BigDecimal(info[1]).longValueExact()

info[0].contains("download") -> download =
info[0].contains("download") && info[1].isNotEmpty() -> download =
BigDecimal(info[1]).longValueExact()

info[0].contains("total") -> total =
info[0].contains("total") && info[1].isNotEmpty() -> total =
BigDecimal(info[1]).longValueExact()

info[0].contains("expire") -> {
info[0].contains("expire") && info[1].isNotEmpty() -> {
if (info[1].isNotEmpty()) {
expire = (info[1].toDouble()*1000).toLong()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,17 @@ object ProfileProcessor {
for (flag in flags) {
val info = flag.split("=")
when {
info[0].contains("upload") -> upload =
info[0].contains("upload") && info[1].isNotEmpty() -> upload =
info[1].toLong()

info[0].contains("download") -> download =
info[0].contains("download") && info[1].isNotEmpty() -> download =
info[1].toLong()

info[0].contains("total") -> total =
info[0].contains("total") && info[1].isNotEmpty() -> total =
info[1].toLong()

info[0].contains("expire") -> {
if (info[1].isNotEmpty()) {
expire =
(info[1].toDouble() * 1000).toLong()
}
}
info[0].contains("expire") && info[1].isNotEmpty() -> expire =
(info[1].toDouble() * 1000).toLong()
}
}
}
Expand Down

0 comments on commit 07e7f0c

Please sign in to comment.