Add a command to list albums
This commit is contained in:
parent
af1af8dce1
commit
fb78298166
5 changed files with 61 additions and 1 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue