package com.aletheia.app.model

data class Book(
    val id: Long = 0,
    val title: String = "",
    val author: String = "",
    val filePath: String = "",
    val fileName: String = "",
    val format: String = "",
    val coverImage: ByteArray? = null,
    val readingProgress: Double = 0.0,
    val lastCfi: String? = null,
    val lastChapter: String? = null,
    val locations: String? = null,
    val dateAdded: Long = System.currentTimeMillis(),
    val lastRead: Long = System.currentTimeMillis(),
    val totalPages: Int = 0,
    val currentPage: Int = 0,
    val remoteId: String? = null
) {
    val progressText: String
        get() = "${(readingProgress * 100).toInt()}%"

    val isInProgress: Boolean
        get() = readingProgress > 0.0 && readingProgress < 1.0

    val isCompleted: Boolean
        get() = readingProgress >= 1.0
}
