From 34d5d35953c6bf3e6e183175bfc79b6b217a926d Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 3 Jul 2022 18:08:08 +0200 Subject: [PATCH] Fix synopsis being optional Signed-off-by: trivernis --- Cargo.lock | 2 +- src/models.rs | 3 ++- src/tests/test_client.rs | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77cee2a..4779755 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "animethemes-rs" -version = "0.4.2" +version = "0.4.3" dependencies = [ "reqwest", "serde", diff --git a/src/models.rs b/src/models.rs index cfe4fa7..f0c9908 100644 --- a/src/models.rs +++ b/src/models.rs @@ -16,7 +16,7 @@ pub struct Anime { pub slug: String, pub year: u16, pub season: AnimeSeason, - pub synopsis: String, + pub synopsis: Option, #[serde(alias = "animesynonyms")] pub synonyms: Option>, #[serde(alias = "animethemes")] @@ -120,6 +120,7 @@ pub struct Video { pub link: String, #[serde(alias = "animethemeentries")] pub entries: Option>, + pub tags: Option, } #[derive(Debug, Clone, Deserialize)] diff --git a/src/tests/test_client.rs b/src/tests/test_client.rs index c206126..03874fc 100644 --- a/src/tests/test_client.rs +++ b/src/tests/test_client.rs @@ -6,10 +6,13 @@ async fn it_searches() { let client = AnimeThemesClient::default(); let result = client .search( - "paripi", + "re:zero", &[], SearchIncludes { - anime: AnimeInclude::default().images().series(), + anime: AnimeInclude::default() + .themes() + .themes_entries() + .themes_entries_videos(), ..Default::default() }, )