|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
use crate::error::ApiResult;
|
|
|
|
|
use crate::models::{
|
|
|
|
|
Anime, AnimeSynonym, Artist, Image, Resource, SearchResponse, Series, Song, Theme, ThemeEntry,
|
|
|
|
|
Video,
|
|
|
|
|
};
|
|
|
|
|
use reqwest::Response;
|
|
|
|
|
use serde::de::DeserializeOwned;
|
|
|
|
@ -117,6 +118,12 @@ impl AnimeThemesClient {
|
|
|
|
|
self.entry_by_id_with_include("theme", id, include).await
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Returns a video by basename
|
|
|
|
|
pub async fn video(&self, basename: &str, include: &[&str]) -> ApiResult<Video> {
|
|
|
|
|
self.entry_by_id_with_include("video", basename, include)
|
|
|
|
|
.await
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Generic endpoint with the format /<endpoint>/<id> returning the type on the json field <endpoint>
|
|
|
|
|
async fn entry_by_id_with_include<T: DeserializeOwned, I: Display>(
|
|
|
|
|
&self,
|
|
|
|
|