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