mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-12 15:24:33 -05:00
Address Build Warnings and Cleanup (#707)
* Address build warnings and cleanup * Actual name of who defined the protocol * Remove uneeded detekt supression * GraphQL Before-After cleanup * Lint * Cleanup unused functions * Fix some discrepancies with the 1.5 source api and fix lang exception
This commit is contained in:
@@ -22,11 +22,4 @@ interface Chapter : SChapter, Serializable {
|
||||
|
||||
val isRecognizedNumber: Boolean
|
||||
get() = chapter_number >= 0f
|
||||
|
||||
companion object {
|
||||
fun create(): Chapter =
|
||||
ChapterImpl().apply {
|
||||
chapter_number = -1f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
package suwayomi.tachidesk.manga.impl.backup.models
|
||||
|
||||
import org.jetbrains.exposed.sql.ResultRow
|
||||
import suwayomi.tachidesk.manga.model.table.ChapterTable
|
||||
|
||||
class ChapterImpl : Chapter {
|
||||
override var id: Long? = null
|
||||
|
||||
@@ -42,17 +39,4 @@ class ChapterImpl : Chapter {
|
||||
override fun hashCode(): Int {
|
||||
return url.hashCode() + id.hashCode()
|
||||
}
|
||||
|
||||
// Tachidesk -->
|
||||
companion object {
|
||||
fun fromQuery(chapterRecord: ResultRow): ChapterImpl {
|
||||
return ChapterImpl().apply {
|
||||
url = chapterRecord[ChapterTable.url]
|
||||
read = chapterRecord[ChapterTable.isRead]
|
||||
bookmark = chapterRecord[ChapterTable.isBookmarked]
|
||||
last_page_read = chapterRecord[ChapterTable.lastPageRead]
|
||||
}
|
||||
}
|
||||
}
|
||||
// Tachidesk <--
|
||||
}
|
||||
|
||||
@@ -120,22 +120,6 @@ interface Manga : SManga {
|
||||
const val CHAPTER_DISPLAY_NAME = 0x00000000
|
||||
const val CHAPTER_DISPLAY_NUMBER = 0x00100000
|
||||
const val CHAPTER_DISPLAY_MASK = 0x00100000
|
||||
|
||||
fun create(source: Long): Manga =
|
||||
MangaImpl().apply {
|
||||
this.source = source
|
||||
}
|
||||
|
||||
fun create(
|
||||
pathUrl: String,
|
||||
title: String,
|
||||
source: Long = 0,
|
||||
): Manga =
|
||||
MangaImpl().apply {
|
||||
url = pathUrl
|
||||
this.title = title
|
||||
this.source = source
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
package suwayomi.tachidesk.manga.impl.backup.models
|
||||
|
||||
import eu.kanade.tachiyomi.source.model.UpdateStrategy
|
||||
import org.jetbrains.exposed.sql.ResultRow
|
||||
import suwayomi.tachidesk.manga.model.table.MangaTable
|
||||
|
||||
open class MangaImpl : Manga {
|
||||
override var id: Long? = null
|
||||
@@ -68,18 +66,4 @@ open class MangaImpl : Manga {
|
||||
override fun hashCode(): Int {
|
||||
return url.hashCode() + id.hashCode()
|
||||
}
|
||||
|
||||
// Tachidesk -->
|
||||
companion object {
|
||||
fun fromQuery(mangaRecord: ResultRow): MangaImpl {
|
||||
return MangaImpl().apply {
|
||||
url = mangaRecord[MangaTable.url]
|
||||
title = mangaRecord[MangaTable.title]
|
||||
source = mangaRecord[MangaTable.sourceReference]
|
||||
viewer_flags = 0 // TODO: implement
|
||||
chapter_flags = 0 // TODO: implement
|
||||
}
|
||||
}
|
||||
}
|
||||
// Tachidesk <--
|
||||
}
|
||||
|
||||
@@ -30,19 +30,4 @@ interface Track : Serializable {
|
||||
var finished_reading_date: Long
|
||||
|
||||
var tracking_url: String
|
||||
|
||||
fun copyPersonalFrom(other: Track) {
|
||||
last_chapter_read = other.last_chapter_read
|
||||
score = other.score
|
||||
status = other.status
|
||||
started_reading_date = other.started_reading_date
|
||||
finished_reading_date = other.finished_reading_date
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun create(serviceId: Int): Track =
|
||||
TrackImpl().apply {
|
||||
sync_id = serviceId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package suwayomi.tachidesk.manga.impl.backup.proto.models
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.protobuf.ProtoNumber
|
||||
import suwayomi.tachidesk.manga.impl.backup.models.Chapter
|
||||
import suwayomi.tachidesk.manga.impl.backup.models.ChapterImpl
|
||||
|
||||
@Serializable
|
||||
@@ -36,21 +35,4 @@ data class BackupChapter(
|
||||
source_order = this@BackupChapter.sourceOrder
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun copyFrom(chapter: Chapter): BackupChapter {
|
||||
return BackupChapter(
|
||||
url = chapter.url,
|
||||
name = chapter.name,
|
||||
chapterNumber = chapter.chapter_number,
|
||||
scanlator = chapter.scanlator,
|
||||
read = chapter.read,
|
||||
bookmark = chapter.bookmark,
|
||||
lastPageRead = chapter.last_page_read,
|
||||
dateFetch = chapter.date_fetch,
|
||||
dateUpload = chapter.date_upload,
|
||||
sourceOrder = chapter.source_order,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user