package org.dueattendant149.bookshelf.data.remote.bookshelfapi.model

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class DownloadRequest(
    val source: String = "",
    val title: String = "",
    val author: String = "",
    @SerialName("download_url")
    val downloadUrl: String? = null,
    @SerialName("magnet_url")
    val magnetUrl: String? = null,
    @SerialName("info_hash")
    val infoHash: String? = null,
    val md5: String? = null,
    val url: String? = null,
    @SerialName("media_type")
    val mediaType: String = "ebook",
    @SerialName("download_protocol")
    val downloadProtocol: String = "",
)

@Serializable
data class DownloadResponse(
    val success: Boolean = false,
    val error: String? = null,
    @SerialName("download_id")
    val downloadId: String? = null,
)

@Serializable
data class DownloadStatusResponse(
    val title: String = "",
    val status: String = "",
    val progress: Double = 0.0,
    val speed: String = "",
    val error: String? = null,
)

@Serializable
data class DownloadsListResponse(
    val downloads: List<DownloadStatusResponse> = emptyList(),
)

@Serializable
data class PodcastRequest(
    val url: String,
    val title: String? = null,
    val format: String = "m4a",
)

@Serializable
data class PodcastResponse(
    val url: String = "",
    val title: String = "",
    val tracks: Int = 0,
    val files: List<String> = emptyList(),
    @SerialName("abs_scan_triggered")
    val absScanTriggered: Boolean = false,
)

@Serializable
data class YandexRequest(
    val bookid: String,
)

@Serializable
data class YandexResponse(
    val bookid: String,
    val files: List<String> = emptyList(),
    @SerialName("abs_scan_triggered")
    val absScanTriggered: Boolean = false,
)
