Go through the sources and change fallback chapter numbers to -1 (#4596)

Go through the sources and change fallback chapter numbers to -1
This commit is contained in:
jobobby04 2020-10-12 19:49:37 -04:00 committed by GitHub
parent 672cdad094
commit dd22e25de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 28 additions and 28 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangAdventure' extName = 'MangAdventure'
pkgNameSuffix = 'all.mangadventure' pkgNameSuffix = 'all.mangadventure'
extClass = '.MangAdventureFactory' extClass = '.MangAdventureFactory'
extVersionCode = 7 extVersionCode = 8
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -80,7 +80,7 @@ val SChapter.path: String
*/ */
fun SChapter.fromJSON(obj: JSONObject) = apply { fun SChapter.fromJSON(obj: JSONObject) = apply {
url = obj.getString("url") url = obj.getString("url")
chapter_number = obj.optString("chapter", "0").toFloat() chapter_number = obj.optString("chapter", "-1").toFloat()
date_upload = MangAdventure.httpDateToTimestamp(obj.getString("date")) date_upload = MangAdventure.httpDateToTimestamp(obj.getString("date"))
scanlator = obj.getJSONArray("groups").joinField("name", " & ") scanlator = obj.getJSONArray("groups").joinField("name", " & ")
name = obj.optString( name = obj.optString(

View File

@ -6,7 +6,7 @@ ext {
extName = 'MANGA Plus by SHUEISHA' extName = 'MANGA Plus by SHUEISHA'
pkgNameSuffix = 'all.mangaplus' pkgNameSuffix = 'all.mangaplus'
extClass = '.MangaPlusFactory' extClass = '.MangaPlusFactory'
extVersionCode = 12 extVersionCode = 13
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -238,7 +238,7 @@ abstract class MangaPlus(
scanlator = "Shueisha" scanlator = "Shueisha"
date_upload = 1000L * it.startTimeStamp date_upload = 1000L * it.startTimeStamp
url = "#/viewer/${it.chapterId}" url = "#/viewer/${it.chapterId}"
chapter_number = it.name.substringAfter("#").toFloatOrNull() ?: 0f chapter_number = it.name.substringAfter("#").toFloatOrNull() ?: -1f
} }
} }
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Toomics' extName = 'Toomics'
pkgNameSuffix = 'all.toomics' pkgNameSuffix = 'all.toomics'
extClass = '.ToomicsFactory' extClass = '.ToomicsFactory'
extVersionCode = 4 extVersionCode = 5
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -126,7 +126,7 @@ abstract class ToomicsGlobal(
val numText = if (num.isNotEmpty()) "$num - " else "" val numText = if (num.isNotEmpty()) "$num - " else ""
name = numText + element.select("div.cell-title")?.first()?.ownText() name = numText + element.select("div.cell-title")?.first()?.ownText()
chapter_number = num.toFloatOrNull() ?: 0f chapter_number = num.toFloatOrNull() ?: -1f
date_upload = parseChapterDate(element.select("div.cell-time time").text()!!) date_upload = parseChapterDate(element.select("div.cell-time time").text()!!)
scanlator = "Toomics" scanlator = "Toomics"
url = element.select("a").attr("onclick") url = element.select("a").attr("onclick")

View File

@ -5,7 +5,7 @@ ext {
extName = 'VIZ Shonen Jump' extName = 'VIZ Shonen Jump'
pkgNameSuffix = 'en.vizshonenjump' pkgNameSuffix = 'en.vizshonenjump'
extClass = '.VizShonenJump' extClass = '.VizShonenJump'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -167,7 +167,7 @@ class VizShonenJump : ParsedHttpSource() {
date_upload = leftSide.select("td[align=right]").first()!!.text().toDate() date_upload = leftSide.select("td[align=right]").first()!!.text().toDate()
} }
chapter_number = name.substringAfter("Ch. ").toFloatOrNull() ?: 0F chapter_number = name.substringAfter("Ch. ").toFloatOrNull() ?: -1F
scanlator = "VIZ Media" scanlator = "VIZ Media"
url = element.attr("data-target-url") url = element.attr("data-target-url")
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Mangakawaii' extName = 'Mangakawaii'
pkgNameSuffix = 'fr.mangakawaii' pkgNameSuffix = 'fr.mangakawaii'
extClass = '.MangaKawaii' extClass = '.MangaKawaii'
extVersionCode = 9 extVersionCode = 10
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -69,7 +69,7 @@ class MangaKawaii : ParsedHttpSource() {
val chapter = SChapter.create() val chapter = SChapter.create()
chapter.url = element.select("a.list-item__title").attr("href") chapter.url = element.select("a.list-item__title").attr("href")
chapter.name = element.select("a.list-item__title").text().trim() chapter.name = element.select("a.list-item__title").text().trim()
chapter.chapter_number = element.select("a.list-item__title").text().substringAfter("Chapitre").replace(Regex("""[,-]"""), ".").trim().toFloatOrNull() ?: 0F chapter.chapter_number = element.select("a.list-item__title").text().substringAfter("Chapitre").replace(Regex("""[,-]"""), ".").trim().toFloatOrNull() ?: -1F
chapter.date_upload = parseDate(element.select("div.chapter-item__date").text()) chapter.date_upload = parseDate(element.select("div.chapter-item__date").text())
return chapter return chapter
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Nikkangecchan' extName = 'Nikkangecchan'
pkgNameSuffix = 'ja.nikkangecchan' pkgNameSuffix = 'ja.nikkangecchan'
extClass = '.Nikkangecchan' extClass = '.Nikkangecchan'
extVersionCode = 1 extVersionCode = 2
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -90,7 +90,7 @@ class Nikkangecchan : ParsedHttpSource() {
return SChapter.create().apply { return SChapter.create().apply {
name = "$title - $dataTitle" name = "$title - $dataTitle"
chapter_number = element.select("h4.episodeTitle").first().text().toFloatOrNull() ?: 0f chapter_number = element.select("h4.episodeTitle").first().text().toFloatOrNull() ?: -1f
scanlator = "Akita Publishing" scanlator = "Akita Publishing"
setUrlWithoutDomain(baseUrl + episodePage.attr("data-src").substringBeforeLast("/")) setUrlWithoutDomain(baseUrl + episodePage.attr("data-src").substringBeforeLast("/"))
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'HipercooL' extName = 'HipercooL'
pkgNameSuffix = 'pt.hipercool' pkgNameSuffix = 'pt.hipercool'
extClass = '.Hipercool' extClass = '.Hipercool'
extVersionCode = 4 extVersionCode = 5
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -168,7 +168,7 @@ class Hipercool : HttpSource() {
private fun chapterListItemParse(book: JsonObject, obj: JsonObject): SChapter = SChapter.create().apply { private fun chapterListItemParse(book: JsonObject, obj: JsonObject): SChapter = SChapter.create().apply {
name = obj["title"].string name = obj["title"].string
chapter_number = obj["title"].string.toFloatOrNull() ?: 0f chapter_number = obj["title"].string.toFloatOrNull() ?: -1f
// The property is written wrong. // The property is written wrong.
date_upload = DATE_FORMATTER.tryParseTime(obj["publishied_at"].string) date_upload = DATE_FORMATTER.tryParseTime(obj["publishied_at"].string)

View File

@ -5,7 +5,7 @@ ext {
extName = 'mangásPROJECT' extName = 'mangásPROJECT'
pkgNameSuffix = 'pt.mangasproject' pkgNameSuffix = 'pt.mangasproject'
extClass = '.MangasProjectFactory' extClass = '.MangasProjectFactory'
extVersionCode = 14 extVersionCode = 15
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -239,7 +239,7 @@ abstract class MangasProject(
.sorted() .sorted()
.joinToString() .joinToString()
url = release["link"].string url = release["link"].string
chapter_number = obj["number"].string.toFloatOrNull() ?: 0f chapter_number = obj["number"].string.toFloatOrNull() ?: -1f
} }
} }
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Saikai Scan' extName = 'Saikai Scan'
pkgNameSuffix = 'pt.saikaiscan' pkgNameSuffix = 'pt.saikaiscan'
extClass = '.SaikaiScan' extClass = '.SaikaiScan'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -119,7 +119,7 @@ class SaikaiScan : ParsedHttpSource() {
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply { override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
scanlator = "Saikai Scan" scanlator = "Saikai Scan"
chapter_number = CHAPTER_REGEX.find(element.text())?.groupValues?.get(1)?.toFloatOrNull() ?: 1f chapter_number = CHAPTER_REGEX.find(element.text())?.groupValues?.get(1)?.toFloatOrNull() ?: -1f
name = element.text() name = element.text()
url = element.attr("href") url = element.attr("href")
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Super Mangás' extName = 'Super Mangás'
pkgNameSuffix = 'pt.supermangas' pkgNameSuffix = 'pt.supermangas'
extClass = '.SuperMangasFactory' extClass = '.SuperMangasFactory'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -290,7 +290,7 @@ abstract class SuperMangasGeneric(
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply { override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
name = element.select("a").first()!!.text() name = element.select("a").first()!!.text()
chapter_number = element.select("span[style]").first()!!.text().toFloatOrNull() ?: 0f chapter_number = element.select("span[style]").first()!!.text().toFloatOrNull() ?: -1f
setUrlWithoutDomain(element.select("a").first()!!.attr("href")) setUrlWithoutDomain(element.select("a").first()!!.attr("href"))
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Tsuki Mangás' extName = 'Tsuki Mangás'
pkgNameSuffix = 'pt.tsukimangas' pkgNameSuffix = 'pt.tsukimangas'
extClass = '.TsukiMangas' extClass = '.TsukiMangas'
extVersionCode = 1 extVersionCode = 2
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -230,7 +230,7 @@ class TsukiMangas : HttpSource() {
private fun chapterListItemParse(obj: JsonObject, slug: String): SChapter = SChapter.create().apply { private fun chapterListItemParse(obj: JsonObject, slug: String): SChapter = SChapter.create().apply {
name = "Cap. " + obj["NUMERO"].string + name = "Cap. " + obj["NUMERO"].string +
(if (obj["TITULO"].string.isNotEmpty()) " - " + obj["TITULO"].string else "") (if (obj["TITULO"].string.isNotEmpty()) " - " + obj["TITULO"].string else "")
chapter_number = obj["NUMERO"].string.toFloatOrNull() ?: 0f chapter_number = obj["NUMERO"].string.toFloatOrNull() ?: -1f
scanlator = obj["scans"].array.joinToString { it.obj["NOME"].string } scanlator = obj["scans"].array.joinToString { it.obj["NOME"].string }
date_upload = DATE_FORMATTER.tryParseDate(obj["DATA"].string.substringBefore("T")) date_upload = DATE_FORMATTER.tryParseDate(obj["DATA"].string.substringBefore("T"))
url = "/leitor/$slug/" + obj["NUMERO"].string url = "/leitor/$slug/" + obj["NUMERO"].string

View File

@ -5,7 +5,7 @@ ext {
extName = 'YES Mangás' extName = 'YES Mangás'
pkgNameSuffix = 'pt.yesmangas' pkgNameSuffix = 'pt.yesmangas'
extClass = '.YesMangas' extClass = '.YesMangas'
extVersionCode = 5 extVersionCode = 6
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -90,7 +90,7 @@ class YesMangas : ParsedHttpSource() {
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply { override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
name = element.attr("title").substringAfter(" - ") name = element.attr("title").substringAfter(" - ")
chapter_number = element.text().toFloatOrNull() ?: 1f chapter_number = element.text().toFloatOrNull() ?: -1f
setUrlWithoutDomain(element.attr("href")) setUrlWithoutDomain(element.attr("href"))
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'Henchan' extName = 'Henchan'
pkgNameSuffix = 'ru.henchan' pkgNameSuffix = 'ru.henchan'
extClass = '.Henchan' extClass = '.Henchan'
extVersionCode = 19 extVersionCode = 20
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -240,7 +240,7 @@ class Henchan : ParsedHttpSource() {
chapter.setUrlWithoutDomain(element.select("h2 a").attr("href")) chapter.setUrlWithoutDomain(element.select("h2 a").attr("href"))
val chapterName = element.select("h2 a").attr("title") val chapterName = element.select("h2 a").attr("title")
chapter.name = chapterName chapter.name = chapterName
chapter.chapter_number = "(глава\\s|часть\\s)(\\d+)".toRegex(RegexOption.IGNORE_CASE).find(chapterName)?.groupValues?.get(2)?.toFloat() ?: 0F chapter.chapter_number = "(глава\\s|часть\\s)(\\d+)".toRegex(RegexOption.IGNORE_CASE).find(chapterName)?.groupValues?.get(2)?.toFloat() ?: -1F
chapter.date_upload = Date().time // setting to current date because of a sorting in the "Recent updates" section chapter.date_upload = Date().time // setting to current date because of a sorting in the "Recent updates" section
return chapter return chapter
} }

View File

@ -5,7 +5,7 @@ ext {
extName = 'ManHuaGui' extName = 'ManHuaGui'
pkgNameSuffix = 'zh.manhuagui' pkgNameSuffix = 'zh.manhuagui'
extClass = '.Manhuagui' extClass = '.Manhuagui'
extVersionCode = 5 extVersionCode = 6
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -246,7 +246,7 @@ class Manhuagui : ConfigurableSource, ParsedHttpSource() {
val currentChapter = SChapter.create() val currentChapter = SChapter.create()
currentChapter.url = it.attr("href") currentChapter.url = it.attr("href")
currentChapter.name = it?.attr("title")?.trim() ?: it.select("span").first().ownText() currentChapter.name = it?.attr("title")?.trim() ?: it.select("span").first().ownText()
currentChapter.chapter_number = chNumRegex.find(currentChapter.name)?.value?.toFloatOrNull() ?: 0F currentChapter.chapter_number = chNumRegex.find(currentChapter.name)?.value?.toFloatOrNull() ?: -1F
// Manhuagui only provide upload date for latest chapter // Manhuagui only provide upload date for latest chapter
if (currentChapter.url == latestChapterHref) { if (currentChapter.url == latestChapterHref) {