瀏覽代碼

Handle 1000+ pages properly in the downloader (#8818)

jobobby04 2 年之前
父節點
當前提交
611ec8103c
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt

+ 3 - 1
app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt

@@ -376,7 +376,9 @@ class Downloader(
             return Observable.just(page)
         }
 
-        val filename = String.format("%03d", page.number)
+        val digitCount = (download.pages?.size ?: 0).toString().length.coerceAtLeast(3)
+
+        val filename = String.format("%0${digitCount}d", page.number)
         val tmpFile = tmpDir.findFile("$filename.tmp")
 
         // Delete temp file if it exists.