Revert "Update sources catalog ui"

This reverts commit 597ad01e8f.
master
Koitharu 2 years ago committed by Mac135135
parent 09b6a967a1
commit dc45e0f5df

@ -1,12 +0,0 @@
package org.koitharu.kotatsu.core.db.migrations
import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
class Migration20To21 : Migration(20, 21) {
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("ALTER TABLE tracks ADD COLUMN `last_error` TEXT DEFAULT NULL")
db.execSQL("ALTER TABLE sources ADD COLUMN `added_in` INTEGER NOT NULL DEFAULT 0")
}
}

@ -25,7 +25,6 @@ class TrackEntity(
@ColumnInfo(name = "last_check_time") val lastCheckTime: Long, @ColumnInfo(name = "last_check_time") val lastCheckTime: Long,
@ColumnInfo(name = "last_chapter_date") val lastChapterDate: Long, @ColumnInfo(name = "last_chapter_date") val lastChapterDate: Long,
@ColumnInfo(name = "last_result") val lastResult: Int, @ColumnInfo(name = "last_result") val lastResult: Int,
@ColumnInfo(name = "last_error") val lastError: String?,
) { ) {
companion object { companion object {
@ -43,7 +42,6 @@ class TrackEntity(
lastCheckTime = 0L, lastCheckTime = 0L,
lastChapterDate = 0, lastChapterDate = 0,
lastResult = RESULT_NONE, lastResult = RESULT_NONE,
lastError = null,
) )
} }
} }

@ -168,7 +168,6 @@ class TrackingRepository @Inject constructor(
lastCheckTime = tracking.lastCheck?.toEpochMilli() ?: 0L, lastCheckTime = tracking.lastCheck?.toEpochMilli() ?: 0L,
lastChapterDate = tracking.lastChapterDate?.toEpochMilli() ?: 0L, lastChapterDate = tracking.lastChapterDate?.toEpochMilli() ?: 0L,
lastResult = TrackEntity.RESULT_EXTERNAL_MODIFICATION, lastResult = TrackEntity.RESULT_EXTERNAL_MODIFICATION,
lastError = null,
) )
db.getTracksDao().upsert(entity) db.getTracksDao().upsert(entity)
} }
@ -225,7 +224,6 @@ class TrackingRepository @Inject constructor(
lastCheckTime = System.currentTimeMillis(), lastCheckTime = System.currentTimeMillis(),
lastChapterDate = lastChapterDate, lastChapterDate = lastChapterDate,
lastResult = TrackEntity.RESULT_FAILED, lastResult = TrackEntity.RESULT_FAILED,
lastError = updates.error?.toString(),
) )
is MangaUpdates.Success -> TrackEntity( is MangaUpdates.Success -> TrackEntity(
@ -235,7 +233,6 @@ class TrackingRepository @Inject constructor(
lastCheckTime = System.currentTimeMillis(), lastCheckTime = System.currentTimeMillis(),
lastChapterDate = updates.lastChapterDate().ifZero { lastChapterDate }, lastChapterDate = updates.lastChapterDate().ifZero { lastChapterDate },
lastResult = if (updates.isNotEmpty()) TrackEntity.RESULT_HAS_UPDATE else TrackEntity.RESULT_NO_UPDATE, lastResult = if (updates.isNotEmpty()) TrackEntity.RESULT_HAS_UPDATE else TrackEntity.RESULT_NO_UPDATE,
lastError = null,
) )
} }
} }

Loading…
Cancel
Save