mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-11 07:29:14 +01:00
downloads: skip redundant progress writes
This commit is contained in:
@@ -543,7 +543,7 @@ class DownloadRepository(
|
|||||||
EngineStatus.Failed -> DownloadStatus.Failed
|
EngineStatus.Failed -> DownloadStatus.Failed
|
||||||
}
|
}
|
||||||
if (status == DownloadStatus.Failed) file.delete()
|
if (status == DownloadStatus.Failed) file.delete()
|
||||||
db.downloadDao().upsert(
|
val updated =
|
||||||
row.copy(
|
row.copy(
|
||||||
status = status,
|
status = status,
|
||||||
bytes = state.bytes,
|
bytes = state.bytes,
|
||||||
@@ -561,8 +561,8 @@ class DownloadRepository(
|
|||||||
} else {
|
} else {
|
||||||
row.downloadedAt
|
row.downloadedAt
|
||||||
},
|
},
|
||||||
),
|
)
|
||||||
)
|
if (updated != row) db.downloadDao().upsert(updated)
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun markFailed(
|
private suspend fun markFailed(
|
||||||
|
|||||||
Reference in New Issue
Block a user