Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add Wolfdotcom #6534

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
8 changes: 8 additions & 0 deletions src/ko/wolfdotcom/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ext {
extName = 'Wolf.com'
extClass = '.WolfFactory'
extVersionCode = 1
isNsfw = true
}

apply from: "$rootDir/common.gradle"
Binary file added src/ko/wolfdotcom/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/ko/wolfdotcom/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package eu.kanade.tachiyomi.extension.ko.wolfdotcom

import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import okhttp3.HttpUrl

interface UrlPartFilter {
fun addToUrl(url: HttpUrl.Builder)
}

class FilterData(
val type: String,
private val typeDisplayName: String? = null,
val value: String?,
private val valueDisplayName: String,
) {
override fun toString(): String {
return "$typeDisplayName: $valueDisplayName"
}
}

class SearchFilter(
private val options: List<FilterData>,
) : Filter.Select<String>(
"필터",
options.map { it.toString() }.toTypedArray(),
),
UrlPartFilter {
override fun addToUrl(url: HttpUrl.Builder) {
val selected = options[state]
url.addQueryParameter("type1", selected.type)
selected.value?.let {
url.addQueryParameter("type2", it)
}
}
}

class SortFilter(default: Int = 0) :
Filter.Select<String>(
"정렬 기준",
options.map { it.first }.toTypedArray(),
default,
),
UrlPartFilter {

override fun addToUrl(url: HttpUrl.Builder) {
url.addQueryParameter("o", options[state].second)
}

companion object {
private val options = listOf(
"최신순" to "n",
"인기순" to "f",
)
}
}

val POPULAR = FilterList(SortFilter(1))
val LATEST = FilterList(SortFilter(0))
Loading
Loading