-
Notifications
You must be signed in to change notification settings - Fork 562
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 Novelfull #6823
Open
FunnyTiming
wants to merge
8
commits into
keiyoushi:main
Choose a base branch
from
FunnyTiming:mangafre
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Novelfull #6823
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3c14867
Add mangafre
FunnyTiming c51e13f
First step
FunnyTiming a6943fa
More advencements
FunnyTiming 8119e4a
More code
FunnyTiming 73b0950
Arghhhhhhh (sound of pain)
FunnyTiming edba02e
More code
FunnyTiming 0e657b3
Almost finished
FunnyTiming 050c56e
Add headers
FunnyTiming File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ext { | ||
extName = 'NovelFull' | ||
extClass = '.NovelFullFactory' | ||
extVersionCode = 1 | ||
isNsfw = true | ||
} | ||
|
||
apply from: "$rootDir/common.gradle" |
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
src/all/novelfull/src/eu/kanade/tachiyomi/extension/all/novelfull/NovelFullFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package eu.kanade.tachiyomi.extension.all.novelfull | ||
|
||
import eu.kanade.tachiyomi.source.Source | ||
import eu.kanade.tachiyomi.source.SourceFactory | ||
|
||
class NovelFullFactory : SourceFactory { | ||
/** | ||
* Create a new copy of the sources | ||
* @return The created sources | ||
*/ | ||
override fun createSources(): List<Source> { | ||
return listOf( | ||
NovelFull(), | ||
NovelFullId(), | ||
NovelFullZh(), | ||
) | ||
} | ||
} | ||
|
||
class NovelFull : NovelFullGlobal("en") | ||
class NovelFullId : NovelFullGlobal("id", supportsSearch = false) | ||
class NovelFullZh : NovelFullGlobal("zh", supportsSearch = false) |
196 changes: 196 additions & 0 deletions
196
src/all/novelfull/src/eu/kanade/tachiyomi/extension/all/novelfull/NovelFullFilters.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
package eu.kanade.tachiyomi.extension.all.novelfull | ||
|
||
import eu.kanade.tachiyomi.source.model.Filter | ||
|
||
object Note : Filter.Header("NOTE: Ignored if using text search!") | ||
|
||
class SelectFilterOption(val name: String, val value: String) | ||
|
||
abstract class SelectFilter(name: String, private val options: List<SelectFilterOption>, default: Int = 0) : Filter.Select<String>(name, options.map { it.name }.toTypedArray(), default) { | ||
val selected: String | ||
get() = options[state].value | ||
} | ||
|
||
class GenreFilter( | ||
options: List<SelectFilterOption>, | ||
default: Int, | ||
) : SelectFilter("Genre", options, default) | ||
|
||
fun getGenreFilter(lang: String): List<SelectFilterOption> { | ||
val allGenres: Map<String, List<SelectFilterOption>> = mapOf( | ||
"en" to listOf( | ||
SelectFilterOption("All", ""), | ||
SelectFilterOption("Romance", "169"), | ||
SelectFilterOption("Fantasy", "168"), | ||
SelectFilterOption("Modern", "185"), | ||
SelectFilterOption("Adventure", "164"), | ||
SelectFilterOption("Harem", "174"), | ||
SelectFilterOption("Sci-Fi", "189"), | ||
SelectFilterOption("Action", "202"), | ||
SelectFilterOption("Historical", "175"), | ||
SelectFilterOption("Xuanhuan", "201"), | ||
SelectFilterOption("Urban", "203"), | ||
SelectFilterOption("Mystery", "163"), | ||
SelectFilterOption("LGBT+", "195"), | ||
SelectFilterOption("Magic", "345"), | ||
SelectFilterOption("Comedy", "211"), | ||
SelectFilterOption("School Life", "196"), | ||
SelectFilterOption("Drama", "224"), | ||
SelectFilterOption("Adult", "302"), | ||
SelectFilterOption("Time Travel", "284"), | ||
SelectFilterOption("Psychological", "293"), | ||
SelectFilterOption("Violence", "362"), | ||
SelectFilterOption("History", "225"), | ||
SelectFilterOption("Virtual Reality", "524"), | ||
SelectFilterOption("Full Color", "260"), | ||
SelectFilterOption("Smut", "272"), | ||
SelectFilterOption("Shounen ai", "289"), | ||
SelectFilterOption("Vampires", "298"), | ||
SelectFilterOption("Seinen(M)", "350"), | ||
SelectFilterOption("Magical Girls", "521"), | ||
SelectFilterOption("Webtoon", "256"), | ||
SelectFilterOption("Josei(W)", "265"), | ||
SelectFilterOption("Mature", "282"), | ||
SelectFilterOption("Shounen(B)", "294"), | ||
SelectFilterOption("Manhua", "312"), | ||
SelectFilterOption("Gore", "364"), | ||
SelectFilterOption("Shoujo(G)", "252"), | ||
SelectFilterOption("Isekai", "262"), | ||
SelectFilterOption("Demons", "274"), | ||
SelectFilterOption("Supernatural", "291"), | ||
SelectFilterOption("Gender Bender", "300"), | ||
SelectFilterOption("Sports", "352"), | ||
SelectFilterOption("Reverse Isekai ", "523"), | ||
SelectFilterOption("Adaptation", "258"), | ||
SelectFilterOption("Slice of Life", "270"), | ||
SelectFilterOption("Ecchi", "295"), | ||
SelectFilterOption("parody", "520"), | ||
SelectFilterOption("Manhwa", "254"), | ||
SelectFilterOption("Medical", "264"), | ||
SelectFilterOption("Yaoi(BL)", "278"), | ||
), | ||
"id" to listOf( | ||
SelectFilterOption("Semua", ""), | ||
SelectFilterOption("Percintaan", "173"), | ||
SelectFilterOption("Fantasi", "176"), | ||
SelectFilterOption("Sejarah", "182"), | ||
SelectFilterOption("Tindakan", "205"), | ||
SelectFilterOption("Harem", "177"), | ||
SelectFilterOption("Sci-Fi", "178"), | ||
SelectFilterOption("Xuanhuan", "209"), | ||
SelectFilterOption("Perkotaan", "181"), | ||
SelectFilterOption("Kampus", "180"), | ||
SelectFilterOption("Petualangan", "206"), | ||
SelectFilterOption("Misteri", "208"), | ||
SelectFilterOption("Sihir", "235"), | ||
SelectFilterOption("Komedi", "232"), | ||
SelectFilterOption("Drama", "218"), | ||
SelectFilterOption("Isekai", "241"), | ||
SelectFilterOption("Perjalanan waktu", "222"), | ||
SelectFilterOption("Dewasa", "212"), | ||
SelectFilterOption("LGBT+", "250"), | ||
SelectFilterOption("School Life", "316"), | ||
SelectFilterOption("Yaoi(BL)", "324"), | ||
SelectFilterOption("Fantasi Timur", "536"), | ||
SelectFilterOption("Adult", "223"), | ||
SelectFilterOption("Slice of Life", "233"), | ||
SelectFilterOption("Tragedy", "320"), | ||
SelectFilterOption("Manhwa", "215"), | ||
SelectFilterOption("Magic", "454"), | ||
SelectFilterOption("Romance", "221"), | ||
SelectFilterOption("Webtoon", "231"), | ||
SelectFilterOption("Historical", "239"), | ||
SelectFilterOption("Psychological", "247"), | ||
SelectFilterOption("Medical", "317"), | ||
SelectFilterOption("Smut", "213"), | ||
SelectFilterOption("Shounen ai", "325"), | ||
SelectFilterOption("Fantasy", "219"), | ||
SelectFilterOption("Umum", "537"), | ||
SelectFilterOption("Demons", "228"), | ||
SelectFilterOption("Office Workers", "242"), | ||
SelectFilterOption("Action", "251"), | ||
SelectFilterOption("Shounen(B)", "321"), | ||
SelectFilterOption("Adaptation", "216"), | ||
SelectFilterOption("Yuri(GL)", "522"), | ||
SelectFilterOption("Adventure", "240"), | ||
SelectFilterOption("Manhua", "249"), | ||
SelectFilterOption("Mystery", "319"), | ||
SelectFilterOption("Josei(W)", "214"), | ||
SelectFilterOption("Martial Arts", "347"), | ||
SelectFilterOption("Full Color", "220"), | ||
SelectFilterOption("Supernatural", "229"), | ||
SelectFilterOption("Shoujo(G)", "237"), | ||
SelectFilterOption("Reincarnation", "244"), | ||
|
||
), | ||
"zh" to listOf( | ||
SelectFilterOption("全部", ""), | ||
SelectFilterOption("热血恋爱", "127"), | ||
SelectFilterOption("热血玄幻古风", "130"), | ||
SelectFilterOption("彩虹都市", "121"), | ||
SelectFilterOption("热血冒险", "131"), | ||
SelectFilterOption("治愈", "108"), | ||
SelectFilterOption("搞笑", "101"), | ||
SelectFilterOption("古风", "115"), | ||
SelectFilterOption("校园", "106"), | ||
SelectFilterOption("猎奇", "114"), | ||
SelectFilterOption("日常", "105"), | ||
SelectFilterOption("同人", "116"), | ||
SelectFilterOption("恋爱都市", "123"), | ||
SelectFilterOption("纯爱", "535"), | ||
SelectFilterOption("恋爱后宫搞笑", "128"), | ||
SelectFilterOption("其它", "542"), | ||
SelectFilterOption("生活", "135"), | ||
SelectFilterOption("修真", "513"), | ||
SelectFilterOption("恐怖", "111"), | ||
SelectFilterOption("百合", "518"), | ||
SelectFilterOption("奇幻冒险", "528"), | ||
SelectFilterOption("耽美", "533"), | ||
SelectFilterOption("恋爱古风", "126"), | ||
SelectFilterOption("灵异", "540"), | ||
SelectFilterOption("总裁", "545"), | ||
SelectFilterOption("恋爱", "104"), | ||
SelectFilterOption("后宫", "498"), | ||
SelectFilterOption("玄幻", "109"), | ||
SelectFilterOption("霸总", "516"), | ||
SelectFilterOption("剧情", "526"), | ||
SelectFilterOption("恋爱校园都市", "119"), | ||
SelectFilterOption("少年", "531"), | ||
SelectFilterOption("恋爱搞笑治愈", "124"), | ||
SelectFilterOption("战争", "538"), | ||
SelectFilterOption("校园日常", "129"), | ||
SelectFilterOption("大女主", "543"), | ||
SelectFilterOption("热血", "102"), | ||
SelectFilterOption("架空", "496"), | ||
SelectFilterOption("日漫", "107"), | ||
SelectFilterOption("动作", "514"), | ||
SelectFilterOption("悬疑", "112"), | ||
SelectFilterOption("四格", "519"), | ||
SelectFilterOption("热血悬疑都市", "117"), | ||
SelectFilterOption("系统", "529"), | ||
SelectFilterOption("校园搞笑", "122"), | ||
SelectFilterOption("魔法", "534"), | ||
SelectFilterOption("推理", "541"), | ||
SelectFilterOption("热恋", "134"), | ||
SelectFilterOption("真人", "546"), | ||
SelectFilterOption("科幻", "499"), | ||
SelectFilterOption("奇幻", "110"), | ||
SelectFilterOption("欢乐向", "517"), | ||
SelectFilterOption("励志", "527"), | ||
SelectFilterOption("恋爱奇幻", "120"), | ||
SelectFilterOption("少女", "532"), | ||
SelectFilterOption("热血悬疑", "125"), | ||
SelectFilterOption("竞技", "539"), | ||
SelectFilterOption("格斗", "544"), | ||
SelectFilterOption("冒险", "103"), | ||
SelectFilterOption("穿越", "497"), | ||
SelectFilterOption("[empty]", "515"), | ||
SelectFilterOption("都市", "113"), | ||
SelectFilterOption("武侠", "525"), | ||
SelectFilterOption("玄幻都市", "118"), | ||
SelectFilterOption("爱情", "530"), | ||
), | ||
) | ||
// TODO: Automate this | ||
return allGenres[lang] ?: emptyList() | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need help here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could maybe have a list of tripple and build the list based on language/index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure for multiple languages, but you can use the selector:
ul.nav > li:has(> a:containsOwn(Genre)) ul > li
with that you can get id and name kinda like this:
(code can be considered pseudo code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there something called when the settings are called for the first time ? I remember to see a message like "Click on [Reset] to load genres" but I have no memories of this source, nor the function who is called.
OK I will check Mihon sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many sources with that wording. Search for
reset.*genre
in the codebase (enable regex searching)When first loading the extensions the genres are not fetched yet, so resetting it will rerun
getFilterList()
and add them to the filters.