mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 03:39:19 +01:00
parent
505fa871e6
commit
c4d9b66485
@ -87,10 +87,10 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
||||
val response = responseToJson(netResponse)
|
||||
try {
|
||||
val media = response["data"]["SaveMediaListEntry"].asJsonObject
|
||||
if (track.started_reading_date == 0L) {
|
||||
if (track.started_reading_date <= 0L) {
|
||||
track.started_reading_date = parseDate(media, "startedAt")
|
||||
}
|
||||
if (track.finished_reading_date == 0L) {
|
||||
if (track.finished_reading_date <= 0L) {
|
||||
track.finished_reading_date = parseDate(media, "completedAt")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@ -236,6 +236,11 @@ class AnilistApi(val client: OkHttpClient, interceptor: AnilistInterceptor) {
|
||||
}
|
||||
|
||||
private fun createDate(dateValue: Long): JsonObject? {
|
||||
if (dateValue == -1L) return jsonObject(
|
||||
"year" to null,
|
||||
"month" to null,
|
||||
"day" to null,
|
||||
)
|
||||
if (dateValue == 0L) return null
|
||||
val calendar = Calendar.getInstance()
|
||||
calendar.timeInMillis = dateValue
|
||||
|
@ -222,7 +222,7 @@ class MyAnimeListApi(private val client: OkHttpClient, interceptor: MyAnimeListI
|
||||
}
|
||||
|
||||
private fun convertToIsoDate(epochTime: Long): String? {
|
||||
if (epochTime == 0L) {
|
||||
if (epochTime <= 0L) {
|
||||
return ""
|
||||
}
|
||||
return try {
|
||||
|
@ -67,7 +67,7 @@ class SetTrackReadingDatesDialog<T> : DialogController
|
||||
listener.setReadingDate(item, dateToUpdate, date.timeInMillis)
|
||||
}
|
||||
.neutralButton(R.string.remove) {
|
||||
listener.setReadingDate(item, dateToUpdate, 0L)
|
||||
listener.setReadingDate(item, dateToUpdate, -1L)
|
||||
}.apply {
|
||||
getSuggestedDate()?.let {
|
||||
message(
|
||||
|
Loading…
Reference in New Issue
Block a user