mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	clear the cache for a item when a wikiItem is updated.
This commit is contained in:
		
							parent
							
								
									5985e9ad9c
								
							
						
					
					
						commit
						7aaf9cb59a
					
				
					 1 changed files with 12 additions and 2 deletions
				
			
		|  | @ -30,6 +30,7 @@ import fr.free.nrw.commons.customselector.database.UploadedStatus | |||
| import fr.free.nrw.commons.customselector.database.UploadedStatusDao | ||||
| import fr.free.nrw.commons.di.ApplicationlessInjection | ||||
| import fr.free.nrw.commons.media.MediaClient | ||||
| import fr.free.nrw.commons.nearby.PlacesRepository | ||||
| import fr.free.nrw.commons.theme.BaseActivity | ||||
| import fr.free.nrw.commons.upload.FileUtilsWrapper | ||||
| import fr.free.nrw.commons.upload.StashUploadResult | ||||
|  | @ -74,6 +75,9 @@ class UploadWorker( | |||
|     @Inject | ||||
|     lateinit var fileUtilsWrapper: FileUtilsWrapper | ||||
| 
 | ||||
|     @Inject | ||||
|     lateinit var placesRepository: PlacesRepository | ||||
| 
 | ||||
|     private val processingUploadsNotificationTag = BuildConfig.APPLICATION_ID + " : upload_tag" | ||||
| 
 | ||||
|     private val processingUploadsNotificationId = 101 | ||||
|  | @ -379,7 +383,7 @@ class UploadWorker( | |||
|                                 saveCompletedContribution(contribution, uploadResult) | ||||
|                             } else { | ||||
|                                 Timber.d( | ||||
|                                     "WikiDataEdit not required, making wikidata edit", | ||||
|                                     "WikiDataEdit required, making wikidata edit", | ||||
|                                 ) | ||||
|                                 makeWikiDataEdit(uploadResult, contribution) | ||||
|                             } | ||||
|  | @ -476,7 +480,13 @@ class UploadWorker( | |||
|                 } catch (exception: Exception) { | ||||
|                     Timber.e(exception) | ||||
|                 } | ||||
| 
 | ||||
|                 withContext(Dispatchers.IO) { | ||||
|                     val place = placesRepository.fetchPlace(wikiDataPlace.id); | ||||
|                     Timber.d("Clearing cache for place: $place") | ||||
|                     if (null != place) { | ||||
|                         placesRepository.deletePlace(place); | ||||
|                     } | ||||
|                 } | ||||
|                 withContext(Dispatchers.Main) { | ||||
|                     wikidataEditService.handleImageClaimResult( | ||||
|                         contribution.wikidataPlace, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Christo Joby Antony
						Christo Joby Antony