Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Small fixes #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ open class BoxNovelProvider : MainAPI() {
rating =
(sum?.selectFirst("> div.rating > div.post-total-rating > span.score")?.text()
?.toFloat()?.times(200))?.toInt()
posterUrl = imageHeader.selectFirst("> img")?.attr("data-src")
posterUrl = imageHeader.selectFirst("> img")?.let { if(it.hasAttr("data-src")) it.attr("data-src") else it.attr("src")}
}
}

Expand Down Expand Up @@ -135,7 +135,7 @@ open class BoxNovelProvider : MainAPI() {

newSearchResponse(name = name, url = url ?: return@mapNotNull null) {
posterUrl =
fixUrlNull(h.selectFirst("> div > div.tab-thumb > a > img")?.attr("data-src"))
fixUrlNull(h.selectFirst("> div > div.tab-thumb > a > img")?.let{if(it.hasAttr("data-src")) it.attr("data-src") else it.attr("src")})
rating = if (ratingTxt != null) {
(ratingTxt.toFloat() * 200).toInt()
} else {
Expand All @@ -149,7 +149,7 @@ open class BoxNovelProvider : MainAPI() {
fun getChapters(text: String): List<ChapterData> {
val document = Jsoup.parse(text)
val data: ArrayList<ChapterData> = ArrayList()
val chapterHeaders = document.select("ul.version-chap > li.wp-manga-chapter")
val chapterHeaders = document.select("ul.version-chap li.wp-manga-chapter")
for (c in chapterHeaders) {
val header = c?.selectFirst("> a")
val cUrl = header?.attr("href")
Expand Down Expand Up @@ -209,7 +209,7 @@ open class BoxNovelProvider : MainAPI() {
"completed" -> STATUS_COMPLETE
else -> STATUS_NULL
}
posterUrl = fixUrlNull(document.select("div.summary_image > a > img").attr("data-src"))
posterUrl = fixUrlNull(document.select("div.summary_image > a > img").let{if(it.hasAttr("data-src")) it.attr("data-src") else it.attr("src")})
rating = ((document.selectFirst("span#averagerate")?.text()?.toFloatOrNull()
?: 0f) * 200).toInt()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ import com.lagradost.quicknovel.*
import org.jsoup.Jsoup
import com.lagradost.quicknovel.MainActivity.Companion.app

class EfremnetProvider : ReadfromnetProvider() {
override val iconId = R.drawable.icon_efremnet
override val mainUrl = "https://efrem.net" // https://graycity.net/
override val iconBackgroundId = R.color.wuxiaWorldOnlineColor
override val name = "Efrem.net"
}

class GraycityProvider : ReadfromnetProvider() {
override val name: String = "Graycity"
override val iconId = R.drawable.icon_efremnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ class NovelBinProvider : MainAPI() {
"Store" to "store",
)

val fullPosterRegex = Regex("/novel_[0-9]*_[0-9]*/")

override suspend fun loadMainPage(
page: Int,
mainCategory: String?,
Expand All @@ -101,7 +103,7 @@ class NovelBinProvider : MainAPI() {
SearchResponse(
name = a.text(),
url = fixUrlNull(a.attr("href")) ?: return@mapNotNull null,
fixUrlNull(element.selectFirst("div > div > img")?.attr("data-src")),
fixUrlNull(element.selectFirst("div > div > img")?.attr("data-src")?.replace( fullPosterRegex, "/novel/")),
null,
null,
this.name
Expand Down Expand Up @@ -137,7 +139,7 @@ class NovelBinProvider : MainAPI() {
val title = h.selectFirst(">div>div>.truyen-title>a")
?: h.selectFirst(">div>div>.novel-title>a") ?: return@mapNotNull null
newSearchResponse(title.text(), title.attr("href") ?: return@mapNotNull null) {
posterUrl = fixUrlNull(h.selectFirst(">div>div>img")?.attr("src"))
posterUrl = fixUrlNull(h.selectFirst(">div>div>img")?.attr("src")?.replace( fullPosterRegex, "/novel/"))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ open class ReadfromnetProvider : MainAPI() {

posterUrl =
fixUrlNull(
document.selectFirst("div.box_in > center:nth-child(1) > div > a > img")
document.selectFirst("div.box_in > center > div > a > img")
?.attr("src")
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MainAdapter2(private val resView: AutofitRecyclerView) : ListAdapter<Searc
ViewGroup.LayoutParams.MATCH_PARENT,
coverHeight
)
setImage(card.posterUrl, headers = card.posterHeaders)
setImage(card.image)
setLayerType(View.LAYER_TYPE_SOFTWARE, null) // HALF IMAGE DISPLAYING FIX
setOnClickListener {
loadResult(card.url, card.apiName)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lagradost/quicknovel/util/Apis.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Apis {
//MNovelFreeProvider(), // same as NovelFullVipProvider
//EngNovelProvider(),
NovelsOnlineProvider(),
EfremnetProvider(),
//EfremnetProvider(), // domain is expired
GraycityProvider(),
MtlNovelProvider(),

Expand Down