Kaynağa Gözat

Refactor TrackService.kt to remove unused `add` function (#5164)

* removed the add function from TrackService.kt as it's not used except within the tracker implementations

* add private modifier
Gauthier 3 yıl önce
ebeveyn
işleme
acd927a937

+ 0 - 2
app/src/main/java/eu/kanade/tachiyomi/data/track/TrackService.kt

@@ -46,8 +46,6 @@ abstract class TrackService(val id: Int) {
 
     abstract fun displayScore(track: Track): String
 
-    abstract suspend fun add(track: Track): Track
-
     abstract suspend fun update(track: Track): Track
 
     abstract suspend fun bind(track: Track): Track

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt

@@ -130,7 +130,7 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
         }
     }
 
-    override suspend fun add(track: Track): Track {
+    private suspend fun add(track: Track): Track {
         return api.addLibManga(track)
     }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt

@@ -31,7 +31,7 @@ class Bangumi(private val context: Context, id: Int) : TrackService(id) {
         return track.score.toInt().toString()
     }
 
-    override suspend fun add(track: Track): Track {
+    private suspend fun add(track: Track): Track {
         return api.addLibManga(track)
     }
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/Kitsu.kt

@@ -67,7 +67,7 @@ class Kitsu(private val context: Context, id: Int) : TrackService(id) {
         return df.format(track.score)
     }
 
-    override suspend fun add(track: Track): Track {
+    private suspend fun add(track: Track): Track {
         return api.addLibManga(track, getUserId())
     }
 

+ 0 - 4
app/src/main/java/eu/kanade/tachiyomi/data/track/komga/Komga.kt

@@ -55,10 +55,6 @@ class Komga(private val context: Context, id: Int) : TrackService(id), Unattende
 
     override fun displayScore(track: Track): String = ""
 
-    override suspend fun add(track: Track): Track {
-        TODO("Not yet implemented: add")
-    }
-
     override suspend fun update(track: Track): Track {
         return api.updateProgress(track)
     }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt

@@ -66,7 +66,7 @@ class MyAnimeList(private val context: Context, id: Int) : TrackService(id) {
         return track.score.toInt().toString()
     }
 
-    override suspend fun add(track: Track): Track {
+    private suspend fun add(track: Track): Track {
         track.status = READING
         track.score = 0F
         return api.updateItem(track)

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt

@@ -40,7 +40,7 @@ class Shikimori(private val context: Context, id: Int) : TrackService(id) {
         return track.score.toInt().toString()
     }
 
-    override suspend fun add(track: Track): Track {
+    private suspend fun add(track: Track): Track {
         return api.addLibManga(track, getUsername())
     }