From 21764118140e0bc4a4e14e719b37259bc261126f Mon Sep 17 00:00:00 2001 From: Reilly Wood Date: Sun, 22 Sep 2024 13:52:49 -0700 Subject: [PATCH] feat: Add created_time_utc field to LibraryItem and update index.html table layout --- reitunes-rs/src/lib.rs | 2 ++ reitunes-rs/templates/index.html | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/reitunes-rs/src/lib.rs b/reitunes-rs/src/lib.rs index b21c4df..64f2789 100644 --- a/reitunes-rs/src/lib.rs +++ b/reitunes-rs/src/lib.rs @@ -233,6 +233,7 @@ impl Library { let item = LibraryItem { id: event.aggregate_id, name: name.clone(), + created_time_utc: event.created_time_utc, file_path: file_path.clone(), artist: String::new(), album: String::new(), @@ -354,6 +355,7 @@ pub enum Event { pub struct LibraryItem { pub id: Uuid, pub name: String, + pub created_time_utc: DateTime, pub file_path: String, pub artist: String, pub album: String, diff --git a/reitunes-rs/templates/index.html b/reitunes-rs/templates/index.html index 691fd82..5751fef 100644 --- a/reitunes-rs/templates/index.html +++ b/reitunes-rs/templates/index.html @@ -121,12 +121,14 @@ columns: [ { title: "Name", field: "name", editor: "input", width: "30%" }, { title: "Artist", field: "artist", editor: "input", width: "20%" }, - { title: "Album", field: "album", editor: "input", width: "20%" }, - { title: "Play Count", field: "play_count", width: "15%", sorter: "number" }, - { title: "Bookmarks", field: "bookmarks", formatter: bookmarkFormatter, width: "15%" } + { title: "Album", field: "album", editor: "input", width: "10%" }, + { title: "Play Count", field: "play_count", sorter: "number" }, + { title: "Bookmarks", field: "bookmarks", formatter: bookmarkFormatter, width: "15%" }, + { title: "Created At (UTC)", field: "created_time_utc" }, + ], initialSort: [ - { column: "play_count", dir: "desc" } + { column: "created_time_utc", dir: "desc" } ], });