Lint fixes

This commit is contained in:
arkon 2020-06-25 19:03:32 -04:00
parent 991704be0b
commit 7e2e2f39fe
7 changed files with 39 additions and 47 deletions

View File

@ -7,11 +7,11 @@ class EmeraldFactory : SourceFactory {
override fun createSources(): List<Source> = languages.map { Mangawindow(it.first, it.second) } + languages.map { Batoto(it.first, it.second) } override fun createSources(): List<Source> = languages.map { Mangawindow(it.first, it.second) } + languages.map { Batoto(it.first, it.second) }
} }
class Mangawindow(tachiLang: String, siteLang: String) class Mangawindow(tachiLang: String, siteLang: String) :
: Emerald("Mangawindow", "https://mangawindow.net", tachiLang, siteLang) Emerald("Mangawindow", "https://mangawindow.net", tachiLang, siteLang)
class Batoto(tachiLang: String, siteLang: String) class Batoto(tachiLang: String, siteLang: String) :
: Emerald("Bato.to", "https://bato.to", tachiLang, siteLang) Emerald("Bato.to", "https://bato.to", tachiLang, siteLang)
private val languages = listOf( private val languages = listOf(
Pair("ar", "arabic"), Pair("ar", "arabic"),

View File

@ -19,16 +19,16 @@ abstract class PaprikaAlt(
override fun popularMangaSelector() = "div.anipost" override fun popularMangaSelector() = "div.anipost"
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
//Log.d("Paprika", "processing popular element") // Log.d("Paprika", "processing popular element")
return SManga.create().apply { return SManga.create().apply {
element.select("a:has(h2)").let { element.select("a:has(h2)").let {
setUrlWithoutDomain(it.attr("href")) setUrlWithoutDomain(it.attr("href"))
title = it.text() title = it.text()
//Log.d("Paprika", "manga url: $url") // Log.d("Paprika", "manga url: $url")
//Log.d("Paprika", "manga title: $title") // Log.d("Paprika", "manga title: $title")
} }
thumbnail_url = element.select("img").attr("abs:src") thumbnail_url = element.select("img").attr("abs:src")
//Log.d("Paprika", "manga thumb: $thumbnail_url") // Log.d("Paprika", "manga thumb: $thumbnail_url")
} }
} }
@ -64,7 +64,7 @@ abstract class PaprikaAlt(
} }
description = document.select("#noidungm").joinToString("\n") { it.text() } description = document.select("#noidungm").joinToString("\n") { it.text() }
//Log.d("Paprika", "mangaDetials") // Log.d("Paprika", "mangaDetials")
} }
} }

View File

@ -12,6 +12,9 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import java.util.ArrayList
import kotlin.experimental.and
import kotlin.experimental.xor
import okhttp3.MediaType import okhttp3.MediaType
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -20,9 +23,6 @@ import okhttp3.Response
import okhttp3.ResponseBody import okhttp3.ResponseBody
import org.json.JSONObject import org.json.JSONObject
import rx.Observable import rx.Observable
import java.util.ArrayList
import kotlin.experimental.and
import kotlin.experimental.xor
/** /**
* INKR source - same old MR code, though * INKR source - same old MR code, though
@ -276,16 +276,16 @@ class INKR : HttpSource() {
// Doc: https://developers.google.com/speed/webp/docs/riff_container#webp_file_header // Doc: https://developers.google.com/speed/webp/docs/riff_container#webp_file_header
val buffer = ByteArray(data.size + 15) val buffer = ByteArray(data.size + 15)
val size = data.size + 7 val size = data.size + 7
buffer[0] = 82 // R buffer[0] = 82 // R
buffer[1] = 73 // I buffer[1] = 73 // I
buffer[2] = 70 // F buffer[2] = 70 // F
buffer[3] = 70 // F buffer[3] = 70 // F
buffer[4] = (255.toByte() and size.toByte()) buffer[4] = (255.toByte() and size.toByte())
buffer[5] = (size ushr 8).toByte() and 255.toByte() buffer[5] = (size ushr 8).toByte() and 255.toByte()
buffer[6] = (size ushr 16).toByte() and 255.toByte() buffer[6] = (size ushr 16).toByte() and 255.toByte()
buffer[7] = (size ushr 24).toByte() and 255.toByte() buffer[7] = (size ushr 24).toByte() and 255.toByte()
buffer[8] = 87 // W buffer[8] = 87 // W
buffer[9] = 69 // E buffer[9] = 69 // E
buffer[10] = 66 // B buffer[10] = 66 // B
buffer[11] = 80 // P buffer[11] = 80 // P
buffer[12] = 86 // V buffer[12] = 86 // V
@ -303,7 +303,6 @@ class INKR : HttpSource() {
private class StatusFilter : Filter.TriState("Completed") private class StatusFilter : Filter.TriState("Completed")
private class SortBy : UriPartFilter("Sort by", arrayOf( private class SortBy : UriPartFilter("Sort by", arrayOf(
Pair("Name", "name"), Pair("Name", "name"),
Pair("Rank", "rank") Pair("Rank", "rank")
@ -351,5 +350,4 @@ class INKR : HttpSource() {
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) { Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
fun toUriPart() = vals[state].second fun toUriPart() = vals[state].second
} }
} }

View File

@ -148,7 +148,7 @@ class MangaPark : ConfigurableSource, ParsedHttpSource() {
chapterFromElement(chapterElement, sourceName, lastNum) chapterFromElement(chapterElement, sourceName, lastNum)
.also { lastNum = it.chapter_number } .also { lastNum = it.chapter_number }
} }
.distinctBy { it.chapter_number } // there's even duplicate chapters within a source ( -.- ) .distinctBy { it.chapter_number } // there's even duplicate chapters within a source ( -.- )
} }
return when (getSourcePref()) { return when (getSourcePref()) {

View File

@ -4,26 +4,25 @@ import com.github.salomonbrys.kotson.fromJson
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonArray import com.google.gson.JsonArray
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Locale
import kotlin.experimental.and
import kotlin.experimental.xor
import okhttp3.HttpUrl
import okhttp3.MediaType
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
import okhttp3.MediaType
import okhttp3.ResponseBody import okhttp3.ResponseBody
import okhttp3.HttpUrl
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.Calendar
import kotlin.experimental.and
import kotlin.experimental.xor
class MangaRockEs : ParsedHttpSource() { class MangaRockEs : ParsedHttpSource() {
@ -189,16 +188,16 @@ class MangaRockEs : ParsedHttpSource() {
// Doc: https://developers.google.com/speed/webp/docs/riff_container#webp_file_header // Doc: https://developers.google.com/speed/webp/docs/riff_container#webp_file_header
val buffer = ByteArray(data.size + 15) val buffer = ByteArray(data.size + 15)
val size = data.size + 7 val size = data.size + 7
buffer[0] = 82 // R buffer[0] = 82 // R
buffer[1] = 73 // I buffer[1] = 73 // I
buffer[2] = 70 // F buffer[2] = 70 // F
buffer[3] = 70 // F buffer[3] = 70 // F
buffer[4] = (255.toByte() and size.toByte()) buffer[4] = (255.toByte() and size.toByte())
buffer[5] = (size ushr 8).toByte() and 255.toByte() buffer[5] = (size ushr 8).toByte() and 255.toByte()
buffer[6] = (size ushr 16).toByte() and 255.toByte() buffer[6] = (size ushr 16).toByte() and 255.toByte()
buffer[7] = (size ushr 24).toByte() and 255.toByte() buffer[7] = (size ushr 24).toByte() and 255.toByte()
buffer[8] = 87 // W buffer[8] = 87 // W
buffer[9] = 69 // E buffer[9] = 69 // E
buffer[10] = 66 // B buffer[10] = 66 // B
buffer[11] = 80 // P buffer[11] = 80 // P
buffer[12] = 86 // V buffer[12] = 86 // V
@ -311,5 +310,4 @@ class MangaRockEs : ParsedHttpSource() {
Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) { Filter.Select<String>(displayName, vals.map { it.first }.toTypedArray()) {
fun toUriPart() = vals[state].second fun toUriPart() = vals[state].second
} }
} }

View File

@ -5,16 +5,12 @@ import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.OkHttpClient import org.json.JSONObject
import okhttp3.Response
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import org.json.JSONArray
import org.json.JSONObject
class Kombatch: ParsedHttpSource() { class Kombatch : ParsedHttpSource() {
override val name = "Kombatch" override val name = "Kombatch"
override val baseUrl = "https://kombatch.com" override val baseUrl = "https://kombatch.com"
@ -45,7 +41,7 @@ class Kombatch: ParsedHttpSource() {
thumbnail_url = element.select("img").attr("abs:src") thumbnail_url = element.select("img").attr("abs:src")
} }
//No next page // No next page
override fun latestUpdatesNextPageSelector() = "Not used" override fun latestUpdatesNextPageSelector() = "Not used"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = GET("$baseUrl/search?search=$query&page=$page", headers) override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = GET("$baseUrl/search?search=$query&page=$page", headers)