Add sorting shuffle, and name asc/desc

This commit is contained in:
Cameron
2024-11-23 19:13:25 -05:00
parent 287a61ae3f
commit 6986540295
4 changed files with 43 additions and 3 deletions

View File

@@ -100,6 +100,14 @@ pub struct PhotosResponse {
pub dirs: Vec<String>,
}
#[derive(Copy, Clone, Deserialize, PartialEq, Debug)]
#[serde(rename_all = "lowercase")]
pub enum SortType {
Shuffle,
NameAsc,
NameDesc,
}
#[derive(Deserialize)]
pub struct FilesRequest {
pub path: String,
@@ -107,6 +115,7 @@ pub struct FilesRequest {
pub tag_ids: Option<String>,
pub tag_filter_mode: Option<FilterMode>,
pub recursive: Option<bool>,
pub sort: Option<SortType>,
}
#[derive(Copy, Clone, Deserialize, PartialEq, Debug)]