Skip to content

Commit

Permalink
Fix unread and download counts casing (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
Syer10 authored Oct 28, 2021
1 parent 6f8fc5b commit 1ee37da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ package suwayomi.tachidesk.manga.impl
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.ResultRow
import org.jetbrains.exposed.sql.SortOrder
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.count
import org.jetbrains.exposed.sql.deleteWhere
import org.jetbrains.exposed.sql.insert
import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.transactions.transaction
import org.jetbrains.exposed.sql.update
import org.jetbrains.exposed.sql.wrapAsExpression
import suwayomi.tachidesk.manga.impl.Category.DEFAULT_CATEGORY_ID
import suwayomi.tachidesk.manga.impl.util.lang.isEmpty
import suwayomi.tachidesk.manga.model.dataclass.CategoryDataClass
Expand Down Expand Up @@ -66,8 +74,8 @@ object CategoryManga {
val selectedColumns = MangaTable.columns + unreadExpression + downloadExpression
val transform: (ResultRow) -> MangaDataClass = {
val dataClass = MangaTable.toDataClass(it)
dataClass.unread_count = it[unreadExpression]?.toInt()
dataClass.download_count = it[downloadExpression]?.toInt()
dataClass.unreadCount = it[unreadExpression]?.toInt()
dataClass.downloadCount = it[downloadExpression]?.toInt()
dataClass
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ data class MangaDataClass(
val realUrl: String? = null,

val freshData: Boolean = false,
var unread_count: Int? = null,
var download_count: Int? = null
var unreadCount: Int? = null,
var downloadCount: Int? = null
)

data class PagedMangaListDataClass(
Expand Down

0 comments on commit 1ee37da

Please sign in to comment.