|
|
@ -11,7 +11,6 @@ import io.legado.app.utils.fromJsonObject |
|
|
|
import kotlinx.parcelize.IgnoredOnParcel |
|
|
|
import kotlinx.parcelize.IgnoredOnParcel |
|
|
|
import kotlinx.parcelize.Parcelize |
|
|
|
import kotlinx.parcelize.Parcelize |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Parcelize |
|
|
|
@Parcelize |
|
|
|
@Entity( |
|
|
|
@Entity( |
|
|
|
tableName = "chapters", |
|
|
|
tableName = "chapters", |
|
|
@ -63,7 +62,8 @@ data class BookChapter( |
|
|
|
|
|
|
|
|
|
|
|
fun getAbsoluteURL():String{ |
|
|
|
fun getAbsoluteURL():String{ |
|
|
|
val pos = url.indexOf(',') |
|
|
|
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)) |
|
|
|
fun getFileName(): String = String.format("%05d-%s.nb", index, MD5Utils.md5Encode16(title)) |
|
|
|