Add Edens Fairy (#2530)
* Add Edens Fairy * Add type filter * Fix message * Change message * Sort genres
This commit is contained in:
		
							parent
							
								
									9713ac2bcf
								
							
						
					
					
						commit
						c47be31508
					
				
							
								
								
									
										9
									
								
								src/es/eflee/build.gradle
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/es/eflee/build.gradle
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| ext { | ||||
|     extName = 'Edens Fairy' | ||||
|     extClass = '.Eflee' | ||||
|     themePkg = 'zeistmanga' | ||||
|     baseUrl = 'https://www.eflee.co' | ||||
|     overrideVersionCode = 0 | ||||
| } | ||||
| 
 | ||||
| apply from: "$rootDir/common.gradle" | ||||
							
								
								
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-hdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-hdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 5.6 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-mdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-mdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 2.8 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-xhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-xhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 8.2 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-xxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-xxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 16 KiB | 
							
								
								
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-xxxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/es/eflee/res/mipmap-xxxhdpi/ic_launcher.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 24 KiB | 
| @ -0,0 +1,79 @@ | ||||
| package eu.kanade.tachiyomi.extension.es.eflee | ||||
| 
 | ||||
| import eu.kanade.tachiyomi.multisrc.zeistmanga.Genre | ||||
| import eu.kanade.tachiyomi.multisrc.zeistmanga.GenreList | ||||
| import eu.kanade.tachiyomi.multisrc.zeistmanga.Type | ||||
| import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga | ||||
| import eu.kanade.tachiyomi.network.GET | ||||
| import eu.kanade.tachiyomi.source.model.Filter | ||||
| import eu.kanade.tachiyomi.source.model.FilterList | ||||
| import eu.kanade.tachiyomi.util.asJsoup | ||||
| import kotlinx.coroutines.CoroutineScope | ||||
| import kotlinx.coroutines.Dispatchers | ||||
| import kotlinx.coroutines.launch | ||||
| import org.jsoup.nodes.Document | ||||
| 
 | ||||
| class Eflee : ZeistManga( | ||||
|     "Edens Fairy", | ||||
|     "https://www.eflee.co", | ||||
|     "es", | ||||
| ) { | ||||
|     override val popularMangaSelector = "#PopularPosts3 article" | ||||
|     override val popularMangaSelectorTitle = ".post-title a" | ||||
|     override val popularMangaSelectorUrl = popularMangaSelectorTitle | ||||
| 
 | ||||
|     override val useNewChapterFeed = true | ||||
|     override val chapterCategory = "Cap" | ||||
| 
 | ||||
|     override val hasFilters = true | ||||
|     override val hasLanguageFilter = false | ||||
|     override val hasGenreFilter = false | ||||
|     override val hasStatusFilter = false | ||||
| 
 | ||||
|     private var genresList: List<Genre> = emptyList() | ||||
|     private var fetchGenresAttempts: Int = 0 | ||||
| 
 | ||||
|     override fun getFilterList(): FilterList { | ||||
|         CoroutineScope(Dispatchers.IO).launch { fetchGenres() } | ||||
|         val filters = super.getFilterList().list.toMutableList() | ||||
|         if (genresList.isNotEmpty()) { | ||||
|             filters += GenreList( | ||||
|                 title = "Generos", | ||||
|                 genres = genresList, | ||||
|             ) | ||||
|         } else { | ||||
|             filters += listOf( | ||||
|                 Filter.Separator(), | ||||
|                 Filter.Header("Presione 'Restablecer' para intentar mostrar los géneros"), | ||||
|             ) | ||||
|         } | ||||
|         return FilterList(filters) | ||||
|     } | ||||
| 
 | ||||
|     override fun getTypeList(): List<Type> = listOf( | ||||
|         Type("Todos", ""), | ||||
|         Type("Manga", "Manga"), | ||||
|         Type("Manhua", "Manhua"), | ||||
|         Type("Manhwa", "Manhwa"), | ||||
|     ) | ||||
| 
 | ||||
|     private fun fetchGenres() { | ||||
|         if (fetchGenresAttempts < 3 && genresList.isEmpty()) { | ||||
|             try { | ||||
|                 genresList = client.newCall(GET(baseUrl, headers)).execute() | ||||
|                     .use { parseGenres(it.asJsoup()) } | ||||
|                     .sortedBy { it.value } | ||||
|             } catch (_: Exception) { | ||||
|             } finally { | ||||
|                 fetchGenresAttempts++ | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private fun parseGenres(document: Document): List<Genre> { | ||||
|         return document.select(".filters .filter:first-child input:not(.hidden)") | ||||
|             .map { element -> | ||||
|                 Genre(element.attr("id"), element.attr("value")) | ||||
|             } | ||||
|     } | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Chopper
						Chopper