mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-02 15:53:55 +01:00
The issue with database access has been fixed: due to incorrect database access, the access failed, causing a crash at the end of the upload, which made normal testing impossible. The UploadWorker has been fixed to ensure that database access occurs on the correct thread.
This commit is contained in:
parent
7c58891892
commit
3c80d205fa
1 changed files with 10 additions and 8 deletions
|
|
@ -535,14 +535,16 @@ class UploadWorker(
|
||||||
val imageSha1 = contribution.imageSHA1.toString()
|
val imageSha1 = contribution.imageSHA1.toString()
|
||||||
val modifiedSha1 = fileUtilsWrapper.getSHA1(fileUtilsWrapper.getFileInputStream(contribution.localUri?.path))
|
val modifiedSha1 = fileUtilsWrapper.getSHA1(fileUtilsWrapper.getFileInputStream(contribution.localUri?.path))
|
||||||
MainScope().launch {
|
MainScope().launch {
|
||||||
uploadedStatusDao.insertUploaded(
|
withContext(Dispatchers.IO){
|
||||||
UploadedStatus(
|
uploadedStatusDao.insertUploaded(
|
||||||
imageSha1,
|
UploadedStatus(
|
||||||
modifiedSha1,
|
imageSha1,
|
||||||
imageSha1 == modifiedSha1,
|
modifiedSha1,
|
||||||
true,
|
imageSha1 == modifiedSha1,
|
||||||
),
|
true,
|
||||||
)
|
),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue