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:
Mitchell Syer
2023-10-15 20:16:30 -04:00
committed by GitHub
parent e70730e9a8
commit 682c364647
31 changed files with 151 additions and 278 deletions

View File

@@ -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
}
}
}

View File

@@ -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 <--
}

View File

@@ -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
}
}
}

View File

@@ -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 <--
}

View File

@@ -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
}
}
}

View File

@@ -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,
)
}
}
}