fix: it was only an int for convenience (#330)

Probably would have saved a lot of elaborate attempts to fix the issue by simply going the other way.
This commit is contained in:
TwistedUmbrellaX 2024-04-05 22:53:25 -04:00 committed by GitHub
parent 771cdcc163
commit 9ace8e5235
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -993,7 +993,7 @@ fun countDown(media: Media, view: ViewGroup) {
fun sinceWhen(media: Media, view: ViewGroup) {
CoroutineScope(Dispatchers.IO).launch {
MangaUpdates().search(media.name ?: media.nameRomaji, media.startDate)?.let {
val latestChapter = MangaUpdates.getLatestChapter(it) ?: return@let
val latestChapter = MangaUpdates.getLatestChapter(it)
val timeSince = (System.currentTimeMillis() -
(it.metadata.series.lastUpdated!!.timestamp * 1000)) / 1000

View file

@ -43,9 +43,9 @@ class MangaUpdates {
}
companion object {
fun getLatestChapter(results: MangaUpdatesResponse.Results): Int? {
return results.metadata.series.latestChapter
?: results.record.chapter!!.substringAfterLast("-").trim().toIntOrNull()
fun getLatestChapter(results: MangaUpdatesResponse.Results): String {
return results.metadata.series.latestChapter?.toString()
?: results.record.chapter!!.substringAfterLast("-").trim()
}
}

View file

@ -503,7 +503,7 @@
<string name="refresh_token_load_failed">Refresh Token : Failed to load Saved Token</string>
<string name="refreshing_token_failed">Refreshing Token Failed</string>
<string name="episode_release_countdown">Episode %1$d will be released in</string>
<string name="chapter_release_timeout">Chapter %1$d has been available for</string>
<string name="chapter_release_timeout">Chapter %1$s has been available for</string>
<string name="time_format">%1$d days %2$d hrs %3$d mins %4$d secs</string>
<string-array name="sort_by">
<item>Score</item>