Update BookChapter.kt

修正
pull/1118/head
bushixuanqi 3 years ago committed by GitHub
parent 3fd43d343a
commit cfb4f7185f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/data/entities/BookChapter.kt

@ -11,7 +11,6 @@ import io.legado.app.utils.fromJsonObject
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
@Parcelize
@Entity(
tableName = "chapters",
@ -63,7 +62,8 @@ data class BookChapter(
fun getAbsoluteURL():String{
val pos = url.indexOf(',')
return if (pos == -1) url else "${url.substring(0,pos).trim{it < '!'}},${url.substring(pos + 1).trim{it < '!'}}"
return if (pos == -1) NetworkUtils.getAbsoluteURL(baseUrl,url)
else NetworkUtils.getAbsoluteURL(baseUrl,url.substring(0,pos))+","+url.substring(pos + 1)
}
fun getFileName(): String = String.format("%05d-%s.nb", index, MD5Utils.md5Encode16(title))

Loading…
Cancel
Save