Add a command to list albums

This commit is contained in:
Marc Plano-Lesay 2024-11-24 01:32:17 +01:00
parent af1af8dce1
commit fb78298166
Signed by: kernald
GPG key ID: 66A41B08CC62A6CF
5 changed files with 61 additions and 1 deletions

View file

@ -1,3 +1,4 @@
use chrono::{DateTime, NaiveDate, Utc};
use uuid::Uuid;
use crate::types::AlbumResponseDto;
@ -6,6 +7,8 @@ use crate::types::AlbumResponseDto;
pub struct Album {
pub id: Uuid,
pub name: String,
pub updated_at: DateTime<Utc>,
pub assets_count: u32,
}
impl From<AlbumResponseDto> for Album {
@ -13,6 +16,8 @@ impl From<AlbumResponseDto> for Album {
Self {
id: Uuid::parse_str(&value.id).expect("Unable to parse an album's UUID"),
name: value.album_name,
updated_at: value.updated_at,
assets_count: value.asset_count as u32,
}
}
}