Skip to content

Commit

Permalink
fix(libgroup): determine MangaViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
vlapsk1y committed Nov 14, 2024
1 parent 3df0925 commit de706bf
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/rust/multi.libgroup/template/src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use aidoku::error::Result;
use aidoku::prelude::format;
use aidoku::prelude::{format, println};
use aidoku::std::defaults::defaults_get;
use aidoku::std::String;
use aidoku::{std::ObjectRef, Manga, MangaPageResult};
Expand Down Expand Up @@ -137,7 +137,28 @@ pub fn parse_manga_details(

let nsfw = *is_nsfw;

let viewer = MangaViewer::Rtl;
println!(
"{:?}",
detail
.get("type")
.as_object()?
.get("id")
.as_int()
.unwrap_or_default()
);

let viewer = if detail
.get("type")
.as_object()?
.get("id")
.as_int()
.unwrap_or_default()
== 5
{
MangaViewer::Scroll
} else {
MangaViewer::Rtl
};

Ok(Manga {
id,
Expand Down

0 comments on commit de706bf

Please sign in to comment.