Add an option to delete only empty albums
This commit is contained in:
parent
0ac02c34c6
commit
776c9b005f
3 changed files with 10 additions and 4 deletions
|
@ -10,8 +10,10 @@ use crate::{
|
|||
use color_eyre::eyre::Result;
|
||||
use log::info;
|
||||
|
||||
pub async fn delete_albums(ctx: Context) -> Result<()> {
|
||||
let albums = FetchAllAlbums::new(()).execute(&ctx).await?;
|
||||
pub async fn delete_albums(ctx: Context, empty: bool) -> Result<()> {
|
||||
let mut albums = FetchAllAlbums::new(()).execute(&ctx).await?;
|
||||
|
||||
albums.retain(|album| !empty || album.assets_count == 0);
|
||||
|
||||
if let ConfirmResult::Positive = Confirm::new(None).execute(&ctx).await? {
|
||||
for album in &albums {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue