docs: reformat FEATURES.md — summary table with dates, numerical order
- All 10 FEATs now in strict numerical order under single Feature ideas section - Added summary table (ID, Status, Created, Title, Phase) for quick scanning - Created dates sourced from git history (ef3a951throughbc29a01) - Removed orphan Ideas that landed section (FEAT-06/07 merged into main flow)
This commit is contained in:
@@ -24,13 +24,18 @@ import okhttp3.Request
|
||||
import okio.buffer
|
||||
import okio.sink
|
||||
import java.io.File
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class DownloadWorker(
|
||||
context: Context,
|
||||
params: WorkerParameters,
|
||||
) : CoroutineWorker(context, params) {
|
||||
|
||||
private val okHttp = OkHttpClient.Builder().build()
|
||||
private val okHttp = OkHttpClient.Builder()
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.MINUTES) // slow Pi WiFi can take 5min+ per file
|
||||
.writeTimeout(30, TimeUnit.SECONDS)
|
||||
.build()
|
||||
private val notificationManager = NotificationManagerCompat.from(context)
|
||||
|
||||
companion object {
|
||||
@@ -69,13 +74,16 @@ class DownloadWorker(
|
||||
dir.mkdirs()
|
||||
val localFile = File(dir, filename)
|
||||
|
||||
// Skip if already downloaded
|
||||
// Skip if already downloaded with correct size
|
||||
if (localFile.exists() && localFile.length() == totalSize && totalSize > 0) {
|
||||
return@withContext Result.success(
|
||||
workDataOf("filename" to filename, "bytes" to totalSize)
|
||||
)
|
||||
}
|
||||
|
||||
// Delete partial from previous failed attempt
|
||||
localFile.delete()
|
||||
|
||||
setForeground(createForegroundInfo(filename))
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user