diff --git a/crates/file-ext/src/extensions.rs b/crates/file-ext/src/extensions.rs index cf2f1a570..f4f7d1e37 100644 --- a/crates/file-ext/src/extensions.rs +++ b/crates/file-ext/src/extensions.rs @@ -178,15 +178,16 @@ extension_category_enum! { Cfg, } } + // encrypted file extensions extension_category_enum! { EncryptedExtension _ALL_ENCRYPTED_EXTENSIONS { // Spacedrive encrypted file - Bit = [0x73, 0x64, 0x62, 0x69, 0x74], + SdEnc = [0x62, 0x61, 0x6C, 0x6C, 0x61, 0x70, 0x70], // Spacedrive container - Box = [0x73, 0x64, 0x62, 0x6F, 0x78], + SdContainer = [0x73, 0x64, 0x62, 0x6F, 0x78], // Spacedrive block storage, - Block = [0x73, 0x64, 0x62, 0x6C, 0x6F, 0x63, 0x6B], + SdBlock = [0x73, 0x64, 0x62, 0x6C, 0x6F, 0x63, 0x6B], } } @@ -303,7 +304,7 @@ mod test { let mut file = File::open(path).await.unwrap(); - Extension::resolve_conflicting(&subpath.split(".").last().unwrap(), &mut file, true) + Extension::resolve_conflicting(subpath.split('.').last().unwrap(), &mut file, true) .await } // Video extension tests diff --git a/packages/interface/src/components/explorer/FileThumb.tsx b/packages/interface/src/components/explorer/FileThumb.tsx index da2519adb..653133261 100644 --- a/packages/interface/src/components/explorer/FileThumb.tsx +++ b/packages/interface/src/components/explorer/FileThumb.tsx @@ -6,9 +6,9 @@ import video from '@sd/assets/images/Video.png'; import { ExplorerItem } from '@sd/client'; import clsx from 'clsx'; import { Suspense, lazy, useMemo } from 'react'; - import { useExplorerStore } from '~/hooks/useExplorerStore'; import { usePlatform } from '~/util/Platform'; + import { Folder } from '../icons/Folder'; import { isObject, isPath } from './utils'; @@ -45,8 +45,8 @@ export default function FileThumb({ data, ...props }: Props) { const has_thumbnail = isObject(data) ? data.has_thumbnail : isPath(data) - ? data.object?.has_thumbnail - : !!store.newThumbnails[cas_id]; + ? data.object?.has_thumbnail + : !!store.newThumbnails[cas_id]; const url = platform.getThumbnailUrlById(cas_id); @@ -67,6 +67,7 @@ export default function FileThumb({ data, ...props }: Props) { else if (props.kind === 'Video') icon = video; else if (props.kind === 'Document' && data.extension === 'pdf') icon = documentPdf; else if (props.kind === 'Executable') icon = executable; + else if (props.kind === 'Encrypted') icon = archive; return ; }