diff options
-rw-r--r-- | import/src/acoustid.rs | 2 | ||||
-rw-r--r-- | import/src/musicbrainz.rs | 4 | ||||
-rw-r--r-- | import/src/tmdb.rs | 6 | ||||
-rw-r--r-- | import/src/vgmdb.rs | 6 | ||||
-rw-r--r-- | import/src/wikidata.rs | 7 | ||||
-rw-r--r-- | import/src/wikimedia_commons.rs | 3 |
6 files changed, 19 insertions, 9 deletions
diff --git a/import/src/acoustid.rs b/import/src/acoustid.rs index 6dd4dc6..19ebc3d 100644 --- a/import/src/acoustid.rs +++ b/import/src/acoustid.rs @@ -116,7 +116,7 @@ impl AcoustID { Ok(resp) }) - .await + .await.context("acoustid lookup") } } diff --git a/import/src/musicbrainz.rs b/import/src/musicbrainz.rs index f05b3de..5678024 100644 --- a/import/src/musicbrainz.rs +++ b/import/src/musicbrainz.rs @@ -5,7 +5,7 @@ */ use crate::USER_AGENT; -use anyhow::Result; +use anyhow::{Context, Result}; use bincode::{Decode, Encode}; use jellybase::cache::async_cache_memory; use log::info; @@ -259,6 +259,7 @@ impl MusicBrainz { Ok(resp) }) .await + .context("musicbrainz recording lookup") } pub async fn lookup_artist(&self, id: String) -> Result<Arc<MbArtistRel>> { @@ -303,5 +304,6 @@ impl MusicBrainz { Ok(resp) }) .await + .context("musicbrainz artist lookup") } } diff --git a/import/src/tmdb.rs b/import/src/tmdb.rs index 51748f8..45d7650 100644 --- a/import/src/tmdb.rs +++ b/import/src/tmdb.rs @@ -67,6 +67,7 @@ impl Tmdb { .await?) }) .await + .context("tmdb search") } pub async fn details(&self, kind: TmdbKind, id: u64) -> anyhow::Result<Arc<TmdbDetails>> { async_cache_memory("api-tmdb-details", (kind, id), || async move { @@ -84,6 +85,7 @@ impl Tmdb { .await?) }) .await + .context("tmdb details") } pub async fn person_image(&self, id: u64) -> anyhow::Result<Arc<TmdbPersonImage>> { async_cache_memory("api-tmdb-search", id, || async move { @@ -100,6 +102,7 @@ impl Tmdb { .await?) }) .await + .context("tmdb person images") } pub async fn image(&self, path: &str) -> anyhow::Result<CachePath> { async_cache_file("api-tmdb-image", path, |mut file| async move { @@ -116,6 +119,7 @@ impl Tmdb { Ok(()) }) .await + .context("tmdb image download") } pub async fn episode_details( @@ -135,7 +139,7 @@ impl Tmdb { .json() .await?) }) - .await + .await.context("tmdb episode details") } } diff --git a/import/src/vgmdb.rs b/import/src/vgmdb.rs index 9ac76d6..fb94f5f 100644 --- a/import/src/vgmdb.rs +++ b/import/src/vgmdb.rs @@ -5,7 +5,7 @@ */ use crate::USER_AGENT; -use anyhow::Result; +use anyhow::{Context, Result}; use jellybase::cache::{async_cache_file, async_cache_memory, CachePath}; use log::info; use regex::Regex; @@ -64,7 +64,8 @@ impl Vgmdb { } Ok(()) }) - .await?, + .await + .context("vgmdb media download")?, )) } else { Ok(None) @@ -104,5 +105,6 @@ impl Vgmdb { Ok(resp) }) .await + .context("vgmdb artist page scrape") } } diff --git a/import/src/wikidata.rs b/import/src/wikidata.rs index 267899f..48a46be 100644 --- a/import/src/wikidata.rs +++ b/import/src/wikidata.rs @@ -5,7 +5,7 @@ */ use crate::USER_AGENT; -use anyhow::{bail, Result}; +use anyhow::{bail, Context, Result}; use jellybase::cache::async_cache_memory; use log::info; use reqwest::{ @@ -113,8 +113,9 @@ impl Wikidata { Ok(resp) }) - .await?; + .await + .context("wikidata entity")?; - Ok(serde_json::from_str(&json)?) + Ok(serde_json::from_str(&json).context("parse wikidata entity")?) } } diff --git a/import/src/wikimedia_commons.rs b/import/src/wikimedia_commons.rs index e0f647e..faaef44 100644 --- a/import/src/wikimedia_commons.rs +++ b/import/src/wikimedia_commons.rs @@ -5,7 +5,7 @@ */ use crate::USER_AGENT; -use anyhow::Result; +use anyhow::{Context, Result}; use jellybase::cache::{async_cache_file, CachePath}; use reqwest::{ header::{HeaderMap, HeaderName, HeaderValue}, @@ -52,5 +52,6 @@ impl WikimediaCommons { }, ) .await + .context("mediawiki image by filename") } } |