aboutsummaryrefslogtreecommitdiff
path: root/Hotline/Models/FileInfo.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-11-07 10:19:42 -0800
committerDustin Mierau <dustin@mierau.me>2025-11-07 10:19:42 -0800
commit87f08cf60a5d7c1cf618463916cbac4dab88e0f8 (patch)
treec15a94443801beff5fcb8ac5d5dbc8276726ee39 /Hotline/Models/FileInfo.swift
parentbcf36ef614aa46ae3d8e714add470f749fdf3714 (diff)
Massive refactor of transfer cients (new folder upload implementation), brand new async version of NetSocket, and a rewritten Hotline view model. New cross-server transfers UI.
Diffstat (limited to 'Hotline/Models/FileInfo.swift')
-rw-r--r--Hotline/Models/FileInfo.swift16
1 files changed, 15 insertions, 1 deletions
diff --git a/Hotline/Models/FileInfo.swift b/Hotline/Models/FileInfo.swift
index 62ec831..e3081c4 100644
--- a/Hotline/Models/FileInfo.swift
+++ b/Hotline/Models/FileInfo.swift
@@ -49,11 +49,25 @@ import UniformTypeIdentifiers
var children: [FileInfo]? = nil
var isPreviewable: Bool {
- let fileExtension = (self.name as NSString).pathExtension
+ let fileExtension = (self.name as NSString).pathExtension.lowercased()
if let fileType = UTType(filenameExtension: fileExtension) {
+ if fileType.canBePreviewedByQuickLook {
+ return true
+ }
+
+ print("FILE TYPE?", fileType, fileExtension, fileType.isSubtype(of: .pdf), fileType.isSupertype(of: .pdf))
if fileType.isSubtype(of: .image) {
return true
}
+ else if fileType.isSubtype(of: .pdf) || fileExtension == "pdf" {
+ return true
+ }
+ else if fileType.isSubtype(of: .audio) {
+ return true
+ }
+ else if fileType.isSubtype(of: .video) {
+ return true
+ }
else if fileType.isSubtype(of: .text) {
return true
}