Compare commits
1 commit
41db15ffe8
...
ea9472a03d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea9472a03d |
6 changed files with 9 additions and 64 deletions
18
Cargo.lock
generated
18
Cargo.lock
generated
|
|
@ -484,9 +484,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.45"
|
version = "4.5.43"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318"
|
checksum = "50fd97c9dc2399518aa331917ac6f274280ec5eb34e555dd291899745c48ec6f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
|
|
@ -504,9 +504,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.44"
|
version = "4.5.43"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8"
|
checksum = "c35b5830294e1fa0462034af85cc95225a4cb07092c088c55bda3147cfcd8f65"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
|
|
@ -516,9 +516,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "4.5.45"
|
version = "4.5.41"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6"
|
checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
@ -1256,7 +1256,7 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"socket2 0.5.10",
|
"socket2 0.6.0",
|
||||||
"system-configuration",
|
"system-configuration",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
|
|
@ -2214,9 +2214,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reqwest"
|
name = "reqwest"
|
||||||
version = "0.12.23"
|
version = "0.12.22"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
|
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ video backup solution. This tool provides various utilities to manage your Immic
|
||||||
- **List** all albums on your Immich server
|
- **List** all albums on your Immich server
|
||||||
- **Delete** albums (all or empty ones only)
|
- **Delete** albums (all or empty ones only)
|
||||||
- **Auto-create** albums from external libraries folder structure
|
- **Auto-create** albums from external libraries folder structure
|
||||||
- **List assets of an album** by album name
|
|
||||||
|
|
||||||
### Assets
|
### Assets
|
||||||
- **List** assets (all or offline only)
|
- **List** assets (all or offline only)
|
||||||
|
|
@ -106,11 +105,6 @@ Auto-create albums from folder structure:
|
||||||
immich-tools albums auto-create --album-name-separator "/"
|
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
|
### Assets
|
||||||
|
|
||||||
List all assets:
|
List all assets:
|
||||||
|
|
|
||||||
|
|
@ -95,13 +95,6 @@ pub(crate) enum AlbumsCommands {
|
||||||
/// List all albums
|
/// List all albums
|
||||||
#[serde(rename = "list")]
|
#[serde(rename = "list")]
|
||||||
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)]
|
#[derive(Serialize, Subcommand)]
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
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(())
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
pub mod auto_create_albums;
|
pub mod auto_create_albums;
|
||||||
pub mod delete_albums;
|
pub mod delete_albums;
|
||||||
pub mod delete_assets;
|
pub mod delete_assets;
|
||||||
pub mod list_album_assets;
|
|
||||||
pub mod list_albums;
|
pub mod list_albums;
|
||||||
pub mod list_assets;
|
pub mod list_assets;
|
||||||
pub mod list_libraries;
|
pub mod list_libraries;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#![allow(renamed_and_removed_lints)] // https://github.com/oxidecomputer/progenitor/issues/1169
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/client.rs"));
|
include!(concat!(env!("OUT_DIR"), "/client.rs"));
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
@ -17,7 +16,6 @@ use color_eyre::Section;
|
||||||
use commands::auto_create_albums::auto_create_albums;
|
use commands::auto_create_albums::auto_create_albums;
|
||||||
use commands::delete_albums::delete_albums;
|
use commands::delete_albums::delete_albums;
|
||||||
use commands::delete_assets::delete_assets;
|
use commands::delete_assets::delete_assets;
|
||||||
use commands::list_album_assets::list_album_assets;
|
|
||||||
use commands::list_albums::list_albums;
|
use commands::list_albums::list_albums;
|
||||||
use commands::list_assets::list_assets;
|
use commands::list_assets::list_assets;
|
||||||
use commands::list_libraries::list_libraries;
|
use commands::list_libraries::list_libraries;
|
||||||
|
|
@ -88,7 +86,6 @@ async fn main() -> Result<()> {
|
||||||
} => auto_create_albums(ctx, album_name_separator.to_string()).await,
|
} => auto_create_albums(ctx, album_name_separator.to_string()).await,
|
||||||
AlbumsCommands::Delete { empty } => delete_albums(ctx, *empty).await,
|
AlbumsCommands::Delete { empty } => delete_albums(ctx, *empty).await,
|
||||||
AlbumsCommands::List {} => list_albums(ctx).await,
|
AlbumsCommands::List {} => list_albums(ctx).await,
|
||||||
AlbumsCommands::ListAssets { album } => list_album_assets(ctx, album).await,
|
|
||||||
},
|
},
|
||||||
Commands::Assets { assets_command } => match assets_command {
|
Commands::Assets { assets_command } => match assets_command {
|
||||||
AssetsCommands::Delete { offline } => delete_assets(ctx, *offline).await,
|
AssetsCommands::Delete { offline } => delete_assets(ctx, *offline).await,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue