Improve remote repository tests

This commit is contained in:
Koitharu
2021-07-15 19:54:22 +03:00
parent 6a3421df8a
commit d2609c0560
12 changed files with 213 additions and 185 deletions

View File

@@ -26,11 +26,8 @@ class MangareadRepository(
sortOrder: SortOrder?,
tag: MangaTag?
): List<Manga> {
if (offset % PAGE_SIZE != 0) {
return emptyList()
}
val payload = createRequestTemplate()
payload["page"] = (offset / PAGE_SIZE).toString()
payload["page"] = (offset / PAGE_SIZE.toFloat()).toIntUp().toString()
payload["vars[meta_key]"] = when (sortOrder) {
SortOrder.POPULARITY -> "_wp_manga_views"
SortOrder.UPDATED -> "_latest_update"