Skip to content

Commit

Permalink
Add new source: PhenixScans (#457)
Browse files Browse the repository at this point in the history
* Update Icon.png for Towerofelectrica source

* Add PhenixScans source

* Add new line in Cargo.toml

* Add new line in filters.json

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

* Add new line in lib.rs

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

* Revert "Update Icon.png for Towerofelectrica source"

This reverts commit 77ce593.

---------

Co-authored-by: Skitty <[email protected]>
  • Loading branch information
MozkaGit and Skittyblock authored Sep 10, 2023
1 parent 78ea988 commit 4065457
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/rust/mangastream/sources/phenixscans/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "wasm32-unknown-unknown"
12 changes: 12 additions & 0 deletions src/rust/mangastream/sources/phenixscans/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "phenixscans"
version = "0.1.0"
edition = "2021"
publish = false

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

[dependencies]
aidoku = { git = "https://github.com/Aidoku/aidoku-rs/" }
mangastream_template = { path = "../../template" }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/rust/mangastream/sources/phenixscans/res/filters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"type": "title"
},
{
"type": "select",
"name": "Status",
"options": [
"All",
"En Cours",
"Terminé",
"Abandonné"
]
},
{
"type": "select",
"name": "Type",
"options": [
"All",
"Manga",
"Manhwa",
"Manhua",
"Comic"
]
}
]
20 changes: 20 additions & 0 deletions src/rust/mangastream/sources/phenixscans/res/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"info": {
"id": "fr.phenixscans",
"lang": "fr",
"name": "Phenix Scans",
"version": 1,
"url": "https://phenixscans.fr/"
},
"listings": [
{
"name": "Populaire"
},
{
"name": "Dernières"
},
{
"name": "Nouveau"
}
]
}
55 changes: 55 additions & 0 deletions src/rust/mangastream/sources/phenixscans/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#![no_std]
use aidoku::{
error::Result, prelude::*, std::net::Request, std::String, std::Vec, Chapter, DeepLink, Filter,
Listing, Manga, MangaPageResult, Page,
};

use mangastream_template::template::MangaStreamSource;

fn get_instance() -> MangaStreamSource {
MangaStreamSource {
use_manga_postids: true,
use_chapter_postids: true,
base_url: String::from("https://phenixscans.fr/"),
listing: ["Dernières", "Populaire", "Nouveau"],
manga_details_author: ".imptdt:contains(Auteur) i, .fmed b:contains(Auteur)+span",
traverse_pathname: "manga",
alt_pages: true,
..Default::default()
}
}

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

#[get_manga_listing]
fn get_manga_listing(listing: Listing, page: i32) -> Result<MangaPageResult> {
get_instance().parse_manga_listing(get_instance().base_url, listing.name, page)
}

#[get_manga_details]
fn get_manga_details(id: String) -> Result<Manga> {
get_instance().parse_manga_details(id)
}

#[get_chapter_list]
fn get_chapter_list(id: String) -> Result<Vec<Chapter>> {
get_instance().parse_chapter_list(id)
}

#[get_page_list]
fn get_page_list(_manga_id: String, id: String) -> Result<Vec<Page>> {
get_instance().parse_page_list(id)
}

#[modify_image_request]
fn modify_image_request(request: Request) {
get_instance().modify_image_request(request)
}

#[handle_url]
pub fn handle_url(url: String) -> Result<DeepLink> {
get_instance().handle_url(url)
}

0 comments on commit 4065457

Please sign in to comment.