@@ -372,36 +372,6 @@ impl FileExplorerPlugin {
372372 } ) ;
373373 }
374374
375- // if let Some(query_params) = query_params {
376- // if let Some(sort_by) = query_params.sort_by {
377- // match sort_by {
378- // SortBy::Name => {
379- // directory_entries.sort_by_key(|entry| entry.display_name.clone());
380- // }
381- // SortBy::Size => directory_entries.sort_by_key(|entry| entry.size_bytes),
382- // SortBy::DateCreated => {
383- // directory_entries.sort_by_key(|entry| entry.date_created)
384- // }
385- // SortBy::DateModified => {
386- // directory_entries.sort_by_key(|entry| entry.date_modified)
387- // }
388- // };
389-
390- // let sort_enum = match sort_by {
391- // SortBy::Name => Sort::Name,
392- // SortBy::Size => Sort::Size,
393- // SortBy::DateCreated => Sort::DateCreated,
394- // SortBy::DateModified => Sort::DateModified,
395- // };
396-
397- // return Ok(DirectoryIndex {
398- // entries: directory_entries,
399- // breadcrumbs,
400- // sort: sort_enum,
401- // });
402- // }
403- // }
404-
405375 directory_entries. sort ( ) ;
406376
407377 Ok ( DirectoryIndex {
@@ -414,21 +384,4 @@ impl FileExplorerPlugin {
414384 async fn marshall_directory_index ( & self , path : PathBuf ) -> Result < DirectoryIndex > {
415385 Self :: index_directory ( self . path . clone ( ) , path)
416386 }
417-
418- // pub async fn make_http_file_response(file: Box<File>) -> Result<Response<Full<Bytes>>> {
419- // Response::builder()
420- // .header(CONTENT_TYPE, file.mime().to_string())
421- // .header(
422- // ETAG,
423- // format!(
424- // "W/\"{0:x}-{1:x}.{2:x}\"",
425- // file.size(),
426- // file.last_modified().unwrap().timestamp(),
427- // file.last_modified().unwrap().timestamp_subsec_nanos(),
428- // ),
429- // )
430- // .header(LAST_MODIFIED, file.last_modified().unwrap().to_rfc2822())
431- // .body(Full::new(Bytes::from(file.bytes())))
432- // .context("Failed to build HTTP File Response")
433- // }
434387}
0 commit comments