diff options
Diffstat (limited to 'import')
-rw-r--r-- | import/src/lib.rs | 12 | ||||
-rw-r--r-- | import/src/tmdb.rs | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index 7b19a61..8cc9ddd 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -156,17 +156,17 @@ fn import_traverse( let mtime = meta.modified()?.duration_since(UNIX_EPOCH)?.as_secs(); if incremental { - if let Some(last_mtime) = db.get_import_file_mtime(&path)? { + if let Some(last_mtime) = db.get_import_file_mtime(path)? { if last_mtime >= mtime { return Ok(()); } } } - import_file(&db, apis, rthandle, &path, parent, visibility).context(anyhow!("{path:?}"))?; - db.set_import_file_mtime(&path, mtime)?; + import_file(db, apis, rthandle, path, parent, visibility).context(anyhow!("{path:?}"))?; + db.set_import_file_mtime(path, mtime)?; } - return Ok(()); + Ok(()) } fn import_file( @@ -333,7 +333,7 @@ fn import_media_file( ) ) } else { - make_kebab(&filepath_stem) + make_kebab(filepath_stem) } }); @@ -497,7 +497,7 @@ fn import_media_file( rthandle.block_on(tmdb.episode_details(tmdb_id, season, episode))?; if let Some(still) = &tmdb_details.still_path { poster = Some( - AssetInner::Cache(rthandle.block_on(tmdb.image(&still))?).ser(), + AssetInner::Cache(rthandle.block_on(tmdb.image(still))?).ser(), ) } } diff --git a/import/src/tmdb.rs b/import/src/tmdb.rs index 70e95ce..1e7849f 100644 --- a/import/src/tmdb.rs +++ b/import/src/tmdb.rs @@ -50,7 +50,7 @@ impl Tmdb { info!("searching tmdb: {query:?}"); Ok(self .client - .get(&format!( + .get(format!( "https://api.themoviedb.org/3/search/{kind}?query={}?api_key={}", query.replace(" ", "+"), self.key @@ -71,7 +71,7 @@ impl Tmdb { info!("fetching details: {id:?}"); Ok(self .client - .get(&format!( + .get(format!( "https://api.themoviedb.org/3/{kind}/{id}?api_key={}", self.key, )) @@ -88,7 +88,7 @@ impl Tmdb { async_cache_memory(&["api-tmdb-search", &format!("{id}")], || async move { Ok(self .client - .get(&format!( + .get(format!( "https://api.themoviedb.org/3/person/{id}/images?api_key={}", self.key, )) @@ -105,7 +105,7 @@ impl Tmdb { info!("downloading image {path:?}"); let mut res = self .image_client - .get(&format!("https://image.tmdb.org/t/p/original{path}")) + .get(format!("https://image.tmdb.org/t/p/original{path}")) .send() .await? .error_for_status()?; @@ -127,7 +127,7 @@ impl Tmdb { info!("tmdb episode details {series_id} S={season} E={episode}"); Ok(self .image_client - .get(&format!("https://api.themoviedb.org/3/tv/{series_id}/season/{season}/episode/{episode}?api_key={}", self.key)) + .get(format!("https://api.themoviedb.org/3/tv/{series_id}/season/{season}/episode/{episode}?api_key={}", self.key)) .send() .await? .error_for_status()? |