fix: buffer manga image names
This commit is contained in:
parent
6ce41b8fbb
commit
1b4c8704ea
2 changed files with 6 additions and 1 deletions
|
@ -32,6 +32,7 @@ import ani.dantotsu.media.manga.MangaReadFragment.Companion.ACTION_DOWNLOAD_STAR
|
|||
import ani.dantotsu.media.manga.MangaReadFragment.Companion.EXTRA_CHAPTER_NUMBER
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.util.Logger
|
||||
import ani.dantotsu.util.NumberConverter.Companion.ofLength
|
||||
import com.anggrayudi.storage.file.deleteRecursively
|
||||
import com.anggrayudi.storage.file.forceDelete
|
||||
import com.anggrayudi.storage.file.openOutputStream
|
||||
|
@ -235,7 +236,7 @@ class MangaDownloaderService : Service() {
|
|||
}
|
||||
|
||||
if (bitmap != null) {
|
||||
saveToDisk("$index.jpg", outputDir, bitmap)
|
||||
saveToDisk("${index.ofLength(3)}.jpg", outputDir, bitmap)
|
||||
}
|
||||
farthest++
|
||||
|
||||
|
|
|
@ -47,5 +47,9 @@ class NumberConverter {
|
|||
val intBits = java.lang.Float.floatToIntBits(number)
|
||||
return Integer.toBinaryString(intBits)
|
||||
}
|
||||
|
||||
fun Int.ofLength(length: Int): String {
|
||||
return this.toString().padStart(length, '0')
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue