订阅规则支持页数

pull/300/head
gedoor 4 years ago
parent 1f2be58185
commit 69f9ee17dc
  1. 2
      app/src/main/java/io/legado/app/model/Debug.kt
  2. 4
      app/src/main/java/io/legado/app/ui/rss/article/RssArticlesViewModel.kt

@ -55,7 +55,7 @@ object Debug {
debugSource = rssSource.sourceUrl debugSource = rssSource.sourceUrl
log(debugSource, "︾开始解析") log(debugSource, "︾开始解析")
val sort = rssSource.sortUrls().entries.first() val sort = rssSource.sortUrls().entries.first()
Rss.getArticles(sort.key, sort.value, rssSource, null) Rss.getArticles(sort.key, sort.value, rssSource, null, 1)
.onSuccess { .onSuccess {
if (it.articles.isEmpty()) { if (it.articles.isEmpty()) {
log(debugSource, "⇒列表页解析成功,为空") log(debugSource, "⇒列表页解析成功,为空")

@ -27,10 +27,10 @@ class RssArticlesViewModel(application: Application) : BaseViewModel(application
} }
} }
fun loadContent(rssSource: RssSource) { fun loadContent(rssSource: RssSource) {
isLoading = true isLoading = true
Rss.getArticles(sortName, sortUrl, rssSource, null, 1) page = 1
Rss.getArticles(sortName, sortUrl, rssSource, null, page)
.onSuccess(Dispatchers.IO) { .onSuccess(Dispatchers.IO) {
nextPageUrl = it.nextPageUrl nextPageUrl = it.nextPageUrl
it.articles.let { list -> it.articles.let { list ->

Loading…
Cancel
Save