mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
correct
This commit is contained in:
parent
bb14edfe70
commit
9a66a74a49
3 changed files with 3 additions and 10 deletions
|
|
@ -269,11 +269,8 @@ class UploadClient
|
|||
uniqueFileName!!,
|
||||
fileKey!!,
|
||||
).map { uploadResponse: JsonObject? ->
|
||||
Timber.d(uploadResponse.toString())
|
||||
val uploadResult = gson.fromJson(uploadResponse, UploadResponse::class.java)
|
||||
|
||||
if (uploadResult.upload == null) {
|
||||
// Parse the error to MwException
|
||||
val exception = gson.fromJson(uploadResponse, MwException::class.java)
|
||||
Timber.e(exception, "Error in uploading file from stash")
|
||||
|
||||
|
|
|
|||
|
|
@ -469,21 +469,18 @@ class UploadWorker(
|
|||
contribution: Contribution,
|
||||
) {
|
||||
val wikiDataPlace = contribution.wikidataPlace
|
||||
|
||||
if (wikiDataPlace != null) {
|
||||
if (!contribution.hasInvalidLocation()) {
|
||||
var revisionID: Long? = null
|
||||
try {
|
||||
// Always attempt to update the image claim with the latest photo
|
||||
revisionID = wikidataEditService.createClaim(
|
||||
revisionID =
|
||||
wikidataEditService.createClaim(
|
||||
wikiDataPlace,
|
||||
uploadResult.filename,
|
||||
contribution.media.captions,
|
||||
)
|
||||
|
||||
if (null != revisionID) {
|
||||
withContext(Dispatchers.IO) {
|
||||
// Fetch and update place details
|
||||
val place = placesRepository.fetchPlace(wikiDataPlace.id)
|
||||
place.name = wikiDataPlace.name
|
||||
place.pic = HOME_URL + uploadResult.createCanonicalFileName()
|
||||
|
|
@ -514,7 +511,6 @@ class UploadWorker(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
saveCompletedContribution(contribution, uploadResult)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class WikiBaseClient
|
|||
* @param filename name of the file
|
||||
* @param data data of the depicts to be uploaded
|
||||
* @return Observable<Boolean>
|
||||
</Boolean> */
|
||||
</Boolean> */
|
||||
fun postEditEntityByFilename(
|
||||
filename: String?,
|
||||
data: String?,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue