|
|
|
@ -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)) |
|
|
|
|