Skip to content

Commit

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

* feat(madara): add source prismascans

* feat: remove flowermanga(duplicate PR)

* Update src/rust/madara/sources/prismascans/res/filters.json

Co-authored-by: Skitty <[email protected]>

* Update src/rust/madara/sources/prismascans/res/source.json

Co-authored-by: Skitty <[email protected]>

* Update src/rust/madara/sources/prismascans/res/source.json

Co-authored-by: Skitty <[email protected]>

* Update src/rust/madara/sources/prismascans/src/lib.rs

Co-authored-by: Skitty <[email protected]>

* Update src/rust/madara/sources/prismascans/res/Icon.png

---------

Co-authored-by: Skitty <[email protected]>
  • Loading branch information
julioreigen and Skittyblock authored Oct 4, 2023
1 parent 6fef490 commit 8cf0367
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/rust/madara/sources/prismascans/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "prismascans"
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/prismascans/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.
203 changes: 203 additions & 0 deletions src/rust/madara/sources/prismascans/res/filters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
[
{
"type": "title"
},
{
"type": "group",
"name": "Status",
"filters": [
{
"type": "check",
"name": "Ongoing"
},
{
"type": "check",
"name": "Completed"
}
]
},
{
"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": "Ação",
"id": "acao"
},
{
"type": "genre",
"name": "Artes Marciais",
"id": "artes-marciais"
},
{
"type": "genre",
"name": "Aventura",
"id": "aventura"
},
{
"type": "genre",
"name": "Banner",
"id": "banner"
},
{
"type": "genre",
"name": "Comédia",
"id": "comedia"
},
{
"type": "genre",
"name": "Cultivo",
"id": "cultivo"
},
{
"type": "genre",
"name": "Drama",
"id": "drama"
},
{
"type": "genre",
"name": "Dungeons",
"id": "dungeons"
},
{
"type": "genre",
"name": "Ecchi",
"id": "ecchi"
},
{
"type": "genre",
"name": "Fantasia",
"id": "fantasia"
},
{
"type": "genre",
"name": "Harém",
"id": "harem"
},
{
"type": "genre",
"name": "Histórico",
"id": "historico"
},
{
"type": "genre",
"name": "Horror",
"id": "horror"
},
{
"type": "genre",
"name": "Isekai",
"id": "isekai"
},
{
"type": "genre",
"name": "Jogos",
"id": "jogos"
},
{
"type": "genre",
"name": "Josei",
"id": "josei"
},
{
"type": "genre",
"name": "Magia",
"id": "magia"
},
{
"type": "genre",
"name": "Manhwa",
"id": "manhwa"
},
{
"type": "genre",
"name": "Mistério",
"id": "misterio"
},
{
"type": "genre",
"name": "Murim",
"id": "murim"
},
{
"type": "genre",
"name": "Música",
"id": "musica"
},
{
"type": "genre",
"name": "Necromancer",
"id": "necromancer"
},
{
"type": "genre",
"name": "Overpower",
"id": "overpower"
},
{
"type": "genre",
"name": "Psicológico",
"id": "psicologico"
},
{
"type": "genre",
"name": "Reencarnação",
"id": "reencarnacao"
},
{
"type": "genre",
"name": "Regressão",
"id": "regressao"
},
{
"type": "genre",
"name": "Romance",
"id": "romance"
},
{
"type": "genre",
"name": "Sci-fi",
"id": "sci-fi"
},
{
"type": "genre",
"name": "Shoujo",
"id": "shoujo"
},
{
"type": "genre",
"name": "Shounen",
"id": "shounen"
},
{
"type": "genre",
"name": "Sistema",
"id": "sistema"
},
{
"type": "genre",
"name": "Sobrenatural",
"id": "sobrenatural"
},
{
"type": "genre",
"name": "Vida escolar",
"id": "vida-escolar"
},
{
"type": "genre",
"name": "Vingança",
"id": "vinganca"
}
]
}
]
16 changes: 16 additions & 0 deletions src/rust/madara/sources/prismascans/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
}
]
}
]
10 changes: 10 additions & 0 deletions src/rust/madara/sources/prismascans/res/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"info": {
"id": "pt-br.prismascans",
"lang": "pt-br",
"name": "Prisma Scans",
"version": 1,
"url": "https://prismascans.net",
"nsfw": 2
}
}
46 changes: 46 additions & 0 deletions src/rust/madara/sources/prismascans/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://prismascans.net"),
description_selector: String::from("div.summary_content_wrap 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 8cf0367

Please sign in to comment.