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
This commit is contained in:
Gauthier 2021-05-25 10:12:12 +08:00 committed by GitHub
parent a498f940c6
commit acd927a937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 5 additions and 11 deletions

View file

@ -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

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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())
}

View file

@ -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)
}

View file

@ -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)

View file

@ -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())
}