Use a context struct
This commit is contained in:
parent
60208331ba
commit
a0d9bfa97b
10 changed files with 134 additions and 45 deletions
|
@ -1,6 +1,6 @@
|
|||
use crate::{
|
||||
context::Context,
|
||||
utils::assets::{fetch_all_assets, AssetQuery},
|
||||
Client,
|
||||
};
|
||||
use color_eyre::eyre::Result;
|
||||
use tabled::{
|
||||
|
@ -20,13 +20,13 @@ struct Asset {
|
|||
model: String,
|
||||
}
|
||||
|
||||
pub async fn list_assets(offline: bool, client: &Client) -> Result<()> {
|
||||
pub async fn list_assets(ctx: Context, offline: bool) -> Result<()> {
|
||||
let query = AssetQuery {
|
||||
is_offline: if offline { Some(true) } else { None },
|
||||
with_exif: true,
|
||||
};
|
||||
|
||||
let mut assets: Vec<_> = fetch_all_assets(query, client)
|
||||
let mut assets: Vec<_> = fetch_all_assets(query, &ctx.client)
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(|asset| Asset {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue