Cleanup
This commit is contained in:
@@ -52,7 +52,6 @@ fun Parcel.readManga() = Manga(
|
||||
fun MangaPage.writeToParcel(out: Parcel) {
|
||||
out.writeLong(id)
|
||||
out.writeString(url)
|
||||
out.writeString(referer)
|
||||
out.writeString(preview)
|
||||
out.writeSerializable(source)
|
||||
}
|
||||
@@ -60,7 +59,6 @@ fun MangaPage.writeToParcel(out: Parcel) {
|
||||
fun Parcel.readMangaPage() = MangaPage(
|
||||
id = readLong(),
|
||||
url = requireNotNull(readString()),
|
||||
referer = requireNotNull(readString()),
|
||||
preview = readString(),
|
||||
source = checkNotNull(readSerializableCompat()),
|
||||
)
|
||||
|
||||
@@ -96,7 +96,6 @@ class LocalMangaDirInput(root: File) : LocalMangaInput(root) {
|
||||
id = pageUri.longHashCode(),
|
||||
url = pageUri,
|
||||
preview = null,
|
||||
referer = chapter.url,
|
||||
source = MangaSource.LOCAL,
|
||||
)
|
||||
}
|
||||
@@ -113,7 +112,6 @@ class LocalMangaDirInput(root: File) : LocalMangaInput(root) {
|
||||
id = pageUri.longHashCode(),
|
||||
url = pageUri,
|
||||
preview = null,
|
||||
referer = chapter.url,
|
||||
source = MangaSource.LOCAL,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -132,7 +132,6 @@ class LocalMangaZipInput(root: File) : LocalMangaInput(root) {
|
||||
id = entryUri.longHashCode(),
|
||||
url = entryUri,
|
||||
preview = null,
|
||||
referer = chapter.url,
|
||||
source = MangaSource.LOCAL,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -83,10 +83,6 @@ class LocalMangaDirOutput(
|
||||
}
|
||||
}
|
||||
|
||||
override fun sortChaptersByName() {
|
||||
index.sortChaptersByName()
|
||||
}
|
||||
|
||||
suspend fun deleteChapter(chapterId: Long) {
|
||||
val chapter = checkNotNull(index.getMangaInfo()?.chapters) {
|
||||
"No chapters found"
|
||||
|
||||
@@ -22,9 +22,6 @@ abstract class LocalMangaOutput(
|
||||
|
||||
abstract suspend fun cleanup()
|
||||
|
||||
// TODO remove
|
||||
abstract fun sortChaptersByName()
|
||||
|
||||
companion object {
|
||||
|
||||
const val ENTRY_NAME_INDEX = "index.json"
|
||||
|
||||
@@ -80,10 +80,6 @@ class LocalMangaZipOutput(
|
||||
output.close()
|
||||
}
|
||||
|
||||
override fun sortChaptersByName() {
|
||||
index.sortChaptersByName()
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun mergeWith(other: File) {
|
||||
var otherIndex: MangaIndex? = null
|
||||
|
||||
@@ -191,7 +191,6 @@ class PageLoader @Inject constructor(
|
||||
val request = Request.Builder()
|
||||
.url(pageUrl)
|
||||
.get()
|
||||
.header(CommonHeaders.REFERER, page.referer)
|
||||
.header(CommonHeaders.ACCEPT, "image/webp,image/png;q=0.9,image/jpeg,*/*;q=0.8")
|
||||
.cacheControl(CommonHeaders.CACHE_CONTROL_NO_STORE)
|
||||
.tag(MangaSource::class.java, page.source)
|
||||
|
||||
@@ -47,7 +47,6 @@ class ColorFilterConfigViewModel @Inject constructor(
|
||||
MangaPage(
|
||||
id = page.id,
|
||||
url = url,
|
||||
referer = page.referer,
|
||||
preview = page.preview,
|
||||
source = page.source,
|
||||
),
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.koitharu.kotatsu.parsers.model.MangaSource
|
||||
data class ReaderPage(
|
||||
val id: Long,
|
||||
val url: String,
|
||||
val referer: String,
|
||||
val preview: String?,
|
||||
val chapterId: Long,
|
||||
val index: Int,
|
||||
@@ -19,7 +18,6 @@ data class ReaderPage(
|
||||
constructor(page: MangaPage, index: Int, chapterId: Long) : this(
|
||||
id = page.id,
|
||||
url = page.url,
|
||||
referer = page.referer,
|
||||
preview = page.preview,
|
||||
chapterId = chapterId,
|
||||
index = index,
|
||||
@@ -29,8 +27,7 @@ data class ReaderPage(
|
||||
fun toMangaPage() = MangaPage(
|
||||
id = id,
|
||||
url = url,
|
||||
referer = referer,
|
||||
preview = preview,
|
||||
source = source,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,6 @@ class ChapterPagesTest {
|
||||
private fun page(chapterId: Long) = ReaderPage(
|
||||
id = Random.nextLong(),
|
||||
url = "http://localhost",
|
||||
referer = "http://localhost",
|
||||
preview = null,
|
||||
chapterId = chapterId,
|
||||
index = Random.nextInt(),
|
||||
|
||||
Reference in New Issue
Block a user