Skip to content

Commit

Permalink
add source: flowermanga (#467)
Browse files Browse the repository at this point in the history
* feat(madara): add source flowermanga

* Update URL in source.json

* feat(madara): add source prismascans

* Revert "feat(madara): add source prismascans"

This reverts commit f96e741.

* Fix src/rust/madara/sources/flowermanga/res/Icon.png

* Fix src/rust/madara/sources/flowermanga/src/lib.rs
  • Loading branch information
julioreigen authored Oct 4, 2023
1 parent 7b04486 commit 6fef490
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rust/madara/sources/flowermanga/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "flowermanga"
version = "0.1.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]

[dependencies]
aidoku = { git = "https://github.com/Aidoku/aidoku-rs/" }
madara_template = { path = "../../template" }
Binary file added src/rust/madara/sources/flowermanga/res/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
192 changes: 192 additions & 0 deletions src/rust/madara/sources/flowermanga/res/filters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
[
{
"type": "title"
},
{
"type": "group",
"name": "Status",
"filters": [
{
"type": "check",
"name": "Em Andamento"
},
{
"type": "check",
"name": "Cancelado"
},
{
"type": "check",
"name": "Concluído"
}
]
},
{
"type": "select",
"name": "Genre Condition",
"options": [
"OU (há pelo menos um dos gêneros selecionados)",
"E (há todos os gêneros selecionados)"
]
},
{
"type": "group",
"name": "Genres",
"filters": [
{
"type": "genre",
"name": "+18",
"id": "18"
},
{
"type": "genre",
"name": "Ação",
"id": "acao"
},
{
"type": "genre",
"name": "Adaptação",
"id": "adaptacao"
},
{
"type": "genre",
"name": "Adulto",
"id": "adulto"
},
{
"type": "genre",
"name": "Artes Marciais",
"id": "artes-marciais"
},
{
"type": "genre",
"name": "Aventura",
"id": "aventura"
},
{
"type": "genre",
"name": "Demônio",
"id": "demonio"
},
{
"type": "genre",
"name": "Demônios",
"id": "demonios"
},
{
"type": "genre",
"name": "Drama",
"id": "drama"
},
{
"type": "genre",
"name": "Época",
"id": "epoca"
},
{
"type": "genre",
"name": "Escolar",
"id": "escolar"
},
{
"type": "genre",
"name": "Família",
"id": "familia"
},
{
"type": "genre",
"name": "Fantasia",
"id": "fantasia"
},
{
"type": "genre",
"name": "Harém",
"id": "harem"
},
{
"type": "genre",
"name": "Harém Reverso",
"id": "harem-reverso"
},
{
"type": "genre",
"name": "Histórico",
"id": "historico"
},
{
"type": "genre",
"name": "Isekai",
"id": "isekai"
},
{
"type": "genre",
"name": "Josei",
"id": "josei"
},
{
"type": "genre",
"name": "Manhwa",
"id": "manhwa"
},
{
"type": "genre",
"name": "Mistério",
"id": "misterio"
},
{
"type": "genre",
"name": "Moderno",
"id": "moderno"
},
{
"type": "genre",
"name": "Psicológico",
"id": "psicologico"
},
{
"type": "genre",
"name": "Reencarnação",
"id": "reencarnacao"
},
{
"type": "genre",
"name": "Romance",
"id": "romance"
},
{
"type": "genre",
"name": "Shoujo",
"id": "shoujo"
},
{
"type": "genre",
"name": "Shounen",
"id": "shounen"
},
{
"type": "genre",
"name": "Slice of Life",
"id": "slice-of-life"
},
{
"type": "genre",
"name": "Sobrenatural",
"id": "sobrenatural"
},
{
"type": "genre",
"name": "Sobrevivência",
"id": "sobrevivencia"
},
{
"type": "genre",
"name": "Tragédia",
"id": "tragedia"
},
{
"type": "genre",
"name": "Vingança",
"id": "vinganca"
}
]
}
]
16 changes: 16 additions & 0 deletions src/rust/madara/sources/flowermanga/res/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"type": "group",
"title": "Configurações",
"footer": "Nota: A maioria das fontes de Madara tem uma imagem de capa de alta resolução e uma imagem de capa de baixa resolução.\nUsar a imagem de alta resolução aumentará a quantidade de dados que precisa carregar e pode levar a um tempo de carregamento lento.",
"items": [
{
"type": "switch",
"key": "highres",
"title": "Capas de Alta Resolução",
"subtitle": "Para página inicial e de pesquisa",
"default": true
}
]
}
]
18 changes: 18 additions & 0 deletions src/rust/madara/sources/flowermanga/res/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"info": {
"id": "pt.flowermanga",
"lang": "pt-br",
"name": "Flower Manga",
"version": 1,
"url": "https://flowermanga.com",
"nsfw": 1
},
"listings": [
{
"name": "Tendencias"
},
{
"name": "Popular"
}
]
}
46 changes: 46 additions & 0 deletions src/rust/madara/sources/flowermanga/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#![no_std]
use aidoku::{
error::Result, prelude::*, std::String, std::Vec, Chapter, DeepLink, Filter, Listing, Manga,
MangaPageResult, Page,
};

use madara_template::template;

fn get_data() -> template::MadaraSiteData {
template::MadaraSiteData {
base_url: String::from("https://flowermanga.com"),
description_selector: String::from("div.description-summary div p"),
alt_ajax: true,
..Default::default()
}
}

#[get_manga_list]
fn get_manga_list(filters: Vec<Filter>, page: i32) -> Result<MangaPageResult> {
template::get_manga_list(filters, page, get_data())
}

#[get_manga_listing]
fn get_manga_listing(listing: Listing, page: i32) -> Result<MangaPageResult> {
template::get_manga_listing(get_data(), listing, page)
}

#[get_manga_details]
fn get_manga_details(id: String) -> Result<Manga> {
template::get_manga_details(id, get_data())
}

#[get_chapter_list]
fn get_chapter_list(id: String) -> Result<Vec<Chapter>> {
template::get_chapter_list(id, get_data())
}

#[get_page_list]
fn get_page_list(_manga_id: String, chapter_id: String) -> Result<Vec<Page>> {
template::get_page_list(chapter_id, get_data())
}

#[handle_url]
pub fn handle_url(url: String) -> Result<DeepLink> {
template::handle_url(url, get_data())
}

0 comments on commit 6fef490

Please sign in to comment.