Skip to content

Commit 45ca79a

Browse files
code
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
1 parent 246dac1 commit 45ca79a

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

Sources/NextcloudKit/TypeIdentifiers/NKTypeIdentifiers.swift

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,39 +90,3 @@ public actor NKTypeIdentifiers {
9090
filePropertyCache.removeAll()
9191
}
9292
}
93-
94-
/// Helper class to access NKTypeIdentifiers from sync contexts (e.g. in legacy code or libraries).
95-
public final class NKTypeIdentifiersHelper {
96-
public static let shared = NKTypeIdentifiersHelper()
97-
98-
// Internal actor reference (uses NKTypeIdentifiers.shared by default)
99-
private let actor: NKTypeIdentifiers
100-
101-
private init() {
102-
self.actor = .shared
103-
}
104-
105-
// Init with optional custom actor (useful for testing)
106-
public init(actor: NKTypeIdentifiers = .shared) {
107-
self.actor = actor
108-
}
109-
110-
// Synchronously resolves file type info by calling the async actor inside a semaphore block.
111-
public func getInternalTypeSync(fileName: String, mimeType: String, directory: Bool, account: String) -> NKTypeIdentifierCache {
112-
var result: NKTypeIdentifierCache?
113-
let semaphore = DispatchSemaphore(value: 0)
114-
115-
Task {
116-
result = await actor.getInternalType(
117-
fileName: fileName,
118-
mimeType: mimeType,
119-
directory: directory,
120-
account: account
121-
)
122-
semaphore.signal()
123-
}
124-
125-
semaphore.wait()
126-
return result!
127-
}
128-
}

0 commit comments

Comments
 (0)