ReadeManga Update (#2356)

ReadeManga Update
This commit is contained in:
happywillow0 2020-03-04 07:12:41 -05:00 committed by GitHub
parent c3ea208356
commit 7f98272539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: LectorManga' appName = 'Tachiyomi: LectorManga'
pkgNameSuffix = 'es.lectormanga' pkgNameSuffix = 'es.lectormanga'
extClass = '.LectorManga' extClass = '.LectorManga'
extVersionCode = 8 extVersionCode = 9
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -42,7 +42,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
.followRedirects(true) .followRedirects(true)
.build()!! .build()!!
private val userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36" private val userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36"
override fun headersBuilder(): Headers.Builder { override fun headersBuilder(): Headers.Builder {
return Headers.Builder() return Headers.Builder()
@ -238,10 +238,10 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
return chapter return chapter
} }
private fun parseChapterDate(date: String): Long = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(date).time private fun parseChapterDate(date: String): Long = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).parse(date)?.time ?: 0
private var time = serverTime() //Grab time at app launch, can be updated private var time = serverTime() //Grab time at app launch, can be updated
private fun serverTime() :String { private fun serverTime() :String {
val formatter = SimpleDateFormat("yyyy-MM-dd kk:mm:ss", Locale.US) val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US)
formatter.timeZone = TimeZone.getTimeZone("GMT+1") //Convert time to match server formatter.timeZone = TimeZone.getTimeZone("GMT+1") //Convert time to match server
return formatter.format(Date()) return formatter.format(Date())
} }