Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/inorichi/tachiyomi
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryAdapter.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt
  • Loading branch information
NerdNumber9 committed Apr 15, 2018
2 parents aafe863 + e7e1a9b commit 234c3bb
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ class Mangachan : ParsedHttpSource() {
}
}
}
is OrderBy -> { if (filter.state!!.ascending && filter.state!!.index == 0) { statusParam = false } }
is Status -> status = arrayOf("", "all_done", "end", "ongoing", "new_ch")[filter.state]
is OrderBy -> {
if (filter.state!!.ascending && filter.state!!.index == 0) {
statusParam = false
}
}
is Status -> status = arrayOf("", "all_done", "end", "ongoing", "new_ch")[filter.state]
}
}

Expand Down Expand Up @@ -103,6 +107,7 @@ class Mangachan : ParsedHttpSource() {

override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.thumbnail_url = element.select("div.manga_images img").first().attr("src")
element.select("h2 > a").first().let {
manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.text()
Expand Down Expand Up @@ -220,32 +225,22 @@ class Mangachan : ParsedHttpSource() {
GenreList(getGenreList())
)

// private class StatusList(status: List<Status>) : Filter.Group<Status>("Статус", status)
// private class Status(name: String, val id: String) : Filter.CheckBox(name, false)
// private fun getStatusList() = listOf(
// Status("Перевод завершен", "/all_done"),
// Status("Выпуск завершен", "/end"),
// Status("Онгоинг", "/ongoing"),
// Status("Новые главы", "/new_ch")
// )


/* [...document.querySelectorAll("li.sidetag > a:nth-child(1)")].map((el,i) =>
* { const link=el.getAttribute('href');const id=link.substr(6,link.length);
* return `Genre("${id.replace("_", " ")}")` }).join(',\n')
/* [...document.querySelectorAll("li.sidetag > a:nth-child(1)")]
* .map(el => `Genre("${el.getAttribute('href').substr(6)}")`).join(',\n')
* on http://mangachan.me/
*/
private fun getGenreList() = listOf(
Genre("18 плюс"),
Genre("18_плюс"),
Genre("bdsm"),
Genre("арт"),
Genre("боевик"),
Genre("боевые искусства"),
Genre("боевые_искусства"),
Genre("вампиры"),
Genre("веб"),
Genre("гарем"),
Genre("гендерная интрига"),
Genre("героическое фэнтези"),
Genre("гендерная_интрига"),
Genre("героическое_фэнтези"),
Genre("детектив"),
Genre("дзёсэй"),
Genre("додзинси"),
Expand All @@ -262,13 +257,13 @@ class Mangachan : ParsedHttpSource() {
Genre("меха"),
Genre("мистика"),
Genre("музыка"),
Genre("научная фантастика"),
Genre("научная_фантастика"),
Genre("повседневность"),
Genre("постапокалиптика"),
Genre("приключения"),
Genre("психология"),
Genre("романтика"),
Genre("самурайский боевик"),
Genre("самурайский_боевик"),
Genre("сборник"),
Genre("сверхъестественное"),
Genre("сказка"),
Expand All @@ -279,7 +274,6 @@ class Mangachan : ParsedHttpSource() {
Genre("сёдзё-ай"),
Genre("сёнэн"),
Genre("сёнэн-ай"),
Genre("темное фэнтези"),
Genre("тентакли"),
Genre("трагедия"),
Genre("триллер"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,19 @@ class Mintmanga : ParsedHttpSource() {

override val supportsLatest = true

override fun headersBuilder() = Headers.Builder().apply {
add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)")
add("Referer", baseUrl)
}

override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers)

override fun latestUpdatesRequest(page: Int): Request =
GET("$baseUrl/list?sortType=updated&offset=${70 * (page - 1)}&max=70", headers)

override fun popularMangaSelector() = "div.desc"
override fun popularMangaSelector() = "div.tile"

override fun latestUpdatesSelector() = "div.desc"
override fun latestUpdatesSelector() = "div.tile"

override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.thumbnail_url = element.select("img.lazy").first().attr("data-original")
element.select("h3 > a").first().let {
manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.attr("title")
Expand Down Expand Up @@ -90,10 +86,15 @@ class Mintmanga : ParsedHttpSource() {

override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("a").first()
val urlText = urlElement.text()

val chapter = SChapter.create()
chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mature=1")
chapter.name = urlElement.text().replace(" новое", "")
chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mtr=1")
if (urlText.endsWith(" новое")) {
chapter.name = urlText.dropLast(6)
} else {
chapter.name = urlText
}
chapter.date_upload = element.select("td:eq(1)").first()?.text()?.let {
SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time
} ?: 0
Expand Down Expand Up @@ -143,11 +144,19 @@ class Mintmanga : ParsedHttpSource() {

override fun imageUrlParse(document: Document) = ""

override fun imageRequest(page: Page): Request {
val imgHeader = Headers.Builder().apply {
add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)")
add("Referer", baseUrl)
}.build()
return GET(page.imageUrl!!, imgHeader)
}

private class Genre(name: String, val id: String) : Filter.TriState(name)

/* [...document.querySelectorAll("tr.advanced_option:nth-child(1) > td:nth-child(3) span.js-link")].map((el,i) => {
* const onClick=el.getAttribute('onclick');const id=onClick.substr(31,onClick.length-33);
* return `Genre("${el.textContent.trim()}", "${id}")` }).join(',\n')
/* [...document.querySelectorAll("tr.advanced_option:nth-child(1) > td:nth-child(3) span.js-link")]
* .map(el => `Genre("${el.textContent.trim()}", $"{el.getAttribute('onclick')
* .substr(31,el.getAttribute('onclick').length-33)"})`).join(',\n')
* on http://mintmanga.com/search/advanced
*/
override fun getFilterList() = FilterList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ class Readmanga : ParsedHttpSource() {

override val supportsLatest = true

override fun headersBuilder() = Headers.Builder().apply {
add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)")
add("Referer", baseUrl)
}

override fun popularMangaSelector() = "div.desc"
override fun popularMangaSelector() = "div.tile"

override fun latestUpdatesSelector() = "div.desc"
override fun latestUpdatesSelector() = "div.tile"

override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers)
Expand All @@ -41,6 +36,7 @@ class Readmanga : ParsedHttpSource() {

override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create()
manga.thumbnail_url = element.select("img.lazy").first().attr("data-original")
element.select("h3 > a").first().let {
manga.setUrlWithoutDomain(it.attr("href"))
manga.title = it.attr("title")
Expand Down Expand Up @@ -90,10 +86,15 @@ class Readmanga : ParsedHttpSource() {

override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("a").first()
val urlText = urlElement.text()

val chapter = SChapter.create()
chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mature=1")
chapter.name = urlElement.text().replace(" новое", "")
chapter.setUrlWithoutDomain(urlElement.attr("href") + "?mtr=1")
if (urlText.endsWith(" новое")) {
chapter.name = urlText.dropLast(6)
} else {
chapter.name = urlText
}
chapter.date_upload = element.select("td:eq(1)").first()?.text()?.let {
SimpleDateFormat("dd/MM/yy", Locale.US).parse(it).time
} ?: 0
Expand Down Expand Up @@ -143,11 +144,19 @@ class Readmanga : ParsedHttpSource() {

override fun imageUrlParse(document: Document) = ""

override fun imageRequest(page: Page): Request {
val imgHeader = Headers.Builder().apply {
add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)")
add("Referer", baseUrl)
}.build()
return GET(page.imageUrl!!, imgHeader)
}

private class Genre(name: String, val id: String) : Filter.TriState(name)

/* [...document.querySelectorAll("tr.advanced_option:nth-child(1) > td:nth-child(3) span.js-link")].map((el,i) => {
* const onClick=el.getAttribute('onclick');const id=onClick.substr(31,onClick.length-33);
* return `Genre("${el.textContent.trim()}", "${id}")` }).join(',\n')
/* [...document.querySelectorAll("tr.advanced_option:nth-child(1) > td:nth-child(3) span.js-link")]
* .map(el => `Genre("${el.textContent.trim()}", $"{el.getAttribute('onclick')
* .substr(31,el.getAttribute('onclick').length-33)"})`).join(',\n')
* on http://readmanga.me/search/advanced
*/
override fun getFilterList() = FilterList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LibraryCategoryAdapter(val view: LibraryCategoryView) :
* @param manga the manga to find.
*/
fun indexOf(manga: Manga): Int {
return mangas.indexOfFirst { it.manga.id == manga.id }
return currentItems.indexOfFirst { it.manga.id == manga.id }
}

fun performFilter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class LibraryController(
/**
* Currently selected mangas.
*/
val selectedMangas = mutableListOf<Manga>()
val selectedMangas = mutableSetOf<Manga>()

private var selectedCoverManga: Manga? = null

Expand Down Expand Up @@ -476,11 +476,13 @@ class LibraryController(
*/
fun setSelection(manga: Manga, selected: Boolean) {
if (selected) {
selectedMangas.add(manga)
selectionRelay.call(LibrarySelectionEvent.Selected(manga))
if (selectedMangas.add(manga)) {
selectionRelay.call(LibrarySelectionEvent.Selected(manga))
}
} else {
selectedMangas.remove(manga)
selectionRelay.call(LibrarySelectionEvent.Unselected(manga))
if (selectedMangas.remove(manga)) {
selectionRelay.call(LibrarySelectionEvent.Unselected(manga))
}
}
}

Expand Down
30 changes: 15 additions & 15 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<string name="label_recent_updates">Nouveautés bibliothèque</string>
<string name="label_latest_updates">Dernières nouveautés</string>
<string name="label_categories">Catégories</string>
<string name="label_selected">Sélectionné: %1$d</string>
<string name="label_selected">Sélectionné : %1$d</string>
<string name="label_backup">Sauvegarde</string>

<!-- Actions -->
Expand Down Expand Up @@ -57,7 +57,7 @@
<string name="action_retry">Réessayer</string>
<string name="action_remove">Supprimer</string>
<string name="action_resume">Reprendre</string>
<string name="action_open_in_browser">Ouvre dans le navigateur</string>
<string name="action_open_in_browser">Ouvrir dans le navigateur</string>
<string name="action_add_to_home_screen">Ajouter à l\'écran d\'accueil</string>
<string name="action_display_mode">Changer le mode d\'affichage</string>
<string name="action_display">Affichage</string>
Expand Down Expand Up @@ -152,9 +152,9 @@
<string name="rotation_force_portrait">Forcer portrait</string>
<string name="rotation_force_landscape">Forcer paysage</string>
<string name="color_filter_r_value">R</string>
<string name="color_filter_g_value">G</string>
<string name="color_filter_g_value">V</string>
<string name="color_filter_b_value">B</string>
<string name="color_filter_a_value">A</string>
<string name="color_filter_a_value">O</string>


<!-- Downloads section -->
Expand All @@ -164,7 +164,7 @@
<string name="pref_remove_after_read">Supprimer après avoir lu</string>
<string name="disabled">Désactivé</string>
<string name="last_read_chapter">Dernier chapitre lu</string>
<string name="second_to_last">Avant-dernier chapiture lu</string>
<string name="second_to_last">Avant-dernier chapitre lu</string>
<string name="third_to_last">Du troisième au dernier chapitre</string>
<string name="fourth_to_last">Du quatrième au dernier chapitre</string>
<string name="pref_download_new">Télécharger les nouveaux chapitres</string>
Expand Down Expand Up @@ -286,7 +286,7 @@

<!-- Reader activity -->
<string name="custom_filter">Filtre personnalisé</string>
<string name="set_as_cover">Mettre comme couverture</string>
<string name="set_as_cover">Ajouter comme couverture</string>
<string name="cover_updated">Couverture mise à jour</string>
<string name="page_downloaded">Page copiée vers %1$s</string>
<string name="downloading">En cours de téléchargement…</string>
Expand All @@ -313,7 +313,7 @@
<string name="notification_update_progress">Progression mise à jour: %1$d/%2$d</string>
<string name="notification_new_chapters">Des nouveaux chapitres ont été trouvés</string>
<string name="notification_cover_update_failed">La mise à jour de la couverture a échoué</string>
<string name="notification_first_add_to_library">Veuillez ajouter le manga dans votre bibliothèque avant de faire cela</string>
<string name="notification_first_add_to_library">Veuillez ajouter le manga dans votre bibliothèque avant</string>
<string name="notification_not_connected_to_ac_body">Non branché</string>
<string name="notification_no_connection_title">Synchronisation annulée</string>
<string name="notification_no_connection_body">Connexion non disponible</string>
Expand All @@ -324,15 +324,15 @@
<string name="file_select_icon">Sélectionner une icône de raccourci</string>

<!--UpdateCheck-->
<string name="update_check_title">Nouvelle mise à jour disponible!</string>
<string name="update_check_title">Nouvelle mise à jour disponible !</string>
<string name="update_check_confirm">Télécharger</string>
<string name="update_check_ignore">Ignorer</string>
<string name="update_check_no_new_updates">Aucun mise à jour disponible</string>
<string name="update_check_no_new_updates">Aucune mise à jour disponible</string>
<string name="update_check_download_started">Téléchargement commencé</string>
<string name="update_check_look_for_updates">Vérification des mises à jour</string>

<!--UpdateCheck Notifications-->
<string name="update_check_notification_file_download">Télécharger mise à jour</string>
<string name="update_check_notification_file_download">Télécharger la mise à jour</string>
<string name="update_check_notification_download_in_progress">Téléchargement en cours</string>
<string name="update_check_notification_download_complete">Téléchargement terminé</string>
<string name="update_check_notification_download_error">Erreur lors du téléchargement</string>
Expand Down Expand Up @@ -400,12 +400,12 @@
<string name="pref_backup_directory">Dossier de sauvegarde</string>
<string name="pref_backup_service_category">Service</string>
<string name="source_not_found">Source introuvable</string>
<string name="restore_completed">Restauration terminé</string>
<string name="restore_completed">Restauration terminée</string>
<string name="error_opening_log">Impossible d\'ouvrir le fichier journal</string>
<string name="file_saved">Fichier enregistré dans %1$s</string>
<string name="backup_choice">Que voulez-vous sauvegarder?</string>
<string name="backup_choice">Que voulez-vous sauvegarder ?</string>
<string name="invalid_combination">Le défaut ne peut pas être selectionné avec des autres catégories</string>
<string name="delete_downloads_for_manga">Supprimer les chapitres téléchargés?</string>
<string name="delete_downloads_for_manga">Supprimer les chapitres téléchargés ?</string>

<string name="notification_new_chapters_text">Pour %1$s chapitres</string>
<string name="track">Suivi</string>
Expand Down Expand Up @@ -439,15 +439,15 @@

<string name="pref_read_with_volume_keys_inverted">Inverse les boutons de volume</string>
<string name="pref_crop_borders">Rogner les bordures</string>
<string name="backup_restore_content">La restauration utilise le source pour obtenir des données, des frais de l\'opérateur peuvent s\'appliquer.
<string name="backup_restore_content">La restauration utilise la source pour obtenir des données, des frais de l\'opérateur peuvent s\'appliquer.
Assurez-vous que vous êtes connecté à des sources qui le demande avant de commencer la restauration.</string>
<string name="action_global_search">Recherche globale</string>
<string name="action_open">Ouvrir</string>
<string name="action_login">Connexion</string>

<string name="other_source">Autre</string>
<string name="action_global_search_hint">Recherche globale…</string>
<string name="no_results">Aucun résultat!</string>
<string name="no_results">Aucun résultat !</string>
<string name="latest">Récents</string>
<string name="browse">Explorer</string>

Expand Down

0 comments on commit 234c3bb

Please sign in to comment.