1818import io .reactivex .schedulers .Schedulers ;
1919import timber .log .Timber ;
2020
21+ /**
22+ * This class is meant to handle the Wikidata edits made through the app
23+ * It will talk with MediaWikiApi to make necessary API calls, log the edits and fire listeners
24+ * on successful edits
25+ */
2126@ Singleton
2227public class WikidataEditService {
2328
@@ -37,6 +42,11 @@ public WikidataEditService(Context context,
3742 this .directPrefs = directPrefs ;
3843 }
3944
45+ /**
46+ * Create a P18 claim and log the edit with custom tag
47+ * @param wikidataEntityId
48+ * @param fileName
49+ */
4050 public void createClaimWithLogging (String wikidataEntityId , String fileName ) {
4151 editWikidataProperty (wikidataEntityId , fileName );
4252 }
@@ -75,6 +85,10 @@ private void handleClaimResult(String wikidataEntityId, String revisionId) {
7585 }
7686 }
7787
88+ /**
89+ * Log the Wikidata edit by adding Wikimedia Commons App tag to the edit
90+ * @param revisionId
91+ */
7892 @ SuppressLint ("CheckResult" )
7993 private void logEdit (String revisionId ) {
8094 Observable .fromCallable (() -> mediaWikiApi .addWikidataEditTag (revisionId ))
@@ -91,6 +105,9 @@ private void logEdit(String revisionId) {
91105 });
92106 }
93107
108+ /**
109+ * Show a success toast when the edit is made successfully
110+ */
94111 private void showSuccessToast () {
95112 String title = directPrefs .getString ("Title" , "" );
96113 String successStringTemplate = context .getString (R .string .successful_wikidata_edit );
0 commit comments