mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Handle unimplented chapter urls
This commit is contained in:
parent
98cba545a5
commit
480567419f
3 changed files with 5 additions and 5 deletions
|
@ -398,7 +398,7 @@ abstract class HttpSource : CatalogueSource {
|
|||
manga ?: return null
|
||||
|
||||
val chapterUrl = chapter.url.getUrlWithoutDomain()
|
||||
val mangaUrl = mangaDetailsRequest(manga).url.toString()
|
||||
val mangaUrl = getMangaUrl(manga)
|
||||
return if (chapterUrl.isBlank()) {
|
||||
mangaUrl
|
||||
} else {
|
||||
|
|
|
@ -237,8 +237,8 @@ class MangaDetailsPresenter(
|
|||
|
||||
fun getChapterUrl(chapter: Chapter): String? {
|
||||
val source = source as? HttpSource ?: return null
|
||||
val chapterUrl = source.getChapterUrl(chapter)
|
||||
return chapterUrl.takeIf { it.isNotEmpty() } ?: source.getChapterUrl(manga, chapter)
|
||||
val chapterUrl = try { source.getChapterUrl(chapter) } catch (_: Exception) { null }
|
||||
return chapterUrl.takeIf { !it.isNullOrBlank() } ?: source.getChapterUrl(manga, chapter)
|
||||
}
|
||||
|
||||
private fun getScrollType(chapters: List<ChapterItem>) {
|
||||
|
|
|
@ -637,8 +637,8 @@ class ReaderViewModel(
|
|||
val manga = manga ?: return null
|
||||
val source = getSource() ?: return null
|
||||
val chapter = getCurrentChapter()?.chapter ?: return null
|
||||
val chapterUrl = source.getChapterUrl(chapter)
|
||||
return chapterUrl.takeIf { it.isNotEmpty() } ?: source.getChapterUrl(manga, chapter)
|
||||
val chapterUrl = try { source.getChapterUrl(chapter) } catch (_: Exception) { null }
|
||||
return chapterUrl.takeIf { !it.isNullOrBlank() } ?: source.getChapterUrl(manga, chapter)
|
||||
}
|
||||
|
||||
fun getSource() = manga?.source?.let { sourceManager.getOrStub(it) } as? HttpSource
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue