-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(anilist): add test anilist update manga progress
- Loading branch information
1 parent
310476b
commit 9ca7a4e
Showing
3 changed files
with
399 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use futures::Future; | ||
use manga_tui::SearchTerm; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
pub mod anilist; | ||
|
||
#[derive(Debug, Deserialize, Serialize, Default, PartialEq, Eq)] | ||
pub struct MangaToTrack { | ||
pub id: String, | ||
} | ||
|
||
#[derive(Debug, Default, PartialEq, Eq)] | ||
pub struct MarkAsRead<'a> { | ||
pub id: &'a str, | ||
pub chapter_number: u32, | ||
pub volume_number: Option<u32>, | ||
} | ||
|
||
pub trait MangaTracker { | ||
fn search_manga_by_title( | ||
&self, | ||
title: SearchTerm, | ||
) -> impl Future<Output = Result<Option<MangaToTrack>, Box<dyn std::error::Error>>> + Send; | ||
|
||
/// Implementors may require api key / account token in order to perform this operation | ||
fn mark_manga_as_read_with_chapter_count( | ||
&self, | ||
manga: MarkAsRead<'_>, | ||
) -> impl Future<Output = Result<(), Box<dyn std::error::Error>>> + Send; | ||
} |
Oops, something went wrong.