diff --git a/src/en/rainofsnow/build.gradle b/src/en/rainofsnow/build.gradle index a9c1a58f5..f1b697dc9 100644 --- a/src/en/rainofsnow/build.gradle +++ b/src/en/rainofsnow/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Rain Of Snow' pkgNameSuffix = 'en.rainofsnow' extClass = '.RainOfSnow' - extVersionCode = 3 + extVersionCode = 4 libVersion = '1.2' containsNsfw = false } diff --git a/src/en/rainofsnow/src/eu/kanade/tachiyomi/extension/en/rainofsnow/RainOfSnow.kt b/src/en/rainofsnow/src/eu/kanade/tachiyomi/extension/en/rainofsnow/RainOfSnow.kt index 3da38fc81..ba40de87f 100644 --- a/src/en/rainofsnow/src/eu/kanade/tachiyomi/extension/en/rainofsnow/RainOfSnow.kt +++ b/src/en/rainofsnow/src/eu/kanade/tachiyomi/extension/en/rainofsnow/RainOfSnow.kt @@ -12,6 +12,9 @@ import okhttp3.Request import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.Locale import java.util.concurrent.TimeUnit open class RainOfSnow() : ParsedHttpSource() { @@ -30,7 +33,7 @@ open class RainOfSnow() : ParsedHttpSource() { .build() override fun popularMangaRequest(page: Int): Request { - return GET("$baseUrl/comic/") + return GET("$baseUrl/comics-library/page/$page") } override fun popularMangaSelector() = "ul.boxhover1 li" @@ -94,9 +97,19 @@ open class RainOfSnow() : ParsedHttpSource() { val chapter = SChapter.create() chapter.url = element.select("a").attr("abs:href") chapter.name = element.select("a").text() + chapter.date_upload = element.select("small").firstOrNull()?.text() + ?.let { parseChapterDate(it) } ?: 0 return chapter } + private fun parseChapterDate(date: String): Long { + var parsedDate = 0L + try { + parsedDate = SimpleDateFormat("MMM dd, yyyy", Locale.US).parse(date)?.time ?: 0L + } catch (e: ParseException) { /*nothing to do, parsedDate is initialized with 0L*/ } + return parsedDate + } + override fun pageListRequest(chapter: SChapter): Request { if (chapter.url.startsWith("http")) { return GET(chapter.url, headers)