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:
parent
672cdad094
commit
dd22e25de8
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'MangAdventure'
|
||||
pkgNameSuffix = 'all.mangadventure'
|
||||
extClass = '.MangAdventureFactory'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ val SChapter.path: String
|
|||
*/
|
||||
fun SChapter.fromJSON(obj: JSONObject) = apply {
|
||||
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"))
|
||||
scanlator = obj.getJSONArray("groups").joinField("name", " & ")
|
||||
name = obj.optString(
|
||||
|
|
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'MANGA Plus by SHUEISHA'
|
||||
pkgNameSuffix = 'all.mangaplus'
|
||||
extClass = '.MangaPlusFactory'
|
||||
extVersionCode = 12
|
||||
extVersionCode = 13
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ abstract class MangaPlus(
|
|||
scanlator = "Shueisha"
|
||||
date_upload = 1000L * it.startTimeStamp
|
||||
url = "#/viewer/${it.chapterId}"
|
||||
chapter_number = it.name.substringAfter("#").toFloatOrNull() ?: 0f
|
||||
chapter_number = it.name.substringAfter("#").toFloatOrNull() ?: -1f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Toomics'
|
||||
pkgNameSuffix = 'all.toomics'
|
||||
extClass = '.ToomicsFactory'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ abstract class ToomicsGlobal(
|
|||
val numText = if (num.isNotEmpty()) "$num - " else ""
|
||||
|
||||
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()!!)
|
||||
scanlator = "Toomics"
|
||||
url = element.select("a").attr("onclick")
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'VIZ Shonen Jump'
|
||||
pkgNameSuffix = 'en.vizshonenjump'
|
||||
extClass = '.VizShonenJump'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ class VizShonenJump : ParsedHttpSource() {
|
|||
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"
|
||||
url = element.attr("data-target-url")
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Mangakawaii'
|
||||
pkgNameSuffix = 'fr.mangakawaii'
|
||||
extClass = '.MangaKawaii'
|
||||
extVersionCode = 9
|
||||
extVersionCode = 10
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class MangaKawaii : ParsedHttpSource() {
|
|||
val chapter = SChapter.create()
|
||||
chapter.url = element.select("a.list-item__title").attr("href")
|
||||
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())
|
||||
return chapter
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Nikkangecchan'
|
||||
pkgNameSuffix = 'ja.nikkangecchan'
|
||||
extClass = '.Nikkangecchan'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class Nikkangecchan : ParsedHttpSource() {
|
|||
|
||||
return SChapter.create().apply {
|
||||
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"
|
||||
setUrlWithoutDomain(baseUrl + episodePage.attr("data-src").substringBeforeLast("/"))
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'HipercooL'
|
||||
pkgNameSuffix = 'pt.hipercool'
|
||||
extClass = '.Hipercool'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
libVersion = '1.2'
|
||||
containsNsfw = true
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ class Hipercool : HttpSource() {
|
|||
|
||||
private fun chapterListItemParse(book: JsonObject, obj: JsonObject): SChapter = SChapter.create().apply {
|
||||
name = obj["title"].string
|
||||
chapter_number = obj["title"].string.toFloatOrNull() ?: 0f
|
||||
chapter_number = obj["title"].string.toFloatOrNull() ?: -1f
|
||||
// The property is written wrong.
|
||||
date_upload = DATE_FORMATTER.tryParseTime(obj["publishied_at"].string)
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'mangásPROJECT'
|
||||
pkgNameSuffix = 'pt.mangasproject'
|
||||
extClass = '.MangasProjectFactory'
|
||||
extVersionCode = 14
|
||||
extVersionCode = 15
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -239,7 +239,7 @@ abstract class MangasProject(
|
|||
.sorted()
|
||||
.joinToString()
|
||||
url = release["link"].string
|
||||
chapter_number = obj["number"].string.toFloatOrNull() ?: 0f
|
||||
chapter_number = obj["number"].string.toFloatOrNull() ?: -1f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Saikai Scan'
|
||||
pkgNameSuffix = 'pt.saikaiscan'
|
||||
extClass = '.SaikaiScan'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ class SaikaiScan : ParsedHttpSource() {
|
|||
|
||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
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()
|
||||
url = element.attr("href")
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Super Mangás'
|
||||
pkgNameSuffix = 'pt.supermangas'
|
||||
extClass = '.SuperMangasFactory'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
libVersion = '1.2'
|
||||
containsNsfw = true
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ abstract class SuperMangasGeneric(
|
|||
|
||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
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"))
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Tsuki Mangás'
|
||||
pkgNameSuffix = 'pt.tsukimangas'
|
||||
extClass = '.TsukiMangas'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ class TsukiMangas : HttpSource() {
|
|||
private fun chapterListItemParse(obj: JsonObject, slug: String): SChapter = SChapter.create().apply {
|
||||
name = "Cap. " + obj["NUMERO"].string +
|
||||
(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 }
|
||||
date_upload = DATE_FORMATTER.tryParseDate(obj["DATA"].string.substringBefore("T"))
|
||||
url = "/leitor/$slug/" + obj["NUMERO"].string
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'YES Mangás'
|
||||
pkgNameSuffix = 'pt.yesmangas'
|
||||
extClass = '.YesMangas'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class YesMangas : ParsedHttpSource() {
|
|||
|
||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
name = element.attr("title").substringAfter(" - ")
|
||||
chapter_number = element.text().toFloatOrNull() ?: 1f
|
||||
chapter_number = element.text().toFloatOrNull() ?: -1f
|
||||
setUrlWithoutDomain(element.attr("href"))
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Henchan'
|
||||
pkgNameSuffix = 'ru.henchan'
|
||||
extClass = '.Henchan'
|
||||
extVersionCode = 19
|
||||
extVersionCode = 20
|
||||
libVersion = '1.2'
|
||||
containsNsfw = true
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ class Henchan : ParsedHttpSource() {
|
|||
chapter.setUrlWithoutDomain(element.select("h2 a").attr("href"))
|
||||
val chapterName = element.select("h2 a").attr("title")
|
||||
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
|
||||
return chapter
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'ManHuaGui'
|
||||
pkgNameSuffix = 'zh.manhuagui'
|
||||
extClass = '.Manhuagui'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ class Manhuagui : ConfigurableSource, ParsedHttpSource() {
|
|||
val currentChapter = SChapter.create()
|
||||
currentChapter.url = it.attr("href")
|
||||
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
|
||||
if (currentChapter.url == latestChapterHref) {
|
||||
|
|
Loading…
Reference in New Issue