mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-17 17:59:18 +01:00
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:
parent
a498f940c6
commit
acd927a937
@ -46,8 +46,6 @@ abstract class TrackService(val id: Int) {
|
|||||||
|
|
||||||
abstract fun displayScore(track: Track): String
|
abstract fun displayScore(track: Track): String
|
||||||
|
|
||||||
abstract suspend fun add(track: Track): Track
|
|
||||||
|
|
||||||
abstract suspend fun update(track: Track): Track
|
abstract suspend fun update(track: Track): Track
|
||||||
|
|
||||||
abstract suspend fun bind(track: Track): Track
|
abstract suspend fun bind(track: Track): Track
|
||||||
|
@ -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)
|
return api.addLibManga(track)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class Bangumi(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
return track.score.toInt().toString()
|
return track.score.toInt().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun add(track: Track): Track {
|
private suspend fun add(track: Track): Track {
|
||||||
return api.addLibManga(track)
|
return api.addLibManga(track)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class Kitsu(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
return df.format(track.score)
|
return df.format(track.score)
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun add(track: Track): Track {
|
private suspend fun add(track: Track): Track {
|
||||||
return api.addLibManga(track, getUserId())
|
return api.addLibManga(track, getUserId())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,10 +55,6 @@ class Komga(private val context: Context, id: Int) : TrackService(id), Unattende
|
|||||||
|
|
||||||
override fun displayScore(track: Track): String = ""
|
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 {
|
override suspend fun update(track: Track): Track {
|
||||||
return api.updateProgress(track)
|
return api.updateProgress(track)
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ class MyAnimeList(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
return track.score.toInt().toString()
|
return track.score.toInt().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun add(track: Track): Track {
|
private suspend fun add(track: Track): Track {
|
||||||
track.status = READING
|
track.status = READING
|
||||||
track.score = 0F
|
track.score = 0F
|
||||||
return api.updateItem(track)
|
return api.updateItem(track)
|
||||||
|
@ -40,7 +40,7 @@ class Shikimori(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
return track.score.toInt().toString()
|
return track.score.toInt().toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun add(track: Track): Track {
|
private suspend fun add(track: Track): Track {
|
||||||
return api.addLibManga(track, getUsername())
|
return api.addLibManga(track, getUsername())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user