From 943b227fc922aed99394bff15dfc09e068f3311a Mon Sep 17 00:00:00 2001 From: Jason Morley Date: Tue, 10 Dec 2024 20:49:52 -1000 Subject: [PATCH] fix: Convert files with .mbm extension (#150) --- Reconnect/Model/TransfersModel.swift | 2 +- .../Sources/ReconnectCore/Extensions/DirectoryEntry.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Reconnect/Model/TransfersModel.swift b/Reconnect/Model/TransfersModel.swift index 3142b75..5ab783c 100644 --- a/Reconnect/Model/TransfersModel.swift +++ b/Reconnect/Model/TransfersModel.swift @@ -66,7 +66,7 @@ class TransfersModel { // reasonable point to hook an initial implementation. var urls: [URL] = [downloadURL] if convertFiles { - if directoryEntry.fileType == .mbm { + if directoryEntry.fileType == .mbm || directoryEntry.pathExtension.lowercased() == "mbm" { urls = try PsiLuaEnv().convertMultiBitmap(at: downloadURL, removeSource: true) } } diff --git a/ReconnectCore/Sources/ReconnectCore/Extensions/DirectoryEntry.swift b/ReconnectCore/Sources/ReconnectCore/Extensions/DirectoryEntry.swift index 73e9e5f..788d88a 100644 --- a/ReconnectCore/Sources/ReconnectCore/Extensions/DirectoryEntry.swift +++ b/ReconnectCore/Sources/ReconnectCore/Extensions/DirectoryEntry.swift @@ -48,5 +48,9 @@ extension FileServer.DirectoryEntry { } } } + + public var pathExtension: String { + return (self.name as NSString).pathExtension + } }