feat(P1+P2): server-authoritative favorites/recent + pre-computed display fields
P1-A: Enrich FavoriteItemDto & RecentItemDto with item_name, item_size,
item_mime_type, parent_id, modified_at via SQL LEFT JOINs — eliminates
N+1 per-item fetches.
P1-B: Rewrite favorites.js as server-authoritative (724→380 lines).
In-memory cache backed by GET /api/favorites; no localStorage.
P1-C: Rewrite recent.js as server-authoritative (341→249 lines).
GET /api/recent + POST /api/recent/{type}/{id}; no localStorage.
P1 cleanup: Remove dead localStorage cleanup from auth.js logout,
fix async clearRecentFiles in app.js.
P2: Add icon_class, icon_special_class, category, size_formatted to
FileDto, FolderDto, FavoriteItemDto, RecentItemDto. New shared
display_helpers.rs module centralises mime→icon/category/size logic.
Frontend (ui.js, fileRenderer.js, favorites.js, recent.js) now reads
pre-computed fields from the API with fallback defaults — eliminates
5 duplicated mime→icon mapping blocks (~89 lines removed).
Also fixes: synthetic FolderDto in webdav_handler.rs, pre-existing
missing item_name field in share_service.rs test.
Net: -307 lines across 15 files. cargo check: 0 errors, 0 warnings.
cargo test display_helpers: 3/3 pass.
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
/// Shared display helpers for DTOs.
|
||||
///
|
||||
/// These functions centralise the mime→icon / mime→category / size→human-string
|
||||
/// logic so that every API response carries pre-computed display fields and the
|
||||
/// frontend does **not** need to duplicate these mappings.
|
||||
|
||||
/// Returns the FontAwesome icon class for a given MIME type.
|
||||
///
|
||||
/// Examples: `"fas fa-file-image"`, `"fas fa-file-pdf"`, `"fas fa-file"` (default).
|
||||
pub fn mime_to_icon_class(mime: &str) -> &'static str {
|
||||
if mime.starts_with("image/") {
|
||||
"fas fa-file-image"
|
||||
} else if mime.starts_with("text/") {
|
||||
"fas fa-file-alt"
|
||||
} else if mime.starts_with("video/") {
|
||||
"fas fa-file-video"
|
||||
} else if mime.starts_with("audio/") {
|
||||
"fas fa-file-audio"
|
||||
} else if mime == "application/pdf" {
|
||||
"fas fa-file-pdf"
|
||||
} else {
|
||||
"fas fa-file"
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the CSS class used to colour/style the icon container.
|
||||
///
|
||||
/// Examples: `"image-icon"`, `"pdf-icon"`, `""` (default).
|
||||
pub fn mime_to_icon_special_class(mime: &str) -> &'static str {
|
||||
if mime.starts_with("image/") {
|
||||
"image-icon"
|
||||
} else if mime.starts_with("text/") {
|
||||
"text-icon"
|
||||
} else if mime.starts_with("video/") {
|
||||
"video-icon"
|
||||
} else if mime.starts_with("audio/") {
|
||||
"audio-icon"
|
||||
} else if mime == "application/pdf" {
|
||||
"pdf-icon"
|
||||
} else {
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a human-readable category label for a MIME type.
|
||||
///
|
||||
/// Examples: `"Image"`, `"Text"`, `"Document"` (default).
|
||||
pub fn mime_to_category(mime: &str) -> &'static str {
|
||||
if mime.starts_with("image/") {
|
||||
"Image"
|
||||
} else if mime.starts_with("text/") {
|
||||
"Text"
|
||||
} else if mime.starts_with("video/") {
|
||||
"Video"
|
||||
} else if mime.starts_with("audio/") {
|
||||
"Audio"
|
||||
} else if mime == "application/pdf" {
|
||||
"PDF"
|
||||
} else {
|
||||
"Document"
|
||||
}
|
||||
}
|
||||
|
||||
/// Formats a byte count into a human-readable string (1024-based).
|
||||
///
|
||||
/// Matches the JavaScript `formatFileSize()` output exactly so the frontend
|
||||
/// does not need its own per-file formatting.
|
||||
///
|
||||
/// Examples: `"0 Bytes"`, `"1.5 KB"`, `"3.27 MB"`.
|
||||
pub fn format_file_size(bytes: u64) -> String {
|
||||
if bytes == 0 {
|
||||
return "0 Bytes".to_string();
|
||||
}
|
||||
|
||||
const K: f64 = 1024.0;
|
||||
const SIZES: [&str; 5] = ["Bytes", "KB", "MB", "GB", "TB"];
|
||||
|
||||
let i = ((bytes as f64).ln() / K.ln()).floor() as usize;
|
||||
let i = i.min(SIZES.len() - 1);
|
||||
|
||||
let value = bytes as f64 / K.powi(i as i32);
|
||||
|
||||
// Two decimal places, then strip trailing zeros (matches JS parseFloat behaviour)
|
||||
let formatted = format!("{:.2}", value);
|
||||
let formatted = formatted
|
||||
.trim_end_matches('0')
|
||||
.trim_end_matches('.');
|
||||
|
||||
format!("{} {}", formatted, SIZES[i])
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_format_file_size() {
|
||||
assert_eq!(format_file_size(0), "0 Bytes");
|
||||
assert_eq!(format_file_size(500), "500 Bytes");
|
||||
assert_eq!(format_file_size(1024), "1 KB");
|
||||
assert_eq!(format_file_size(1536), "1.5 KB");
|
||||
assert_eq!(format_file_size(1_048_576), "1 MB");
|
||||
assert_eq!(format_file_size(3_423_744), "3.27 MB");
|
||||
assert_eq!(format_file_size(1_073_741_824), "1 GB");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mime_to_icon_class() {
|
||||
assert_eq!(mime_to_icon_class("image/png"), "fas fa-file-image");
|
||||
assert_eq!(mime_to_icon_class("text/plain"), "fas fa-file-alt");
|
||||
assert_eq!(mime_to_icon_class("video/mp4"), "fas fa-file-video");
|
||||
assert_eq!(mime_to_icon_class("audio/mpeg"), "fas fa-file-audio");
|
||||
assert_eq!(mime_to_icon_class("application/pdf"), "fas fa-file-pdf");
|
||||
assert_eq!(mime_to_icon_class("application/octet-stream"), "fas fa-file");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mime_to_category() {
|
||||
assert_eq!(mime_to_category("image/jpeg"), "Image");
|
||||
assert_eq!(mime_to_category("text/html"), "Text");
|
||||
assert_eq!(mime_to_category("video/webm"), "Video");
|
||||
assert_eq!(mime_to_category("audio/ogg"), "Audio");
|
||||
assert_eq!(mime_to_category("application/pdf"), "PDF");
|
||||
assert_eq!(mime_to_category("application/zip"), "Document");
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// DTO for favorites item
|
||||
use super::display_helpers::{format_file_size, mime_to_category, mime_to_icon_class, mime_to_icon_special_class};
|
||||
|
||||
/// DTO for favorites item, enriched with item metadata via SQL JOIN
|
||||
/// so the frontend does not need N+1 requests to resolve names/sizes.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FavoriteItemDto {
|
||||
/// Unique identifier for the favorite entry
|
||||
@@ -18,4 +21,60 @@ pub struct FavoriteItemDto {
|
||||
|
||||
/// When the item was added to favorites
|
||||
pub created_at: DateTime<Utc>,
|
||||
|
||||
// ── Enriched metadata (resolved via JOIN) ──
|
||||
|
||||
/// Display name of the file or folder
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub item_name: Option<String>,
|
||||
|
||||
/// Size in bytes (files only; folders → None)
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub item_size: Option<i64>,
|
||||
|
||||
/// MIME type (files only)
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub item_mime_type: Option<String>,
|
||||
|
||||
/// Parent folder ID (folder_id for files, parent_id for folders)
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub parent_id: Option<String>,
|
||||
|
||||
/// Last modification timestamp of the item
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub modified_at: Option<DateTime<Utc>>,
|
||||
|
||||
// ── Pre-computed display fields ──
|
||||
|
||||
/// FontAwesome icon CSS class (e.g. "fas fa-file-image", "fas fa-folder")
|
||||
pub icon_class: String,
|
||||
|
||||
/// Extra CSS class for icon styling (e.g. "image-icon", "folder-icon")
|
||||
pub icon_special_class: String,
|
||||
|
||||
/// Human-readable category (e.g. "Image", "Folder")
|
||||
pub category: String,
|
||||
|
||||
/// Formatted file size (e.g. "3.27 MB"); "--" for folders
|
||||
pub size_formatted: String,
|
||||
}
|
||||
|
||||
impl FavoriteItemDto {
|
||||
/// Populate display fields from the enriched metadata.
|
||||
/// Call this after constructing from the SQL row.
|
||||
pub fn with_display_fields(mut self) -> Self {
|
||||
if self.item_type == "folder" {
|
||||
self.icon_class = "fas fa-folder".to_string();
|
||||
self.icon_special_class = "folder-icon".to_string();
|
||||
self.category = "Folder".to_string();
|
||||
self.size_formatted = "--".to_string();
|
||||
} else {
|
||||
let mime = self.item_mime_type.as_deref().unwrap_or("application/octet-stream");
|
||||
self.icon_class = mime_to_icon_class(mime).to_string();
|
||||
self.icon_special_class = mime_to_icon_special_class(mime).to_string();
|
||||
self.category = mime_to_category(mime).to_string();
|
||||
self.size_formatted = format_file_size(self.item_size.unwrap_or(0) as u64);
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use crate::domain::entities::file::File;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::display_helpers::{format_file_size, mime_to_category, mime_to_icon_class, mime_to_icon_special_class};
|
||||
|
||||
/// DTO for file responses
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct FileDto {
|
||||
@@ -27,19 +29,40 @@ pub struct FileDto {
|
||||
|
||||
/// Last modification timestamp
|
||||
pub modified_at: u64,
|
||||
|
||||
// ── Pre-computed display fields ──
|
||||
|
||||
/// FontAwesome icon CSS class (e.g. "fas fa-file-image")
|
||||
pub icon_class: String,
|
||||
|
||||
/// Extra CSS class for icon styling (e.g. "image-icon", "" when default)
|
||||
pub icon_special_class: String,
|
||||
|
||||
/// Human-readable file category (e.g. "Image", "Document")
|
||||
pub category: String,
|
||||
|
||||
/// Human-readable formatted size (e.g. "3.27 MB")
|
||||
pub size_formatted: String,
|
||||
}
|
||||
|
||||
impl From<File> for FileDto {
|
||||
fn from(file: File) -> Self {
|
||||
let mime = file.mime_type();
|
||||
let size = file.size();
|
||||
|
||||
Self {
|
||||
id: file.id().to_string(),
|
||||
name: file.name().to_string(),
|
||||
path: file.path_string().to_string(),
|
||||
size: file.size(),
|
||||
mime_type: file.mime_type().to_string(),
|
||||
size,
|
||||
mime_type: mime.to_string(),
|
||||
folder_id: file.folder_id().map(String::from),
|
||||
created_at: file.created_at(),
|
||||
modified_at: file.modified_at(),
|
||||
icon_class: mime_to_icon_class(mime).to_string(),
|
||||
icon_special_class: mime_to_icon_special_class(mime).to_string(),
|
||||
category: mime_to_category(mime).to_string(),
|
||||
size_formatted: format_file_size(size),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,9 +70,8 @@ impl From<File> for FileDto {
|
||||
// To convert from FileDto to File for batch handlers
|
||||
impl From<FileDto> for File {
|
||||
fn from(dto: FileDto) -> Self {
|
||||
// Use constructor to create an entity from DTO
|
||||
// Note: this should be simplified if File has a proper constructor
|
||||
// If not, make the conversion as best as possible
|
||||
// Display fields (icon_class, icon_special_class, category, size_formatted)
|
||||
// are not part of the domain entity and are ignored.
|
||||
File::from_dto(
|
||||
dto.id,
|
||||
dto.name,
|
||||
@@ -75,6 +97,10 @@ impl FileDto {
|
||||
folder_id: None,
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
icon_class: "fas fa-file".to_string(),
|
||||
icon_special_class: String::new(),
|
||||
category: "Document".to_string(),
|
||||
size_formatted: "0 Bytes".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,17 @@ pub struct FolderDto {
|
||||
|
||||
/// Whether this is a root folder
|
||||
pub is_root: bool,
|
||||
|
||||
// ── Pre-computed display fields ──
|
||||
|
||||
/// FontAwesome icon CSS class (always "fas fa-folder")
|
||||
pub icon_class: String,
|
||||
|
||||
/// Extra CSS class for icon styling (always "folder-icon")
|
||||
pub icon_special_class: String,
|
||||
|
||||
/// Human-readable category (always "Folder")
|
||||
pub category: String,
|
||||
}
|
||||
|
||||
impl From<Folder> for FolderDto {
|
||||
@@ -67,6 +78,9 @@ impl From<Folder> for FolderDto {
|
||||
created_at: folder.created_at(),
|
||||
modified_at: folder.modified_at(),
|
||||
is_root,
|
||||
icon_class: "fas fa-folder".to_string(),
|
||||
icon_special_class: "folder-icon".to_string(),
|
||||
category: "Folder".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,8 +88,8 @@ impl From<Folder> for FolderDto {
|
||||
// To convert from FolderDto to Folder for batch handlers
|
||||
impl From<FolderDto> for Folder {
|
||||
fn from(dto: FolderDto) -> Self {
|
||||
// Use constructor to create an entity from DTO
|
||||
// Note: this should be simplified if Folder has a proper constructor
|
||||
// Display fields (icon_class, icon_special_class, category)
|
||||
// are not part of the domain entity and are ignored.
|
||||
Folder::from_dto(
|
||||
dto.id,
|
||||
dto.name,
|
||||
@@ -99,6 +113,9 @@ impl FolderDto {
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
is_root: true,
|
||||
icon_class: "fas fa-folder".to_string(),
|
||||
icon_special_class: "folder-icon".to_string(),
|
||||
category: "Folder".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod address_book_dto;
|
||||
pub mod calendar_dto;
|
||||
pub mod contact_dto;
|
||||
pub mod display_helpers;
|
||||
pub mod favorites_dto;
|
||||
pub mod file_dto;
|
||||
pub mod folder_dto;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// DTO for recent items
|
||||
use super::display_helpers::{format_file_size, mime_to_category, mime_to_icon_class, mime_to_icon_special_class};
|
||||
|
||||
/// DTO for recent items, enriched with item metadata via SQL JOIN
|
||||
/// so the frontend does not need N+1 requests to resolve names/sizes.
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct RecentItemDto {
|
||||
/// Unique identifier for the recent item
|
||||
@@ -18,4 +21,56 @@ pub struct RecentItemDto {
|
||||
|
||||
/// When the item was accessed
|
||||
pub accessed_at: DateTime<Utc>,
|
||||
|
||||
// ── Enriched metadata (resolved via JOIN) ──
|
||||
|
||||
/// Display name of the file or folder
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub item_name: Option<String>,
|
||||
|
||||
/// Size in bytes (files only; folders → None)
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub item_size: Option<i64>,
|
||||
|
||||
/// MIME type (files only)
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub item_mime_type: Option<String>,
|
||||
|
||||
/// Parent folder ID (folder_id for files, parent_id for folders)
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub parent_id: Option<String>,
|
||||
|
||||
// ── Pre-computed display fields ──
|
||||
|
||||
/// FontAwesome icon CSS class (e.g. "fas fa-file-image", "fas fa-folder")
|
||||
pub icon_class: String,
|
||||
|
||||
/// Extra CSS class for icon styling (e.g. "image-icon", "folder-icon")
|
||||
pub icon_special_class: String,
|
||||
|
||||
/// Human-readable category (e.g. "Image", "Folder")
|
||||
pub category: String,
|
||||
|
||||
/// Formatted file size (e.g. "3.27 MB"); "--" for folders
|
||||
pub size_formatted: String,
|
||||
}
|
||||
|
||||
impl RecentItemDto {
|
||||
/// Populate display fields from the enriched metadata.
|
||||
/// Call this after constructing from the SQL row.
|
||||
pub fn with_display_fields(mut self) -> Self {
|
||||
if self.item_type == "folder" {
|
||||
self.icon_class = "fas fa-folder".to_string();
|
||||
self.icon_special_class = "folder-icon".to_string();
|
||||
self.category = "Folder".to_string();
|
||||
self.size_formatted = "--".to_string();
|
||||
} else {
|
||||
let mime = self.item_mime_type.as_deref().unwrap_or("application/octet-stream");
|
||||
self.icon_class = mime_to_icon_class(mime).to_string();
|
||||
self.icon_special_class = mime_to_icon_special_class(mime).to_string();
|
||||
self.category = mime_to_category(mime).to_string();
|
||||
self.size_formatted = format_file_size(self.item_size.unwrap_or(0) as u64);
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,6 +742,7 @@ mod tests {
|
||||
// Test creating a file share
|
||||
let dto = CreateShareDto {
|
||||
item_id: "test_file_id".to_string(),
|
||||
item_name: Some("test_file.txt".to_string()),
|
||||
item_type: "file".to_string(),
|
||||
password: Some("secret".to_string()),
|
||||
expires_at: None,
|
||||
|
||||
@@ -27,14 +27,23 @@ impl FavoritesRepositoryPort for FavoritesPgRepository {
|
||||
let rows = sqlx::query(
|
||||
r#"
|
||||
SELECT
|
||||
id::TEXT AS "id",
|
||||
user_id::TEXT AS "user_id",
|
||||
item_id AS "item_id",
|
||||
item_type AS "item_type",
|
||||
created_at AS "created_at"
|
||||
FROM auth.user_favorites
|
||||
WHERE user_id = $1::TEXT
|
||||
ORDER BY created_at DESC
|
||||
uf.id::TEXT AS "id",
|
||||
uf.user_id::TEXT AS "user_id",
|
||||
uf.item_id AS "item_id",
|
||||
uf.item_type AS "item_type",
|
||||
uf.created_at AS "created_at",
|
||||
COALESCE(f.name, fld.name) AS "item_name",
|
||||
f.size AS "item_size",
|
||||
f.mime_type AS "item_mime_type",
|
||||
COALESCE(f.folder_id::TEXT, fld.parent_id::TEXT) AS "parent_id",
|
||||
COALESCE(f.updated_at, fld.updated_at) AS "modified_at"
|
||||
FROM auth.user_favorites uf
|
||||
LEFT JOIN storage.files f ON uf.item_type = 'file'
|
||||
AND uf.item_id = f.id::TEXT
|
||||
LEFT JOIN storage.folders fld ON uf.item_type = 'folder'
|
||||
AND uf.item_id = fld.id::TEXT
|
||||
WHERE uf.user_id = $1::TEXT
|
||||
ORDER BY uf.created_at DESC
|
||||
"#,
|
||||
)
|
||||
.bind(user_uuid)
|
||||
@@ -57,7 +66,17 @@ impl FavoritesRepositoryPort for FavoritesPgRepository {
|
||||
item_id: row.get("item_id"),
|
||||
item_type: row.get("item_type"),
|
||||
created_at: row.get("created_at"),
|
||||
})
|
||||
item_name: row.try_get("item_name").ok(),
|
||||
item_size: row.try_get("item_size").ok(),
|
||||
item_mime_type: row.try_get("item_mime_type").ok(),
|
||||
parent_id: row.try_get("parent_id").ok(),
|
||||
modified_at: row.try_get("modified_at").ok(),
|
||||
// Temporary defaults; with_display_fields() computes the real values
|
||||
icon_class: String::new(),
|
||||
icon_special_class: String::new(),
|
||||
category: String::new(),
|
||||
size_formatted: String::new(),
|
||||
}.with_display_fields())
|
||||
.collect();
|
||||
|
||||
Ok(favorites)
|
||||
|
||||
@@ -27,14 +27,22 @@ impl RecentItemsRepositoryPort for RecentItemsPgRepository {
|
||||
let rows = sqlx::query(
|
||||
r#"
|
||||
SELECT
|
||||
id::TEXT AS "id",
|
||||
user_id::TEXT AS "user_id",
|
||||
item_id AS "item_id",
|
||||
item_type AS "item_type",
|
||||
accessed_at AS "accessed_at"
|
||||
FROM auth.user_recent_files
|
||||
WHERE user_id = $1::TEXT
|
||||
ORDER BY accessed_at DESC
|
||||
ur.id::TEXT AS "id",
|
||||
ur.user_id::TEXT AS "user_id",
|
||||
ur.item_id AS "item_id",
|
||||
ur.item_type AS "item_type",
|
||||
ur.accessed_at AS "accessed_at",
|
||||
COALESCE(f.name, fld.name) AS "item_name",
|
||||
f.size AS "item_size",
|
||||
f.mime_type AS "item_mime_type",
|
||||
COALESCE(f.folder_id::TEXT, fld.parent_id::TEXT) AS "parent_id"
|
||||
FROM auth.user_recent_files ur
|
||||
LEFT JOIN storage.files f ON ur.item_type = 'file'
|
||||
AND ur.item_id = f.id::TEXT
|
||||
LEFT JOIN storage.folders fld ON ur.item_type = 'folder'
|
||||
AND ur.item_id = fld.id::TEXT
|
||||
WHERE ur.user_id = $1::TEXT
|
||||
ORDER BY ur.accessed_at DESC
|
||||
LIMIT $2
|
||||
"#,
|
||||
)
|
||||
@@ -59,7 +67,16 @@ impl RecentItemsRepositoryPort for RecentItemsPgRepository {
|
||||
item_id: row.get("item_id"),
|
||||
item_type: row.get("item_type"),
|
||||
accessed_at: row.get("accessed_at"),
|
||||
})
|
||||
item_name: row.try_get("item_name").ok(),
|
||||
item_size: row.try_get("item_size").ok(),
|
||||
item_mime_type: row.try_get("item_mime_type").ok(),
|
||||
parent_id: row.try_get("parent_id").ok(),
|
||||
// Temporary defaults; with_display_fields() computes the real values
|
||||
icon_class: String::new(),
|
||||
icon_special_class: String::new(),
|
||||
category: String::new(),
|
||||
size_formatted: String::new(),
|
||||
}.with_display_fields())
|
||||
.collect();
|
||||
|
||||
Ok(items)
|
||||
|
||||
@@ -216,6 +216,9 @@ async fn handle_propfind(
|
||||
created_at: Utc::now().timestamp() as u64,
|
||||
modified_at: Utc::now().timestamp() as u64,
|
||||
is_root: true,
|
||||
icon_class: "fas fa-folder".to_string(),
|
||||
icon_special_class: "folder-icon".to_string(),
|
||||
category: "Folder".to_string(),
|
||||
};
|
||||
|
||||
// Generate response
|
||||
|
||||
Reference in New Issue
Block a user