|
@@ -17,10 +17,10 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
|
|
|
companion object {
|
|
|
const val READING = 1
|
|
|
const val COMPLETED = 2
|
|
|
- const val PAUSED = 3
|
|
|
+ const val ON_HOLD = 3
|
|
|
const val DROPPED = 4
|
|
|
- const val PLANNING = 5
|
|
|
- const val REPEATING = 6
|
|
|
+ const val PLAN_TO_READ = 5
|
|
|
+ const val REREADING = 6
|
|
|
|
|
|
const val POINT_100 = "POINT_100"
|
|
|
const val POINT_10 = "POINT_10"
|
|
@@ -57,24 +57,24 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
|
|
|
override fun getLogoColor() = Color.rgb(18, 25, 35)
|
|
|
|
|
|
override fun getStatusList(): List<Int> {
|
|
|
- return listOf(READING, PLANNING, COMPLETED, REPEATING, PAUSED, DROPPED)
|
|
|
+ return listOf(READING, COMPLETED, ON_HOLD, DROPPED, PLAN_TO_READ, REREADING)
|
|
|
}
|
|
|
|
|
|
override fun getStatus(status: Int): String = with(context) {
|
|
|
when (status) {
|
|
|
READING -> getString(R.string.reading)
|
|
|
- PLANNING -> getString(R.string.plan_to_read)
|
|
|
+ PLAN_TO_READ -> getString(R.string.plan_to_read)
|
|
|
COMPLETED -> getString(R.string.completed)
|
|
|
- REPEATING -> getString(R.string.repeating)
|
|
|
- PAUSED -> getString(R.string.paused)
|
|
|
+ ON_HOLD -> getString(R.string.on_hold)
|
|
|
DROPPED -> getString(R.string.dropped)
|
|
|
+ REREADING -> getString(R.string.repeating)
|
|
|
else -> ""
|
|
|
}
|
|
|
}
|
|
|
|
|
|
override fun getReadingStatus(): Int = READING
|
|
|
|
|
|
- override fun getRereadingStatus(): Int = REPEATING
|
|
|
+ override fun getRereadingStatus(): Int = REREADING
|
|
|
|
|
|
override fun getCompletionStatus(): Int = COMPLETED
|
|
|
|
|
@@ -151,7 +151,7 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
|
|
|
if (track.last_chapter_read.toInt() == track.total_chapters && track.total_chapters > 0) {
|
|
|
track.status = COMPLETED
|
|
|
track.finished_reading_date = System.currentTimeMillis()
|
|
|
- } else if (track.status != REPEATING) {
|
|
|
+ } else if (track.status != REREADING) {
|
|
|
track.status = READING
|
|
|
if (track.last_chapter_read == 1F) {
|
|
|
track.started_reading_date = System.currentTimeMillis()
|
|
@@ -170,14 +170,14 @@ class Anilist(private val context: Context, id: Int) : TrackService(id) {
|
|
|
track.library_id = remoteTrack.library_id
|
|
|
|
|
|
if (track.status != COMPLETED) {
|
|
|
- val isRereading = track.status == REPEATING
|
|
|
+ val isRereading = track.status == REREADING
|
|
|
track.status = if (isRereading.not() && hasReadChapters) READING else track.status
|
|
|
}
|
|
|
|
|
|
update(track)
|
|
|
} else {
|
|
|
// Set default fields if it's not found in the list
|
|
|
- track.status = if (hasReadChapters) READING else PLANNING
|
|
|
+ track.status = if (hasReadChapters) READING else PLAN_TO_READ
|
|
|
track.score = 0F
|
|
|
add(track)
|
|
|
}
|