Change sort UI in MyMangaReader CMS source (#322)

* Use correct filter type for sort

* Update MyMangaReader CMS sources

* Bump MyMangaReaderCMS extension version number
Properly get image URL on some sources
This commit is contained in:
Andy Bao 2018-05-09 11:11:42 -04:00 committed by Carlos
parent 0c8a5aa58d
commit 350d6d9a73
4 changed files with 82 additions and 69 deletions

View File

@ -5,8 +5,8 @@ ext {
appName = 'Tachiyomi: My Manga Reader CMS (Many sources)' appName = 'Tachiyomi: My Manga Reader CMS (Many sources)'
pkgNameSuffix = 'all.mmrcms' pkgNameSuffix = 'all.mmrcms'
extClass = '.MyMangaReaderCMSSources' extClass = '.MyMangaReaderCMSSources'
extVersionCode = 4 extVersionCode = 5
extVersionSuffix = 4 extVersionSuffix = 5
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -238,13 +238,14 @@ gen "en" "Fallen Angels Scans" "http://manga.fascans.com"
# Went offline # Went offline
# gen "en" "MangaRoot" "http://mangaroot.com" # gen "en" "MangaRoot" "http://mangaroot.com"
gen "en" "Mangawww Reader" "http://mangawww.com" gen "en" "Mangawww Reader" "http://mangawww.com"
gen "en" "MangaForLife" "http://manga4ever.com" # Went offline
# gen "en" "MangaForLife" "http://manga4ever.com"
gen "en" "Manga Spoil" "http://mangaspoil.com" gen "en" "Manga Spoil" "http://mangaspoil.com"
# Protected by CloudFlare # Protected by CloudFlare
# gen "en" "MangaBlue" "http://mangablue.com" # gen "en" "MangaBlue" "http://mangablue.com"
# Some sort of anti-bot system gen "en" "Manga Forest" "https://mangaforest.com"
# gen "en" "Manga Forest" "https://mangaforest.com" # Went offline
gen "en" "DManga" "http://dmanga.website" # gen "en" "DManga" "http://dmanga.website"
gen "en" "Chibi Manga Reader" "http://www.cmreader.info" gen "en" "Chibi Manga Reader" "http://www.cmreader.info"
gen "en" "ZXComic" "http://zxcomic.com" gen "en" "ZXComic" "http://zxcomic.com"
# Went offline # Went offline
@ -252,7 +253,8 @@ gen "en" "ZXComic" "http://zxcomic.com"
gen "en" "Mangacox" "http://mangacox.com" gen "en" "Mangacox" "http://mangacox.com"
# Protected by CloudFlare # Protected by CloudFlare
# gen "en" "GO Manhwa" "http://gomanhwa.xyz" # gen "en" "GO Manhwa" "http://gomanhwa.xyz"
gen "en" "KoManga" "https://komanga.net" # Went offline
# gen "en" "KoManga" "https://komanga.net"
# Went offline # Went offline
# gen "en" "Manganimecan" "http://manganimecan.com" # gen "en" "Manganimecan" "http://manganimecan.com"
gen "en" "Hentai2Manga" "http://hentai2manga.com" gen "en" "Hentai2Manga" "http://hentai2manga.com"
@ -275,7 +277,8 @@ gen "fr" "scans-manga" "http://scans-manga.com"
gen "fr" "Henka no Kaze" "http://henkanokazelel.esy.es/upload" gen "fr" "Henka no Kaze" "http://henkanokazelel.esy.es/upload"
# Went offline # Went offline
# gen "fr" "Tous Vos Scans" "http://www.tous-vos-scans.com" # gen "fr" "Tous Vos Scans" "http://www.tous-vos-scans.com"
gen "id" "Manga Desu" "http://mangadesu.net" # Went offline
# gen "id" "Manga Desu" "http://mangadesu.net"
# Went offline # Went offline
# gen "id" "Komik Mangafire.ID" "http://go.mangafire.id" # gen "id" "Komik Mangafire.ID" "http://go.mangafire.id"
gen "id" "MangaOnline" "http://mangaonline.web.id" gen "id" "MangaOnline" "http://mangaonline.web.id"
@ -288,22 +291,22 @@ gen "id" "Manga FYI" "http://mangafyi.com/manga/indonesian"
gen "id" "Bacamangaku" "http://www.bacamangaku.com" gen "id" "Bacamangaku" "http://www.bacamangaku.com"
# Went offline # Went offline
# gen "id" "Indo Manga Reader" "http://indomangareader.com" # gen "id" "Indo Manga Reader" "http://indomangareader.com"
# Some sort of anti-bot system # Protected by Cloudflare
# gen "it" "Kingdom Italia Reader" "http://kireader.altervista.org" # gen "it" "Kingdom Italia Reader" "http://kireader.altervista.org"
# Went offline # Went offline
# gen "ja" "IchigoBook" "http://ichigobook.com" # gen "ja" "IchigoBook" "http://ichigobook.com"
# Went offline # Went offline
# gen "ja" "Mangaraw Online" "http://mangaraw.online" # gen "ja" "Mangaraw Online" "http://mangaraw.online"
gen "ja" "Mangazuki RAWS" "https://raws.mangazuki.co" gen "ja" "Mangazuki RAWS" "https://raws.mangazuki.co"
gen "ja" "MangaRAW" "https://www.mgraw.com" # Went offline
# gen "ja" "MangaRAW" "https://www.mgraw.com"
gen "ja" "マンガ/漫画 マガジン/雑誌 raw" "http://netabare-manga-raw.com" gen "ja" "マンガ/漫画 マガジン/雑誌 raw" "http://netabare-manga-raw.com"
gen "pl" "ToraScans" "http://torascans.pl" gen "pl" "ToraScans" "http://torascans.pl"
gen "pt" "Comic Space" "https://www.comicspace.com.br" gen "pt" "Comic Space" "https://www.comicspace.com.br"
gen "pt" "Mangás Yuri" "https://mangasyuri.net" gen "pt" "Mangás Yuri" "https://mangasyuri.net"
gen "ru" "NAKAMA" "http://nakama.ru" gen "ru" "NAKAMA" "http://nakama.ru"
# Went offline # Went offline
# gen "ru" "AkaiYuhiMun team" "https://akaiyuhimun.ru/reader" # gen "tr" "MangAoi" "http://mangaoi.com"
gen "tr" "MangAoi" "http://mangaoi.com"
gen "tr" "MangaHanta" "http://mangahanta.com" gen "tr" "MangaHanta" "http://mangahanta.com"
gen "tr" "ManhuaTR" "http://www.manhua-tr.com" gen "tr" "ManhuaTR" "http://www.manhua-tr.com"
gen "vi" "Fallen Angels Scans" "http://truyen.fascans.com" gen "vi" "Fallen Angels Scans" "http://truyen.fascans.com"

File diff suppressed because one or more lines are too long

View File

@ -221,7 +221,14 @@ class MyMangaReaderCMSSource(override val lang: String,
override fun pageListParse(response: Response) override fun pageListParse(response: Response)
= response.asJsoup().select("#all > .img-responsive") = response.asJsoup().select("#all > .img-responsive")
.mapIndexed { i, e -> .mapIndexed { i, e ->
val url = e.attr("data-src").trim() var url = e.attr("data-src")
if(url.isBlank()) {
url = e.attr("src")
}
url = url.trim()
Page(i, url, url) Page(i, url, url)
} }
@ -246,19 +253,7 @@ class MyMangaReaderCMSSource(override val lang: String,
}.toTypedArray() }.toTypedArray()
) )
), ),
UriSelectFilter("Sort by", SortFilter()
"sortBy",
arrayOf(
"name" to "Name",
"views" to "Popularity",
"last_release" to "Last update"
), false),
UriSelectFilter("Sort direction",
"asc",
arrayOf(
"true" to "Ascending",
"false" to "Descending"
), false)
) )
/** /**
@ -296,6 +291,23 @@ class MyMangaReaderCMSSource(override val lang: String,
} }
} }
class SortFilter: Filter.Sort("Sort",
sortables.map { it.second }.toTypedArray(),
Filter.Sort.Selection(0, true)), UriFilter {
override fun addToUri(uri: Uri.Builder) {
uri.appendQueryParameter("sortBy", sortables[state!!.index].first)
uri.appendQueryParameter("asc", state!!.ascending.toString())
}
companion object {
private val sortables = arrayOf(
"name" to "Name",
"views" to "Popularity",
"last_release" to "Last update"
)
}
}
/** /**
* Represents a filter that is able to modify a URI. * Represents a filter that is able to modify a URI.
*/ */