From 3dc4fd8dd1c121080eedfd11e0d693e2bd1c3d60 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 8 Jan 2022 15:49:39 -0500 Subject: [PATCH] Make tracker status wording/ordering more consistent --- .../tachiyomi/data/track/anilist/Anilist.kt | 22 +++++++++---------- .../data/track/anilist/AnilistModels.kt | 12 +++++----- .../tachiyomi/data/track/bangumi/Bangumi.kt | 8 +++---- .../data/track/bangumi/BangumiModels.kt | 4 ++-- .../tachiyomi/data/track/kitsu/Kitsu.kt | 6 ++--- .../tachiyomi/data/track/komga/Komga.kt | 2 +- .../data/track/myanimelist/MyAnimeList.kt | 2 +- .../data/track/shikimori/Shikimori.kt | 18 +++++++-------- .../data/track/shikimori/ShikimoriModels.kt | 8 +++---- app/src/main/res/values/strings.xml | 2 -- 10 files changed, 41 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt index ecaa0093e..1210837c0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/Anilist.kt @@ -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 { - 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) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt index c85d53f62..93f09fc04 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/anilist/AnilistModels.kt @@ -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") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt index 7cdec90d3..8189732ed 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/Bangumi.kt @@ -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 { - 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 } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiModels.kt index 86dfe45ca..e5811d707 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiModels.kt @@ -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") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/Kitsu.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/Kitsu.kt index 75a456786..5cec2d634 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/Kitsu.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/kitsu/Kitsu.kt @@ -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 { - 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) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/Komga.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/Komga.kt index e55055c6d..19029ef9b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/Komga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/komga/Komga.kt @@ -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 -> "" } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt index ffed4c15d..5172b326c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/myanimelist/MyAnimeList.kt @@ -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 -> "" } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt index e21ce491e..c0e0c3f06 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/Shikimori.kt @@ -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 { - 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 diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriModels.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriModels.kt index 786215771..fe59f6e80 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriModels.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/shikimori/ShikimoriModels.kt @@ -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") } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2b2279874..a30f72222 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -629,13 +629,11 @@ Add tracking Unread Reading - Currently reading Completed Dropped On hold Paused Plan to read - Want to read Rereading Score Title