mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-04 22:05:08 +01:00
Make tracker status wording/ordering more consistent
This commit is contained in:
parent
375a27a93d
commit
3dc4fd8dd1
@ -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)
|
||||
}
|
||||
|
@ -64,10 +64,10 @@ data class ALUserManga(
|
||||
fun toTrackStatus() = when (list_status) {
|
||||
"CURRENT" -> Anilist.READING
|
||||
"COMPLETED" -> Anilist.COMPLETED
|
||||
"PAUSED" -> Anilist.PAUSED
|
||||
"PAUSED" -> Anilist.ON_HOLD
|
||||
"DROPPED" -> Anilist.DROPPED
|
||||
"PLANNING" -> Anilist.PLANNING
|
||||
"REPEATING" -> Anilist.REPEATING
|
||||
"PLANNING" -> Anilist.PLAN_TO_READ
|
||||
"REPEATING" -> Anilist.REREADING
|
||||
else -> throw NotImplementedError("Unknown status: $list_status")
|
||||
}
|
||||
}
|
||||
@ -75,10 +75,10 @@ data class ALUserManga(
|
||||
fun Track.toAnilistStatus() = when (status) {
|
||||
Anilist.READING -> "CURRENT"
|
||||
Anilist.COMPLETED -> "COMPLETED"
|
||||
Anilist.PAUSED -> "PAUSED"
|
||||
Anilist.ON_HOLD -> "PAUSED"
|
||||
Anilist.DROPPED -> "DROPPED"
|
||||
Anilist.PLANNING -> "PLANNING"
|
||||
Anilist.REPEATING -> "REPEATING"
|
||||
Anilist.PLAN_TO_READ -> "PLANNING"
|
||||
Anilist.REREADING -> "REPEATING"
|
||||
else -> throw NotImplementedError("Unknown status: $status")
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ class Bangumi(private val context: Context, id: Int) : TrackService(id) {
|
||||
refresh(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)
|
||||
update(track)
|
||||
@ -91,16 +91,16 @@ class Bangumi(private val context: Context, id: Int) : TrackService(id) {
|
||||
override fun getLogoColor() = Color.rgb(240, 145, 153)
|
||||
|
||||
override fun getStatusList(): List<Int> {
|
||||
return listOf(READING, COMPLETED, ON_HOLD, DROPPED, PLANNING)
|
||||
return listOf(READING, COMPLETED, ON_HOLD, DROPPED, PLAN_TO_READ)
|
||||
}
|
||||
|
||||
override fun getStatus(status: Int): String = with(context) {
|
||||
when (status) {
|
||||
READING -> getString(R.string.reading)
|
||||
PLAN_TO_READ -> getString(R.string.plan_to_read)
|
||||
COMPLETED -> getString(R.string.completed)
|
||||
ON_HOLD -> getString(R.string.on_hold)
|
||||
DROPPED -> getString(R.string.dropped)
|
||||
PLANNING -> getString(R.string.plan_to_read)
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
@ -146,6 +146,6 @@ class Bangumi(private val context: Context, id: Int) : TrackService(id) {
|
||||
const val COMPLETED = 2
|
||||
const val ON_HOLD = 4
|
||||
const val DROPPED = 5
|
||||
const val PLANNING = 1
|
||||
const val PLAN_TO_READ = 1
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ fun Track.toBangumiStatus() = when (status) {
|
||||
Bangumi.COMPLETED -> "collect"
|
||||
Bangumi.ON_HOLD -> "on_hold"
|
||||
Bangumi.DROPPED -> "dropped"
|
||||
Bangumi.PLANNING -> "wish"
|
||||
Bangumi.PLAN_TO_READ -> "wish"
|
||||
else -> throw NotImplementedError("Unknown status: $status")
|
||||
}
|
||||
|
||||
@ -16,6 +16,6 @@ fun toTrackStatus(status: String) = when (status) {
|
||||
"collect" -> Bangumi.COMPLETED
|
||||
"on_hold" -> Bangumi.ON_HOLD
|
||||
"dropped" -> Bangumi.DROPPED
|
||||
"wish" -> Bangumi.PLANNING
|
||||
"wish" -> Bangumi.PLAN_TO_READ
|
||||
else -> throw NotImplementedError("Unknown status: $status")
|
||||
}
|
||||
|
@ -39,13 +39,13 @@ class Kitsu(private val context: Context, id: Int) : TrackService(id) {
|
||||
override fun getLogoColor() = Color.rgb(51, 37, 50)
|
||||
|
||||
override fun getStatusList(): List<Int> {
|
||||
return listOf(READING, PLAN_TO_READ, COMPLETED, ON_HOLD, DROPPED)
|
||||
return listOf(READING, COMPLETED, ON_HOLD, DROPPED, PLAN_TO_READ)
|
||||
}
|
||||
|
||||
override fun getStatus(status: Int): String = with(context) {
|
||||
when (status) {
|
||||
READING -> getString(R.string.currently_reading)
|
||||
PLAN_TO_READ -> getString(R.string.want_to_read)
|
||||
READING -> getString(R.string.reading)
|
||||
PLAN_TO_READ -> getString(R.string.plan_to_read)
|
||||
COMPLETED -> getString(R.string.completed)
|
||||
ON_HOLD -> getString(R.string.on_hold)
|
||||
DROPPED -> getString(R.string.dropped)
|
||||
|
@ -40,7 +40,7 @@ class Komga(private val context: Context, id: Int) : TrackService(id), EnhancedT
|
||||
override fun getStatus(status: Int): String = with(context) {
|
||||
when (status) {
|
||||
UNREAD -> getString(R.string.unread)
|
||||
READING -> getString(R.string.currently_reading)
|
||||
READING -> getString(R.string.reading)
|
||||
COMPLETED -> getString(R.string.completed)
|
||||
else -> ""
|
||||
}
|
||||
|
@ -47,10 +47,10 @@ class MyAnimeList(private val context: Context, id: Int) : TrackService(id) {
|
||||
override fun getStatus(status: Int): String = with(context) {
|
||||
when (status) {
|
||||
READING -> getString(R.string.reading)
|
||||
PLAN_TO_READ -> getString(R.string.plan_to_read)
|
||||
COMPLETED -> getString(R.string.completed)
|
||||
ON_HOLD -> getString(R.string.on_hold)
|
||||
DROPPED -> getString(R.string.dropped)
|
||||
PLAN_TO_READ -> getString(R.string.plan_to_read)
|
||||
REREADING -> getString(R.string.repeating)
|
||||
else -> ""
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ class Shikimori(private val context: Context, id: Int) : TrackService(id) {
|
||||
const val COMPLETED = 2
|
||||
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
|
||||
}
|
||||
|
||||
private val json: Json by injectLazy()
|
||||
@ -49,7 +49,7 @@ class Shikimori(private val context: Context, id: Int) : TrackService(id) {
|
||||
if (didReadChapter) {
|
||||
if (track.last_chapter_read.toInt() == track.total_chapters && track.total_chapters > 0) {
|
||||
track.status = COMPLETED
|
||||
} else if (track.status != REPEATING) {
|
||||
} else if (track.status != REREADING) {
|
||||
track.status = READING
|
||||
}
|
||||
}
|
||||
@ -65,14 +65,14 @@ class Shikimori(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)
|
||||
}
|
||||
@ -95,24 +95,24 @@ class Shikimori(private val context: Context, id: Int) : TrackService(id) {
|
||||
override fun getLogoColor() = Color.rgb(40, 40, 40)
|
||||
|
||||
override fun getStatusList(): List<Int> {
|
||||
return listOf(READING, COMPLETED, ON_HOLD, DROPPED, PLANNING, REPEATING)
|
||||
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)
|
||||
PLAN_TO_READ -> getString(R.string.plan_to_read)
|
||||
COMPLETED -> getString(R.string.completed)
|
||||
ON_HOLD -> getString(R.string.on_hold)
|
||||
DROPPED -> getString(R.string.dropped)
|
||||
PLANNING -> getString(R.string.plan_to_read)
|
||||
REPEATING -> getString(R.string.repeating)
|
||||
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
|
||||
|
||||
|
@ -7,8 +7,8 @@ fun Track.toShikimoriStatus() = when (status) {
|
||||
Shikimori.COMPLETED -> "completed"
|
||||
Shikimori.ON_HOLD -> "on_hold"
|
||||
Shikimori.DROPPED -> "dropped"
|
||||
Shikimori.PLANNING -> "planned"
|
||||
Shikimori.REPEATING -> "rewatching"
|
||||
Shikimori.PLAN_TO_READ -> "planned"
|
||||
Shikimori.REREADING -> "rewatching"
|
||||
else -> throw NotImplementedError("Unknown status: $status")
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ fun toTrackStatus(status: String) = when (status) {
|
||||
"completed" -> Shikimori.COMPLETED
|
||||
"on_hold" -> Shikimori.ON_HOLD
|
||||
"dropped" -> Shikimori.DROPPED
|
||||
"planned" -> Shikimori.PLANNING
|
||||
"rewatching" -> Shikimori.REPEATING
|
||||
"planned" -> Shikimori.PLAN_TO_READ
|
||||
"rewatching" -> Shikimori.REREADING
|
||||
else -> throw NotImplementedError("Unknown status: $status")
|
||||
}
|
||||
|
@ -629,13 +629,11 @@
|
||||
<string name="add_tracking">Add tracking</string>
|
||||
<string name="unread">Unread</string>
|
||||
<string name="reading">Reading</string>
|
||||
<string name="currently_reading">Currently reading</string>
|
||||
<string name="completed">Completed</string>
|
||||
<string name="dropped">Dropped</string>
|
||||
<string name="on_hold">On hold</string>
|
||||
<string name="paused">Paused</string>
|
||||
<string name="plan_to_read">Plan to read</string>
|
||||
<string name="want_to_read">Want to read</string>
|
||||
<string name="repeating">Rereading</string>
|
||||
<string name="score">Score</string>
|
||||
<string name="title">Title</string>
|
||||
|
Loading…
Reference in New Issue
Block a user