We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1d4312c + 995b393 commit c50ba75Copy full SHA for c50ba75
src/trakt.rs
@@ -120,13 +120,17 @@ impl Trakt {
120
MediaType::Show => format!("https://api.themoviedb.org/3/tv/{tmdb_id}/season/{season_id}/images?api_key={tmdb_token}")
121
};
122
123
- let response = self
124
- .agent
125
- .get(&endpoint)
126
- .call()
127
- .expect("TMDB API call failed");
+ let response = self.agent.get(&endpoint).call();
+
+ if response.is_err() {
+ log(&format!(
+ "{} image not correctly found",
128
+ media_type.as_str()
129
+ ));
130
+ return None;
131
+ }
132
- match response.into_json::<serde_json::Value>() {
133
+ match response.unwrap().into_json::<serde_json::Value>() {
134
Ok(body) => {
135
if body["posters"].as_array().unwrap_or(&vec![]).is_empty() {
136
log("Show image not correctly found");
0 commit comments