Compare commits

..

4 commits

Author SHA1 Message Date
Renovate
775d3ac3d2 fix(deps): update rust crate clap to v4.5.45
All checks were successful
Build and test / Tests (pull_request) Successful in 1m33s
Checking Renovate configuration / validate (pull_request) Successful in 1m38s
Build and test / Generate Documentation (pull_request) Successful in 57s
Build and test / Clippy (pull_request) Successful in 1m32s
Checking yaml / Run yamllint (pull_request) Successful in 4s
Build and test / Build AMD64 (pull_request) Successful in 6m57s
2025-08-13 15:21:19 +10:00
Renovate
aa18fc3525 fix(deps): update rust crate reqwest to v0.12.23
All checks were successful
Build and test / Tests (pull_request) Successful in 1m52s
Checking Renovate configuration / validate (pull_request) Successful in 1m48s
Checking yaml / Run yamllint (pull_request) Successful in 4s
Build and test / Build AMD64 (pull_request) Successful in 1m54s
Build and test / Clippy (pull_request) Successful in 1m55s
Build and test / Generate Documentation (pull_request) Successful in 58s
2025-08-13 15:06:10 +10:00
9ad599a2b4
feat: list assets per album
All checks were successful
Build and test / Build AMD64 (pull_request) Successful in 1m16s
Build and test / Tests (pull_request) Successful in 1m25s
Checking Renovate configuration / validate (pull_request) Successful in 1m55s
Checking yaml / Run yamllint (pull_request) Successful in 36s
Build and test / Clippy (pull_request) Successful in 31s
Build and test / Generate Documentation (pull_request) Successful in 55s
2025-08-13 14:47:33 +10:00
07907b2ce2
chore: allow renamed_and_removed_lints until progenitor is updated
All checks were successful
Checking yaml / Run yamllint (pull_request) Successful in 6s
Build and test / Build AMD64 (pull_request) Successful in 1m23s
Build and test / Tests (pull_request) Successful in 1m29s
Build and test / Generate Documentation (pull_request) Successful in 1m13s
Checking Renovate configuration / validate (pull_request) Successful in 1m58s
Build and test / Clippy (pull_request) Successful in 4m25s
2025-08-13 14:41:10 +10:00
6 changed files with 58 additions and 3 deletions

6
Cargo.lock generated
View file

@ -1256,7 +1256,7 @@ dependencies = [
"libc",
"percent-encoding",
"pin-project-lite",
"socket2 0.6.0",
"socket2 0.5.10",
"system-configuration",
"tokio",
"tower-service",
@ -2214,9 +2214,9 @@ dependencies = [
[[package]]
name = "reqwest"
version = "0.12.22"
version = "0.12.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
dependencies = [
"base64 0.22.1",
"bytes",

View file

@ -12,6 +12,7 @@ video backup solution. This tool provides various utilities to manage your Immic
- **List** all albums on your Immich server
- **Delete** albums (all or empty ones only)
- **Auto-create** albums from external libraries folder structure
- **List assets of an album** by album name
### Assets
- **List** assets (all or offline only)
@ -105,6 +106,11 @@ Auto-create albums from folder structure:
immich-tools albums auto-create --album-name-separator "/"
```
List assets belonging to a specific album (by album name):
```bash
immich-tools albums list-assets --album "My Album"
```
### Assets
List all assets:

View file

@ -95,6 +95,13 @@ pub(crate) enum AlbumsCommands {
/// List all albums
#[serde(rename = "list")]
List {},
/// List all assets that belong to a specific album
#[serde(rename = "list-assets")]
ListAssets {
/// Name of the album to list assets for
#[arg(long)]
album: String,
},
}
#[derive(Serialize, Subcommand)]

View file

@ -0,0 +1,38 @@
use crate::{
actions::{
action::Action, fetch_album_assets::FetchAlbumAssets, fetch_all_albums::FetchAllAlbums,
},
context::Context,
};
use color_eyre::eyre::{eyre, Result};
use tabled::{settings::Style, Table, Tabled};
#[derive(Tabled)]
struct AssetRow {
#[tabled(rename = "Path")]
original_file_path: String,
}
pub async fn list_album_assets(ctx: Context, album_name: &str) -> Result<()> {
let albums = FetchAllAlbums::new(()).execute(&ctx).await?;
let album = albums
.into_iter()
.find(|a| a.name == album_name)
.ok_or_else(|| eyre!("Album not found: {}", album_name))?;
let mut assets: Vec<_> = FetchAlbumAssets::new(album)
.execute(&ctx)
.await?
.into_iter()
.map(|asset| AssetRow {
original_file_path: asset.original_path.to_string_lossy().to_string(),
})
.collect();
assets.sort_by_key(|row| row.original_file_path.clone());
println!("{}", Table::new(assets).with(Style::rounded()));
Ok(())
}

View file

@ -1,6 +1,7 @@
pub mod auto_create_albums;
pub mod delete_albums;
pub mod delete_assets;
pub mod list_album_assets;
pub mod list_albums;
pub mod list_assets;
pub mod list_libraries;

View file

@ -1,3 +1,4 @@
#![allow(renamed_and_removed_lints)] // https://github.com/oxidecomputer/progenitor/issues/1169
include!(concat!(env!("OUT_DIR"), "/client.rs"));
#[cfg(test)]
@ -16,6 +17,7 @@ use color_eyre::Section;
use commands::auto_create_albums::auto_create_albums;
use commands::delete_albums::delete_albums;
use commands::delete_assets::delete_assets;
use commands::list_album_assets::list_album_assets;
use commands::list_albums::list_albums;
use commands::list_assets::list_assets;
use commands::list_libraries::list_libraries;
@ -86,6 +88,7 @@ async fn main() -> Result<()> {
} => auto_create_albums(ctx, album_name_separator.to_string()).await,
AlbumsCommands::Delete { empty } => delete_albums(ctx, *empty).await,
AlbumsCommands::List {} => list_albums(ctx).await,
AlbumsCommands::ListAssets { album } => list_album_assets(ctx, album).await,
},
Commands::Assets { assets_command } => match assets_command {
AssetsCommands::Delete { offline } => delete_assets(ctx, *offline).await,