Compare commits

..

3 Commits
v2.0 ... v2.0.1

Author SHA1 Message Date
30ac4435d4 Update version 2021-11-22 08:41:35 +02:00
1b9dfe1901 Temporary change anibel domain 2021-11-21 17:41:32 +02:00
808a6efd8f [Source] [MangaOwl] Fix not loading chapter list 2021-11-21 17:13:39 +02:00
4 changed files with 11 additions and 9 deletions

View File

@@ -13,8 +13,8 @@ android {
applicationId 'org.koitharu.kotatsu' applicationId 'org.koitharu.kotatsu'
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 31 targetSdkVersion 31
versionCode 372 versionCode 373
versionName '2.0' versionName '2.0.1'
generatedDensities = [] generatedDensities = []
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -10,7 +10,7 @@ class AnibelRepository(loaderContext: MangaLoaderContext) : RemoteMangaRepositor
override val source = MangaSource.ANIBEL override val source = MangaSource.ANIBEL
override val defaultDomain = "anibel.net" override val defaultDomain = "old.anibel.net"
override val sortOrders: Set<SortOrder> = EnumSet.of( override val sortOrders: Set<SortOrder> = EnumSet.of(
SortOrder.NEWEST SortOrder.NEWEST

View File

@@ -93,7 +93,7 @@ class MangaOwlRepository(loaderContext: MangaLoaderContext) : RemoteMangaReposit
}, },
chapters = table.select("div.table.table-chapter-list").select("li.list-group-item.chapter_list").asReversed().mapIndexed { i, li -> chapters = table.select("div.table.table-chapter-list").select("li.list-group-item.chapter_list").asReversed().mapIndexed { i, li ->
val a = li.select("a") val a = li.select("a")
val href = a.attr("href").ifEmpty { val href = a.attr("data-href").ifEmpty {
parseFailed("Link is missing") parseFailed("Link is missing")
} }
MangaChapter( MangaChapter(

View File

@@ -70,13 +70,14 @@ class RemoteMangaRepositoryTest(private val source: MangaSource) : KoinTest {
@Test @Test
fun details() = coroutineTestRule.runBlockingTest { fun details() = coroutineTestRule.runBlockingTest {
val list = repo.getList2(20, query = null, sortOrder = SortOrder.POPULARITY, tags = null) val list = repo.getList2(20, query = null, sortOrder = SortOrder.POPULARITY, tags = null)
val item = list.first() val manga = list.first()
val details = repo.getDetails(item) println(manga.title + ": " + manga.url)
val details = repo.getDetails(manga)
Truth.assertThat(details.chapters).isNotEmpty() Truth.assertThat(details.chapters).isNotEmpty()
Truth.assertThat(details.publicUrl).isAbsoluteUrl() Truth.assertThat(details.publicUrl).isAbsoluteUrl()
Truth.assertThat(details.description).isNotNull() Truth.assertThat(details.description).isNotNull()
Truth.assertThat(details.title).startsWith(item.title) Truth.assertThat(details.title).startsWith(manga.title)
Truth.assertThat(details.source).isEqualTo(source) Truth.assertThat(details.source).isEqualTo(source)
Truth.assertThat(details.chapters?.map { it.id }).containsNoDuplicates() Truth.assertThat(details.chapters?.map { it.id }).containsNoDuplicates()
@@ -88,8 +89,9 @@ class RemoteMangaRepositoryTest(private val source: MangaSource) : KoinTest {
@Test @Test
fun pages() = coroutineTestRule.runBlockingTest { fun pages() = coroutineTestRule.runBlockingTest {
val list = repo.getList2(20, query = null, sortOrder = SortOrder.POPULARITY, tags = null) val list = repo.getList2(20, query = null, sortOrder = SortOrder.POPULARITY, tags = null)
val chapter = val manga = list.first()
repo.getDetails(list.first()).chapters?.firstOrNull() ?: error("Chapter is null") println(manga.title + ": " + manga.url)
val chapter = repo.getDetails(manga).chapters?.firstOrNull() ?: error("Chapter is null")
val pages = repo.getPages(chapter) val pages = repo.getPages(chapter)
Truth.assertThat(pages).isNotEmpty() Truth.assertThat(pages).isNotEmpty()